diff options
author | Yigit Boyar <yboyar@google.com> | 2020-12-21 21:57:48 -0800 |
---|---|---|
committer | laszio <ting-yuan@users.noreply.github.com> | 2021-01-05 09:46:42 -0800 |
commit | 8bf72db13e1eee764ec1c00bd827e05f86313cee (patch) | |
tree | 48afa865f48f309d6149596163b78a2ce3c7fd49 /gradle | |
parent | 810917dbfe74b56f4fa4a5653ce12fdbc043db78 (diff) | |
download | ksp-8bf72db13e1eee764ec1c00bd827e05f86313cee.tar.gz |
Gradle plugin publishing setup
This CL updates the build to properly publish the gradle
plugin with an id to avoid the need to modify settings
gradle.
After this change, we'll have the following 4 artifacts:
symbol-processing-api: same as before
symbol-processing: does not include the the gradle-plugin anymore
symbol-processing-gradle-plugin: the gradle plugin
com.google.devtools.ksp.gradle.plugin: gradle plugin marker artifact
After this change, developer can enable KSP by:
id("com.google.devtools.ksp")
* Still needs to have google as a plugin repository.
The gradle plugin publishing model requires publishing a marker artifact
so that Gradle can find the main plugin artifact.
I've added `java-gradle-plugin` plugin to the gradle-plugin module to
enable publishing. Unfortunately, it does have a validation step which
fails while traversing kotlin classes in the classpath so I had to
disable it. We can enable it once gradle depends on kotlin 1.4.
As part of this, I've removed the gradle plugin from the
symbol-processing artifact. Instead, it is now published as
symbol-processing-gradle-plugin artifact (it is consistent with the
project's and androidx's naming scheme but open to changes).
For plugin id, I couldn't use symbol-processing because that would
require us to publish an artifact with symbol-processing group.
Instead, I've picked `com.google.devtools.ksp` which seems close to what
AGP does (com.android.application). This way, we can publish the marker
artifact in the KSP group.
I've made a couple more changes:
* Updated gradle to 6.6.1, which is the version kotlin uses
* Moved publishing setup to the main gradle file to configure common
things (pom, version etc)
* Moved the Jar manifest configuration to the main build file so that
all artifacts have it (was also a necessary change after unbundling the
gradle plugin since it uses that information to find the version).
Had to remove `Implementation-Title` as archiveBaseName is depreacted an
will be removed in 7.
* Added an `outRepo` command line argument to set the repository
location for publication. It is handy when testing with a local build.
Fixes: #203
Diffstat (limited to 'gradle')
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8e8450fa..cea3ac8b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists |