-
Notifications
You must be signed in to change notification settings - Fork 23
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
Upgrade 5.x release branch further to Gradle 6 with new release setup #84
Conversation
… central analytics config via dependency zip
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.
This builds for me, including as a part of an included build from Terasology/libs from both command line and IntelliJ IDEA. 🎉
gradle has a bunch of things to say about deprecations, things to change to be more forward-compatible or to support various build optimization strategies, but this PR is already such a big leap forward I wouldn't hold it back for that sort of thing.
One thing that does strike me as quirky is that it uses a subprojects {}
block in the root project to apply common.gradle, but explicitly edits the subprojects individual build.gradle files to apply publish.gradle.
You could also run gradle wrapper
one more time to refresh the gradlew and gradlew.bat scripts.
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 left two solution with test problem.
You problem: not consistent configuration for tests.
You said to Gradle: "Use Junit Platform" and not said to dependecies: "Fetch TestEngine for tests"
gradle.properties
Outdated
@@ -1 +1 @@ | |||
version=5.1.5 | |||
version=5.1.6-SNAPSHOT |
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.
Oh NOOOOOOO!!!!
SNAPSHOT
again!
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.
Yes, just so the build doesn't fail as it tries to publish 5.1.5
a second time ;-) When this is complete and tested post-merge it'll be 5.1.6
don't worry :-)
gradle/common.gradle
Outdated
|
||
// Extra details provided for unit tests | ||
test { | ||
useJUnitPlatform() |
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.
You want using Junit Platform (part of junit 5).
If you want to left junit 4 there, then use pure junit4 "runner":
useJUnitPlatform() | |
useJUnit() |
compile group: 'com.google.guava', name: 'guava', version: '19.0' | ||
|
||
// These dependencies are only needed for running tests | ||
testCompile group: 'junit', name: 'junit', version: '4.12' |
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.
You using Junit 4 !
If you want use Junit Platform
(gradle's test
section) and Junit 4 tests behind:
testCompile group: 'junit', name: 'junit', version: '4.12' | |
testImplementation("junit:junit:4.13") | |
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.7.0") |
or add this for migrate layer :D
testCompile group: 'junit', name: 'junit', version: '4.12' | |
testImplementation("junit:junit:4.13") | |
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.7.0") | |
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0") | |
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0") |
If you want use pure Junit 5 - then you must migrate tests first. :3 (You can do it with Idea's Migrate
command)
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.
Builds OK here
Should be OK to merge along with #78 pending revision on @DarkWeird's comments |
Thanks for the review and testing all! Will fix up and push to the new branch then. @keturn the newer Gradle in the latest release line is already way better than what's here, since I redid all that once already. I did a less grand overhaul here just because it is a doomed release line anyway. It is a little messier in some places than it could be. @DarkWeird thanks for pointing out the test issue! Figured it was something like that |
Okay I think the unit test issue is resolved although I got some weird new failures locally - they didn't show up in Jenkins, however. Might just be weird build state in my workspace.
|
Builds on #78 and overhauls Gradle some more with the existing setup in TeraNUI + MovingBlocks/TeraNUI#30
Draft PR because this shouldn't be merged to the
5.1.5
release branch (we already released that), plus the new release setup works onrelease/v5.x
style branches that define long-lived release branches in parallel from whatever is the main thing (v7.x here indevelop
) and then just uses theversion
field to figure out what to publish, including snapshot vs release (amusingly some of that logic I stole from latest Gestalt, then used for JNBullet, then used for TeraNUI and now it has come full circle and ended up in an older Gestalt version again) . Then after a release we just tag for historical reference. So if this looks good I'll just push to that new branch instead.This includes a new-school multibranch pipeline release job in the shiny new Jenkins, configured via code not UI: http://jenkins.terasology.io/teraorg/job/Nanoware/job/Gestalt/job/release%252Fv5.x/
One potential thing to fix: Something about the way the unit tests run fails in this branch, both locally and in Jenkins:
I'm going to guess that's probably an easy fix, but I've been incredibly lucky with Gradle tonight so I'm going to leave it at this for now and not push my luck further :-)
Another minor annoyance, which isn't new: the base javadoc setup in Jenkins only lets it archive one location per job like this :-( I think that was partly from back when there were freestyle builds and Maven builds - the Maven ones were split into sub-jobs per Maven module, which could then add their own unique things. Not sure that's even a thing for Maven anymore (Maven-specific pipeline thingies) and it never was for Gradle.
While this is applied to the v5.x release line it shouldn't be hard to also apply to v7.x - I ended up redoing a bunch of the Gradle work in this older branch which I did for the newer line already. Similar stuff, will handle when able and this here looks good 👍