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

Bump gradle maven publish plugin from 0.21.0 to 0.25.3 #810

Merged
merged 10 commits into from
Aug 22, 2023
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Releasing
3. Update the `README.md` with the new version.
4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
5. `git tag -a vX.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
6. `./gradlew clean publish --no-daemon --no-parallel`
6. `./gradlew clean publish`
7. Update the `gradle.properties` to the next SNAPSHOT version.
8. `git commit -am "Prepare next development version."`
9. `git push && git push --tags`
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.21.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.3'
// This restriction is needed due to our mix of Android and Java modules;
// without it, the build fails with a weird error.
// See https://stackoverflow.com/questions/70217853/how-to-include-android-project-in-a-gradle-multi-project-build
Expand Down
4 changes: 2 additions & 2 deletions jar-infer/jar-infer-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ publishing {
// Since we are skipping the default maven publication, we append the `:sources` and
// `:javadoc` artifacts here. They are also required for Maven Central validation.
afterEvaluate {
artifact project.javaSourcesJar
artifact project.sourcesJar
artifact project.javadocJar
}
// The shadow publication does not auto-configure the pom.xml file for us, so we need to
Expand Down Expand Up @@ -118,7 +118,7 @@ publishing {
// Not sure why e.g. publishShadowPublicationToMavenCentralRepository must depend on signMavenPublication
// (rather than just signShadowPublication)
project.tasks.named('generateMetadataFileForMavenPublication').configure {
dependsOn 'javaSourcesJar'
dependsOn 'sourcesJar'
dependsOn 'simpleJavadocJar'
}
if (project.tasks.findByName('signShadowPublication')) {
Expand Down
2 changes: 1 addition & 1 deletion jar-infer/test-java-lib-jarinfer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jar {

jar.doLast {
javaexec {
classpath = files("${rootProject.projectDir}/jar-infer/jar-infer-cli/build/libs/jar-infer-cli-${VERSION_NAME}.jar")
classpath = files("${rootProject.projectDir}/jar-infer/jar-infer-cli/build/libs/jar-infer-cli.jar")
main = "com.uber.nullaway.jarinfer.JarInfer"
args = ["-i", jar.archiveFile.get(), "-o", "${jar.destinationDirectory.get()}/${astubxPath}"]
}
Expand Down
12 changes: 4 additions & 8 deletions nullaway/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ dependencies {
testImplementation deps.test.mockitoInline
testImplementation deps.test.javaxAnnotationApi
testImplementation deps.test.assertJ

// This ends up being resolved to the NullAway jar under nullaway/build/libs
nullawayJar "com.uber.nullaway:nullaway:$VERSION_NAME"
}

javadoc {
Expand Down Expand Up @@ -160,11 +157,12 @@ tasks.register('buildWithNullAway', JavaCompile) {
source = sourceSets.main.java
classpath = sourceSets.main.compileClasspath
destinationDirectory = file("$buildDir/ignoredClasses")
def nullawayDeps = configurations.nullawayJar.asCollection()
options.annotationProcessorPath = files(
configurations.errorprone.asCollection(),
sourceSets.main.annotationProcessorPath,
nullawayDeps)
// This refers to the NullAway jar built from the current source
jar.archiveFile.get(),
sourceSets.main.compileClasspath)
options.errorprone.enabled = true
options.errorprone {
option("NullAway:AnnotatedPackages", "com.uber,org.checkerframework.nullaway")
Expand All @@ -178,9 +176,7 @@ tasks.register('buildWithNullAway', JavaCompile) {
// Check that the NullAway jar actually exists (without this,
// Gradle will run the compilation even if the jar doesn't exist)
doFirst {
nullawayDeps.forEach { f ->
assert f.exists()
}
assert jar.archiveFile.get().getAsFile().exists()
}
}

Expand Down