-
Notifications
You must be signed in to change notification settings - Fork 471
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
Spock can be compiled on JDK 10 [WIP] #862
Spock can be compiled on JDK 10 [WIP] #862
Conversation
6d78da7
to
da6951e
Compare
da6951e
to
f1fd684
Compare
Codecov Report
@@ Coverage Diff @@
## master #862 +/- ##
============================================
+ Coverage 75% 75.01% +<.01%
Complexity 3422 3422
============================================
Files 368 368
Lines 10528 10545 +17
Branches 1323 1331 +8
============================================
+ Hits 7897 7910 +13
- Misses 2166 2169 +3
- Partials 465 466 +1
Continue to review full report at Codecov.
|
e435c1c
to
240a2bc
Compare
@leonard84 Hi Leonard, could you please give me some feedback for the PR? PS: https://travis-ci.org/spockframework/spock/builds/420159380 - best build so far |
1d34ca6
to
6ad6bde
Compare
def trace | ||
|
||
if (javaVersion >= 9) { | ||
trace = Arrays.stream(exception.getStackTrace()) |
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.
can be done with groovy functions without requiring Java8
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.
Fixed.
settings.gradle
Outdated
@@ -5,7 +5,7 @@ include "spock-spring" | |||
include "spock-spring:spring2-test" | |||
include "spock-spring:spring3-test" | |||
include "spock-guice" | |||
include "spock-tapestry" | |||
// include "spock-tapestry" |
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.
only if javaVersion >1.8
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.
Fixed.
build.gradle
Outdated
tasks.withType(Javadoc) { | ||
//options.addStringOption('-release', releaseVersion) |
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.
what about 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.
Removed.
build.gradle
Outdated
maxGroovyVersion = snapshotVersion ? "3.9.99" : "2.9.99" // TODO lock these down once Groovy 3 gets close to RC stage | ||
if (System.getProperty("groovyVersion")) { | ||
groovyVersion = System.getProperty("groovyVersion") | ||
} | ||
fullVersion = baseVersion + ((!snapshotVersion && releaseCandidate) ? "-RC$releaseCandidate" : "") + "-groovy-$variant" + (snapshotVersion ? "-SNAPSHOT" : '') | ||
variantLessVersion = baseVersion + (snapshotVersion ? "-SNAPSHOT" : (releaseCandidate ? "-RC$releaseCandidate" : "")) | ||
javaVersions = [1.7, 1.8] | ||
javaVersions = [1.8, 9, 10, 11] |
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.
Spock 1.x should still support Java 7, it should work if you add it back in
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.
Fixed.
build.gradle
Outdated
@@ -33,24 +35,32 @@ ext { | |||
"org.codehaus.groovy:groovy-test:${groovyVersion}", | |||
"org.codehaus.groovy:groovy-sql:${groovyVersion}", | |||
"org.codehaus.groovy:groovy-xml:${groovyVersion}", | |||
"org.codehaus.groovy:groovy-jaxb:${groovyVersion}", |
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.
why do we need jaxb?
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.
Removed.
2e61416
to
d50ca96
Compare
e2b2502
to
abe0c37
Compare
@leonard84 I have cleaned up the commit as much as I could. |
if (javaVersion >= 9) { | ||
groovyDependency += ["javax.xml.bind:jaxb-api:2.3.0"] | ||
} | ||
|
||
libs = [ | ||
jetbrainsAnnotations: "org.jetbrains:annotations:13.0", | ||
ant: "org.apache.ant:ant:1.9.7", | ||
asm: "org.ow2.asm:asm:6.2", | ||
bytebuddy: "net.bytebuddy:byte-buddy:1.8.3", |
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.
There are still new fixed/features related to Java 11 compatibility in byte-buddy. I propose to upgrade it to the least stable version - 1.8.18.
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 have tried locally 1.8.17 and some tests fail. I don't believe it is possible due to raphw/byte-buddy#486
Personally, I would rather make this PR work and then somebody can improve it further and add support for Java 11 (#843). To be honest, I don't anything about the stuff mentioned in #843.
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.
Sounds reasonably having the build failing with the newer version. Thanks for trying to keep Spock building on Java 10!
.travis.yml
Outdated
@@ -20,6 +20,8 @@ dist: precise # downgrade to avoid jdk7 SSL Bug https://github.com/docker-librar | |||
jdk: | |||
- oraclejdk7 # openjdk7 has SSL Bug avoid jdk7 SSL Bug https://github.com/docker-library/openjdk/issues/117 | |||
- oraclejdk8 | |||
- openjdk9 |
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.
Java 9 is already eol, the build on travis was green, so I'd say we drop it
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.
Done.
Thanks for your contribution @MartyIX |
} else if (variant == 2.5) { | ||
groovyVersion = "2.5.2" | ||
minGroovyVersion = "2.5.0" | ||
minGroovyVersion = "2.5.2" |
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.
@MartyIX Was it really needed for Java 10 compatibility or you changed in accidentally (and 2.5.0 is still fine)?
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.
@szpak I think I've upgraded the dependency because of this issue https://issues.apache.org/jira/browse/GROOVY-8710. You can certainly try to downgrade it and see if it still works.
Hi,
I did some work on #808 and I can compile Spock with JDK 10. There are several important things though:
Regards,
Martin