-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Use Gradle 7.6 to build Gradle plugin #13860
Use Gradle 7.6 to build Gradle plugin #13860
Conversation
@@ -160,24 +160,24 @@ after_success: | |||
echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; | |||
pushd .; | |||
cd modules/openapi-generator-gradle-plugin; | |||
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" publishMavenJavaPublicationToNexusRepository closeAndReleaseRepository --no-daemon; | |||
echo "Finished ./gradlew publishPluginMavenPublicationToNexusRepository closeAndReleaseRepository"; | |||
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" publishPluginMavenPublicationToSonatypeRepository closeAndReleaseRepository; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not figure out why previously the publishMavenJavaPublicationToNexusRepository
task was called in the first if
condition, but the publishPluginMavenPublicationToNexusRepository
task was called in the second. I came to the conclusion this was probably not intentional.
In any case, there is no longer a mavenJava
publication so publishPluginMavenPublicationToSonatypeRepository
is called in both places.
@wing328 could you please review this PR? Thank you! |
@sorin-florea I'd be honored to have you review this PR as well. 😄 |
@saschpe a review from you would be appreciated too. |
0f424ec
to
41ac01b
Compare
@cbornet @jmini @etherealjoy @spacether could I get a review? Thank you! |
@erichaagdev thanks for the PR. Can you please PM me via Slack for a few quick questions when you've time? |
41ac01b
to
a1bd14a
Compare
9815ee5
to
927818d
Compare
- unzip -d /opt/gradle gradle-5.6.4-bin.zip | ||
- export PATH=/opt/gradle/gradle-5.6.4/bin:$PATH | ||
- unzip -d /opt/gradle gradle-7.6-bin.zip | ||
- export PATH=/opt/gradle/gradle-7.6/bin:$PATH | ||
- gradle -v | ||
- java -version | ||
# ensure all modifications created by 'mature' generators are in the git repo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI. thanks for updating it but we no longer use Shippable CI.
I'll file another PR to clean up this file later.
CircleCI node 1 failure not related to this change. |
popd; | ||
fi; | ||
if [ -n $TRAVIS_TAG ] && [[ "$TRAVIS_TAG" =~ ^[v][0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Publishing the gradle plugin to Gradle Portal on tag $TRAVIS_TAG (only)"; | ||
pushd .; | ||
cd modules/openapi-generator-gradle-plugin; | ||
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" publishPlugins -Dgradle.publish.key=$GRADLE_PUBLISH_KEY -Dgradle.publish.secret=$GRADLE_PUBLISH_SECRET --no-daemon; | ||
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" publishPlugins -Dgradle.publish.key=$GRADLE_PUBLISH_KEY -Dgradle.publish.secret=$GRADLE_PUBLISH_SECRET; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erichaagdev we're working on v6.3.0 release but Travis CI shows the following errors:
For more details see https://docs.gradle.org/7.6/release-notes.html
> Configure project :
Signing plugin detected. Will automatically sign the published artifacts.
> Task :pluginDescriptors UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :sourcesJar UP-TO-DATE
> Task :generatePomFileForPluginMavenPublication
> Task :generatePomFileForOpenApiGeneratorPluginMarkerMavenPublication
> Task :signOpenApiGeneratorPluginMarkerMavenPublication FAILED
> Task :compileKotlin
w: /home/travis/build/OpenAPITools/openapi-generator/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt: (805, 48): 'getter for config: CodegenConfig!' is deprecated. Deprecated in Java
w: /home/travis/build/OpenAPITools/openapi-generator/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt: (811, 40): 'getter for config: CodegenConfig!' is deprecated. Deprecated in Java
FAILURE: Build failed with an exception.
* What went wrong:
Could not evaluate onlyIf predicate for task ':signOpenApiGeneratorPluginMarkerMavenPublication'.
> Could not evaluate spec for 'Signing is required, or signatory is set'.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 9s
7 actionable tasks: 4 executed, 3 up-to-date
Do you know what may have caused this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis CI job full log: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/jobs/594874885
This PR updates the
openapi-generator-gradle-plugin
project to build with Gradle 7.6, the latest.All plugin versions have been updated to their latest versions. The plugins
io.codearte.nexus-staging
andde.marcphilipp.nexus-publish
have been replaced byio.github.gradle-nexus.publish-plugin
as recommended by the original plugin authors. Aside from the configuration, the only notable difference is that "Nexus" has been replaced with "Sonatype" in the names of the relevant publish tasks.I'm not sure why previously there existed both a
mavenJava
andpluginMaven
publication. For a Gradle plugin, the only publication needed ispluginMaven
created by thejava-gradle-plugin
plugin. I've removed themavenJava
publication. OnlypluginMaven
is published to Sonatype.I am unable to test publishing to Sonatype. However, I compared the before and after output of
publishToMavenLocal
and saw no notable differences.I did not update the sample project as it does not depend on the version of Gradle used to build the plugin itself. I also did not want to make this PR any larger.
Gradle Build Scan: https://gradle.com/s/d4jzctozh7gem
Gradle 7.6 Release Notes: https://docs.gradle.org/7.6/release-notes.html
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(6.1.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)