Closed kyngs closed 1 month ago
/cc @evanchooly (kotlin), @geoand (kotlin), @glefloch, @quarkusio/devtools
This is also happening to me +1
This is also happening to me +1
Yeah, I'm starting to worry that I'll need to do the migration manually
I am not sure if OpenRewrite support Gradle multi-module project. If that's the case, feel free to have a look and see what's wrong in the current implementation..
I have been playing around with the init-gradle script and haven't been able to get it to work; however, you can workaround the problem by doing something like this (so I hope this helps someone).
top-level build.gradle extract
plugins{
id 'org.openrewrite.rewrite' version '6.12.0' apply false
}
ext {
quarkusUpdateConfig = project.findProperty('quarkusUpdateConfig') ?: ''
}
if (quarkusUpdateConfig != "") {
apply plugin: "org.openrewrite.rewrite"
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite:rewrite-java")
rewrite("io.quarkus:quarkus-update-recipes:1.0.17")
}
rewrite {
configFile = quarkusUpdateConfig
activeRecipe("io.quarkus.openrewrite.Quarkus")
plainTextMask("**/*.adoc", "**/src/test/resources/__snapshots__/**/*.java", "**/*.kt", "**/*.md", "**/src/main/codestarts/**/*.java", "**/*.txt", "**/META-INF/services/**")
}
}
And then you can have a script
if ! builtin type -f quarkus >/dev/null 2>&1; then
echo "No Quarkus; nothing to do"
exit 2
fi
# This will fail with a exitcode=1, but we capture the recipe.
recipe=$(quarkus update --dry-run 2>/dev/null | grep "OpenRewrite recipe generated" | cut -f 2 -d':' | sed -e "s/^[[:blank:]]*//" -e "s/[[:blank:]]*$//") || true
if [[ -n "$recipe" ]]; then
./gradlew -PquarkusUpdateConfig="$(realpath "$recipe")" rewriteRun
else
echo "No quarkus update recipe generated; no updates?"
fi
What would actually be useful would be for a custom quarkus flag that generates the yml recipe file and does nothing else...
I will close this one as I don't see a way to handle all the possibilities of the Gradle builds out there.
However @quotidian-ennui had a great idea about having a way to save the recipes so that you can apply them yourself. I created https://github.com/quarkusio/quarkus/issues/42743 and will have a look soon.
Describe the bug
When attempting to to run the update script via
quarkus update --stream=3.0
the script fails with the following error:The Gradle plugin way also does not work (
./gradlew -PquarkusPluginVersion=3.0.1.Final quarkusUpdate --stream=3.0
)Expected behavior
The script should update Quarkus to 3.0
Actual behavior
The script errors out with the exception above
How to Reproduce?
Output of
uname -a
orver
Linux dada 6.2.13-zen-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 26 Apr 2023 20:49:44 +0000 x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment (build 17.0.7+7) OpenJDK 64-Bit Server VM (build 17.0.7+7, mixed mode)
GraalVM version (if different from Java)
Not applicable
Quarkus version or git rev
2.11.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 7.4.2 ------------------------------------------------------------ Build time: 2022-03-31 15:25:29 UTC Revision: 540473b8118064efcc264694cbcaa4b677f61041 Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.7 (Oracle Corporation 17.0.7+7) OS: Linux 6.2.13-zen-1-zen amd64
Additional information
No response