Skip to content

Commit

Permalink
update readme; update usage of plugin to gradle plugin portal version
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-lapin committed Mar 30, 2021
1 parent 6c1d47b commit ffe6c57
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 19 deletions.
12 changes: 0 additions & 12 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You could see an example of usage in [sample](https://github.com/sergei-lapin/na
- javac plugin is distributed through JitPack
- Gradle plugin is distributed through Gradle Plugin Portal

#### Add in the root build.gradle
#### Add to the root build.gradle

``` Gradle
buildscript {
Expand All @@ -39,8 +39,37 @@ subprojects {

``` Gradle
plugins {
id("com.sergei-lapin.napt") version "{latest-version}"
id("com.sergei-lapin.napt") version("{latest-version}")
}
annotationProcessor("com.github.sergei-lapin:napt:{latest-version}")
dependencies {
annotationProcessor("com.github.sergei-lapin:napt:{latest-version}")
}
```

#### Ignore NaptTrigger

Add `NaptTrigger.java` to root .gitignore

#### Conflitcting NaptTrigger classes

By default Gradle plugin will generate NaptTrigger with module-named package so the FQ names won't clash, but, just in case, the prefix of NaptTrigger package can be specified like that:

``` Gradle
napt {
naptTriggerPackagePrefix.set("com.slapin.napt")
}
```

Assume we're in module named `sample`, will result in the following `NaptTrigger.java`:

``` Java
package com.slapin.napt.sample;
class NaptTrigger {
}
```

## Dev mode

- Uncomment `includeBuild("napt-gradle")` in root `settings.gradle`
- Run Gradle sync
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ android.defaults.buildfeatures.shaders=false

kotlin.code.style=official

lib.group=com.github.sergei-lapin.napt
lib.group=com.sergei-lapin.napt
lib.version=1.3
2 changes: 1 addition & 1 deletion napt-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ pluginBundle {
website = "https://github.com/sergei-lapin/napt"
vcsUrl = "https://github.com/sergei-lapin/napt.git"
tags = ["kotlin", "java", "apt", "kapt", "gradle", "plugin"]
description = "Plugin that enables the work of NAPT javac plugin. Please refer to the https://github.com/sergei-lapin/napt/blob/main/README.md"
description = "Plugin that enables the work of NAPT javac plugin"
}
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("com.sergei-lapin.napt")
id("com.sergei-lapin.napt") version("1.3")
}

napt {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ rootProject.name = "napt"
include(":sample")
include(":napt-javac")

includeBuild("napt-gradle")
// includeBuild("napt-gradle")

0 comments on commit ffe6c57

Please sign in to comment.