Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed Nov 13, 2023
1 parent 47b9d8b commit 67ff407
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ licenseeForAndroid {
enableResourceGeneration = false
resourceFileName = "licensee_artifacts.json"
singularVariantName = null
automaticCoreDependencyManagement = true
}
```

Expand All @@ -49,6 +50,7 @@ licenseeForAndroid {
- `enableResourceGeneration` - Enables copying _licensee_ report to asset(Android)/resource(JVM) directory, making it available under 'resourceFileName' name.
- `resourceFileName` - The name of the asset/resource file the licensee report gets copied to.
- `singularVariantName` - The name of the build variant that all variants will use to have always the same licensed, regardless of app variant. (i.e. `"paidRelease"`)
- `automaticCoreDependencyManagement` - Automatically add `licensee-for-android-core` core artifact as an implementation dependency for the generated code. The idea is to use the core artifact in a consumer project, and wire generated implementation via DI mechanism

### Common recipes

Expand All @@ -72,6 +74,7 @@ licenseeForAndroid {
```
#### Generate Kotlin code in Kotlin-only module using licensee output from a different module

###### Gradle based approach
```groovy
plugins {
id("org.jetbrains.kotlin.jvm") // or any other module type
Expand Down Expand Up @@ -102,5 +105,32 @@ tasks.named("compileKotlin") {
}
```

###### DI based approach

`app/build.gradle`:

```groovy
plugins {
id("com.android.application")
id("app.cash.licensee")
id("io.github.usefulness.licensee-for-android")
}
licenseeForAndroid {
enableKotlinCodeGeneration = true
}
```
\+ provide `LicenseeForAndroid` object as `Licensee` interface

`consumer/build.gradle`:
```groovy
plugins {
id("org.jetbrains.kotlin.jvm") // or any other module type
}
dependencies
```
\+ inject `Licensee` interface


### Credits
Huge thanks to [premex-ab/gross](https://github.com/premex-ab/gross) which this plugin forked from.

0 comments on commit 67ff407

Please sign in to comment.