Skip to content

Commit

Permalink
Update README.md to add better KTS usage explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangl authored Oct 12, 2023
1 parent 148be5c commit cdaa124
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ buildscript {

</details>

<details><summary>Kotlin</summary>
<details><summary>Kotlin (using classpath)</summary>

```kotlin
buildscript {
repositories {
maven("https://jitpack.io")
maven { url = java.net.URI("https://jitpack.io") }
}
dependencies {
classpath("com.github.hyperdevs-team:poeditor-android-gradle-plugin:<latest_version>")
Expand All @@ -43,6 +43,35 @@ buildscript {

</details>

<details><summary>Kotlin (using the plugins block)</summary>

Top-level `settings.gradle.kts`
```kotlin
pluginManagement {
repositories {
maven { url = java.net.URI("https://jitpack.io") }
}
resolutionStrategy {
eachPlugin {
// Add custom plugin ID for the PoEditor plugin.
// This is required because the plugin is not published in the Gradle plugin portal.
if (requested.id.id == "com.hyperdevs.poeditor") {
useModule("com.github.hyperdevs-team:poeditor-android-gradle-plugin:${requested.version}")
}
}
}
}
```

Top-level `build.gradle.kts`
```kotlin
plugins {
id("com.hyperdevs.poeditor") version "<latest_version>" apply false
}
```

</details>

## How to use
Apply and configure the plug-in in your app's `build.gradle` file:
<details open><summary>Groovy</summary>
Expand All @@ -64,14 +93,14 @@ poEditor {

```kotlin
plugins {
id "com.android.application"
id "com.hyperdevs.poeditor"
id("com.android.application")
id("com.hyperdevs.poeditor")
}

poEditor {
apiToken = "your_api_token"
projectId = 12345
defaultLang = "en"
apiToken.set("your_api_token")
projectId.set(12345)
defaultLang.set("en")
}
```

Expand Down

0 comments on commit cdaa124

Please sign in to comment.