-
Notifications
You must be signed in to change notification settings - Fork 34
Add Jakarta EE 8 support #53
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
def generatedSrc = "$buildDir/generated-src"; | ||
def generatedTestSrc = "$buildDir/generated-testSrc"; | ||
def generatedGroovyTestSrc = "$buildDir/generated-testGroovySrc"; | ||
|
||
task generateSources() { | ||
println "[jakarta build] replacing `javax.` with new `jakarta.`" | ||
dependsOn("copyJavaSources", "copyTestJavaSources", "copyTestGroovySources") | ||
} | ||
|
||
task copyTestGroovySources(type: Copy) { | ||
into generatedGroovyTestSrc | ||
from 'src/test/groovy' | ||
filter { line -> line.replaceAll("javax\\.", "jakarta\\.") } | ||
} | ||
|
||
task copyTestJavaSources(type: Copy) { | ||
into generatedTestSrc | ||
from 'src/test/java' | ||
filter { line -> line.replaceAll("javax\\.", "jakarta\\.") } | ||
} | ||
|
||
task copyJavaSources(type: Copy) { | ||
into generatedSrc | ||
from 'src/main/java' | ||
filter { line -> line.replaceAll("javax\\.", "jakarta\\.") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a bit a funny hack to make it work. I don't mind much personally as this is rather temporary, but are we sure there are no changes between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am sure for Java EE 8/Jakarta EE 9 developers there is no difference from the API level between Jakarta EE 8 and Jakarta EE 9, the biggest change is the namespace migrating to new jakarta. |
||
} | ||
|
||
println "[jakarta build] set generated source codes as sourceSets" | ||
sourceSets { | ||
main { | ||
java.srcDirs = [generatedSrc] | ||
resources.srcDirs = ["src/main/resources"] | ||
} | ||
test { | ||
java.srcDirs = [generatedTestSrc] | ||
groovy.srcDirs = [generatedGroovyTestSrc] | ||
} | ||
} | ||
compileJava.dependsOn("generateSources") |
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.
is emtpy string the default value, or should it be null?
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 am not sure the default value of the classifier, I think empty string works.