Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Update versions and plugin DSL #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 35 additions & 15 deletions docs/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,67 +22,87 @@ To add the Hood plugin dependency on Gradle, you can use:

#### Declarative syntax (especially recommended for the Kotlin DSL)

This syntax is possible because Hood is available in [Gradle Plugin Portal](https://plugins.gradle.org/plugin/com.47deg.hood):

<fortyseven-codetab data-languages='["Groovy", "Kotlin"]' markdown="block">
```groovy
plugins {
id "com.47deg.hood" version "0.8.0"
id "com.47deg.hood" version "0.8.1"
}
```

```kotlin
plugins {
id("com.47deg.hood") version "0.8.0"
id("com.47deg.hood") version "0.8.1"
}
```
</fortyseven-codetab>

Don't forget to add the `pluginManagement` block at the top of your `settings.gradle/.kts` if you are not able to find it:
#### Imperative syntax

To use plugin through imperative syntax, you need to first add the dependency on the `buildscript`:

<fortyseven-codetab data-languages='["Groovy", "Kotlin"]' markdown="block">
```groovy
pluginManagement {
buildscript {
repositories {
maven { url "https://dl.bintray.com/47deg/hood" }
gradlePluginPortal()
url "https://plugins.gradle.org/m2/"
}

dependencies {
classpath "com.47deg:hood:0.8.1"
}
}
```

```kotlin
pluginManagement {
buildscript {
repositories {
maven("https://dl.bintray.com/47deg/hood")
gradlePluginPortal()
maven("https://plugins.gradle.org/m2/")
}

dependencies {
classpath("com.47deg:hood:0.8.1")
}
}
```
</fortyseven-codetab>

#### Imperative syntax
and then you will be able to add it with `apply`:

To use plugin through imperative syntax, you need to first add the dependency on the `buildscript`:
<fortyseven-codetab data-languages='["Groovy", "Kotlin"]' markdown="block">
```groovy
apply plugin: "com.47deg.hood"
```

```kotlin
apply(plugin = "com.47deg.hood")
```
</fortyseven-codetab>

In case of using a SNAPSHOT version, the dependency should use a different repository:

<fortyseven-codetab data-languages='["Groovy", "Kotlin"]' markdown="block">
```groovy
buildscript {
repositories {
maven { url "https://dl.bintray.com/47deg/hood" }
url "https://oss.jfrog.org/artifactory/oss-snapshot-local/"
}

dependencies {
classpath "com.47deg:hood:0.8.0"
classpath "com.47deg:hood:0.8.2-SNAPSHOT"
}
}
```

```kotlin
buildscript {
repositories {
maven("https://dl.bintray.com/47deg/hood")
maven("https://oss.jfrog.org/artifactory/oss-snapshot-local/")
}

dependencies {
classpath("com.47deg:hood:0.8.0")
classpath("com.47deg:hood:0.8.2-SNAPSHOT")
}
}
```
Expand Down