-
Notifications
You must be signed in to change notification settings - Fork 387
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
Update to use Java 17 #1315
Merged
Update to use Java 17 #1315
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,26 +27,25 @@ apply plugin: 'application' | |
|
||
import org.apache.tools.ant.filters.ReplaceTokens | ||
|
||
//import proguard.gradle.ProGuardTask | ||
|
||
mainClassName = 'org.broad.igv.ui.Main' | ||
ext.moduleName = 'org.igv' | ||
|
||
// Build sourceset for ProGuard | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
[group: 'net.sf.proguard', name: 'proguard-gradle', version: '6.1.1'] | ||
classpath 'net.sf.proguard:proguard-gradle:6.1.1' | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
resources { | ||
|
@@ -128,10 +127,13 @@ dependencies { | |
) | ||
|
||
testImplementation( | ||
[group: 'junit', name: 'junit', version: '4.12'], | ||
[group: 'junit', name: 'junit', version: '4.13'], | ||
[group: 'com.sparkjava', name: 'spark-core', version: '2.2'], | ||
[group: 'org.glassfish.jersey.core', name: 'jersey-common', version: '2.22.4'] | ||
) | ||
testRuntimeOnly( | ||
[group: 'org.junit.vintage', name:'junit-vintage-engine', version:'5.8.2'] | ||
) | ||
} | ||
|
||
|
||
|
@@ -179,35 +181,7 @@ tasks.withType(Test) { | |
systemProperties['org.xerial.snappy.tempdir'] = 'build/tmp' | ||
maxHeapSize = '2g' | ||
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1 | ||
} | ||
|
||
compileTestJava { | ||
inputs.property("moduleName", moduleName) | ||
doFirst { | ||
options.compilerArgs = [ | ||
'--module-path', classpath.asPath, | ||
'--add-modules', 'junit', | ||
'--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath, | ||
] | ||
classpath = files() | ||
} | ||
} | ||
|
||
test { | ||
inputs.property("moduleName", moduleName) | ||
|
||
doFirst { | ||
jvmArgs = [ | ||
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize', | ||
'--module-path', classpath.asPath, | ||
'--add-modules', 'junit', | ||
'--add-modules', 'ALL-MODULE-PATH', | ||
'--add-reads', "$moduleName=junit", | ||
'@scripts/test_suite.args', | ||
'--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir, sourceSets.main.output.resourcesDir).asPath, | ||
] | ||
classpath = files() | ||
} | ||
useJUnitPlatform() | ||
} | ||
|
||
task createDist(type: Copy, dependsOn: jar) { | ||
|
@@ -229,10 +203,11 @@ task createDist(type: Copy, dependsOn: jar) { | |
} | ||
// Copies all Maven-fetched dependency jars | ||
with copySpec { | ||
from configurations.default { | ||
from configurations.runtimeClasspath { | ||
exclude '**/*log4j*.jar' | ||
} | ||
into "lib" | ||
duplicatesStrategy DuplicatesStrategy.EXCLUDE | ||
} | ||
with copySpec { from("genomes/sizes") {} into "lib/genomes" } | ||
|
||
|
@@ -244,32 +219,32 @@ tasks.distTar.enabled = false | |
tasks.startScripts.enabled = false | ||
|
||
task createDistZip(type: Zip, dependsOn: createDist) { | ||
archiveName = "IGV_${version}.zip" | ||
archiveFileName = "IGV_${archiveVersion}.zip" | ||
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. The name changes are all to satisfy gradle deprecation complaints. 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. OK, looks good |
||
from("${buildDir}/IGV-dist") | ||
into "IGV_${version}" | ||
into "IGV_${archiveVersion}" | ||
} | ||
|
||
task createLinuxDistZip(type: Zip, dependsOn: createDist) { | ||
archiveName = "IGV_Linux_${version}.zip" | ||
archiveFileName = "IGV_Linux_${archiveVersion}.zip" | ||
from("${buildDir}/IGV-dist") { | ||
exclude "*.bat" | ||
exclude "*.command" | ||
exclude 'igvtools*' | ||
exclude 'lib/genomes' | ||
} | ||
into "IGV_Linux_${version}" | ||
into "IGV_Linux_${archiveVersion}" | ||
} | ||
|
||
task createLinuxWithJavaDistZip(type: Zip, dependsOn: createDist) { | ||
archiveName = "IGV_Linux_${version}_WithJava.zip" | ||
with copySpec { from jdkBundleLinux into "jdk-11" } | ||
archiveFileName = "IGV_Linux_${archiveVersion}_WithJava.zip" | ||
with copySpec { from jdkBundleLinux into "jdk-17" } | ||
from("${buildDir}/IGV-dist") { | ||
exclude "*.bat" | ||
exclude "*.command" | ||
exclude 'igvtools*' | ||
exclude 'lib/genomes' | ||
} | ||
into "IGV_Linux_${version}" | ||
into "IGV_Linux_${archiveVersion}" | ||
doLast { | ||
if (jdkBundleLinux == "") { | ||
throw new GradleException("Required property not set: jdkBundleLinux"); | ||
|
@@ -278,26 +253,27 @@ task createLinuxWithJavaDistZip(type: Zip, dependsOn: createDist) { | |
} | ||
|
||
task createMacDistZip(type: Zip, dependsOn: createDist) { | ||
archiveName = "IGV_Mac_${version}.zip" | ||
archiveFileName = "IGV_Mac_${archiveVersion}.zip" | ||
from("${buildDir}/IGV-dist") { | ||
exclude "*.bat" | ||
exclude "*_hidpi*" | ||
exclude "igvtools*" | ||
exclude 'lib/genomes' | ||
} | ||
into "IGV_Mac_${version}" | ||
|
||
into "IGV_Mac_${archiveVersion}" | ||
} | ||
|
||
task createMacWithJavaDistZip(type: Zip, dependsOn: createDist) { | ||
archiveName = "IGV_Mac_${version}_WithJava.zip" | ||
with copySpec { from jdkBundleMac into "jdk-11" } | ||
archiveFileName = "IGV_Mac_${archiveVersion}_WithJava.zip" | ||
with copySpec { from jdkBundleMac into "jdk-17" } | ||
from("${buildDir}/IGV-dist") { | ||
exclude "*.bat" | ||
exclude "*_hidpi*" | ||
exclude "igvtools*" | ||
exclude 'lib/genomes' | ||
} | ||
into "IGV_Mac_${version}" | ||
into "IGV_Mac_${archiveVersion}" | ||
doLast { | ||
if (jdkBundleMac == "") { | ||
throw new GradleException("Required property not set: jdkBundleMac"); | ||
|
@@ -339,7 +315,7 @@ task createMacAppDist(type: Copy, dependsOn: createDist) { | |
} | ||
|
||
task createMacAppDistZip(type: Zip, dependsOn: createMacAppDist) { | ||
archiveName = "IGV_MacApp_${version}.zip" | ||
archiveFileName = "IGV_MacApp_${archiveVersion}.zip" | ||
from("${buildDir}/IGV-MacApp-dist") | ||
|
||
doLast { | ||
|
@@ -348,8 +324,8 @@ task createMacAppDistZip(type: Zip, dependsOn: createMacAppDist) { | |
} | ||
|
||
task createMacAppWithJavaDistZip(type: Zip, dependsOn: createMacAppDist) { | ||
archiveName = "IGV_MacApp_${version}_WithJava.zip" | ||
with copySpec { from jdkBundleMac into "IGV_${version}.app/Contents/jdk-11" } | ||
archiveFileName = "IGV_MacApp_${archiveVersion}_WithJava.zip" | ||
with copySpec { from jdkBundleMac into "IGV_${archiveVersion}.app/Contents/jdk-17" } | ||
from("${buildDir}/IGV-MacApp-dist") | ||
|
||
doLast { | ||
|
@@ -383,7 +359,7 @@ task createWinDist(type: Copy, dependsOn: createDist) { | |
} | ||
|
||
task createWinWithJavaDist(type: Copy, dependsOn: createWinDist) { | ||
with copySpec { from jdkBundleWindows into "IGV_${version}/jdk-11" } | ||
with copySpec { from jdkBundleWindows into "IGV_${version}/jdk-17" } | ||
with copySpec { | ||
from("${buildDir}/IGV-WinExe-dist/IGV_${version}") { exclude 'installer.nsi' } | ||
into "IGV_${version}" | ||
|
@@ -465,7 +441,8 @@ task fullJar(type: Jar, dependsOn: jar) { | |
"Application-Name": "IGV", | ||
"Built-By": System.getProperty('user.name'), | ||
"Main-Class": mainClassName, | ||
"Class-Path": configurations.default.collect { it.getName() }.join(' ') | ||
|
||
"Class-Path": configurations.runtimeClasspath.collect { it.getName() }.join(' ') | ||
) | ||
} | ||
} | ||
|
@@ -475,16 +452,3 @@ task fullJar(type: Jar, dependsOn: jar) { | |
//if (!makensisCommand == "" && !signcodeCommand == "") { | ||
// dependsOn signWinExeDist | ||
//} | ||
|
||
// XXX: META-INF versions support (Java11) seem to clash with proguard at this point in time: | ||
// https://sourceforge.net/p/proguard/bugs/665/ | ||
// https://sourceforge.net/p/proguard/discussion/182456/thread/8c56b22dc2/?limit=25 | ||
//task myproguard(type: ProGuardTask) { | ||
//// configuration 'proguard.txt' | ||
// | ||
// injars "${buildDir}/IGV-dist/lib" | ||
// outjars "${buildDir}/libs/igv-proguard.jar" | ||
// | ||
// //libraryjars "${buildDir}/IGV-dist/lib", jarfilter:"lib/**.jar(!META-INF/**)" | ||
// //libraryjars "${System.getProperty('java.home')}/lib/rt.jar" | ||
//} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 test runtime dependency is the engine that runs junit4 tests since gradle seems to assume you're using 5 now.