Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

build: refactor Gradle build #1539

Merged
merged 4 commits into from
Oct 20, 2021
Merged

build: refactor Gradle build #1539

merged 4 commits into from
Oct 20, 2021

Conversation

chanseokoh
Copy link
Contributor

  • Separating Gradle configurations for releasable projects vs. non-releasable projects.
  • Separating Gradle configurations for Java projects vs. non-Java projects ('gax-bom').
  • Auto-detect publishing to local and skip signing.
  • Miscellaneous cleanups.

@chanseokoh chanseokoh requested review from a team as code owners October 18, 2021 22:18
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 18, 2021
}

if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') &&
!nonReleaseProjects.contains(project.name)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense. As this is the root build.gradle, project.name is always gax-java. And it's correct to configure nexusPublishing in the root.

artifactId = project.name
description = 'Google Api eXtensions for Java'
url = 'https://github.com/googleapis/gax-java'
publishing {
Copy link
Contributor Author

@chanseokoh chanseokoh Oct 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes to the inside block of if (!noDefaultPublications.contains(project.name)) { except one change that I commented below.

}
sign publishing.publications.mavenJava
signing {
required { gradle.taskGraph.hasTask ":${name}:publishToSonatype" }
Copy link
Contributor Author

@chanseokoh chanseokoh Oct 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added required {. And we already filtered noDefaultPublications.

@@ -36,66 +37,46 @@ tasks.whenTaskAdded { task ->
}
}

jar.enabled = false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applying java-library anymore, so we can remove everything related to Java.

@chanseokoh chanseokoh changed the title Refactor Gradle build build: refactor Gradle build Oct 18, 2021
@chanseokoh
Copy link
Contributor Author

Fixed a build failure. Ready for review.

@@ -37,46 +37,45 @@ tasks.whenTaskAdded { task ->
}
}

afterEvaluate {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need this anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't. Now everything inside the block is usable and available. We don't need to wait until the project is evaluated.

@chanseokoh chanseokoh merged commit 9f96d14 into main Oct 20, 2021
@chanseokoh chanseokoh deleted the refactor-gradle branch October 20, 2021 15:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants