Skip to content

Commit

Permalink
Fix versions (#278)
Browse files Browse the repository at this point in the history
Co-authored-by: Dr. Ernie Prabhakar <19791+drernie@users.noreply.github.com>
  • Loading branch information
drernie and drernie authored Dec 21, 2024
1 parent da62adf commit 9ee6f9a
Show file tree
Hide file tree
Showing 13 changed files with 204 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.gradle
.idea
.nextflow*
gradle.properties
# gradle.properties

# Ignore Gradle build output directory
/build/
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ check-env:
clean:
./gradlew clean
rm -rf null results work
rm -rf */*/build plugins/nf-quilt/bin
rm -rf build */build */*/build plugins/nf-quilt/bin
rm -f .nextflow.log* .launch*classpath

clean-all: clean
rm -rf .gradle buildSrc/.gradle

rebuild:
./gradlew clean build --refresh-dependencies

compile:
./gradlew compileGroovy exportClasspath
@echo "DONE `date`"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.10.2
23.10.0
79 changes: 41 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ if (groovyVer) {
maven { url repo }
}

configurations.all {
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.codehaus.groovy') {
force 'cglib:cglib-nodep:3.3.0'
force 'org.objenesis:objenesis:3.4'

// (Optional) If transitive Groovy dependencies cause conflicts
force 'org.codehaus.groovy:groovy:3.0.19'
if ((details.requested.group == 'org.codehaus.groovy') && details.requested.version != groovyVer) {
if (groovyVer.contains(':')) {
details.useTarget(groovyVer)
}
Expand All @@ -49,12 +54,8 @@ if (groovyVer) {
}
}

def projects(String...args) {
args.collect { project(it) }
}

group = 'io.nextflow'
version = rootProject.file('VERSION').text.trim()

allprojects {
apply plugin: 'java'
Expand All @@ -65,17 +66,17 @@ allprojects {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(javaLangVersion)
}
}

compileJava {
options.release = 11
options.release = jdkVersion.toInteger()
}

tasks.withType(GroovyCompile) {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
tasks.withType(GroovyCompile).configureEach {
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
}

idea {
Expand All @@ -98,8 +99,8 @@ allprojects {

dependencies {
// see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement
implementation 'com.github.groovy-wslite:groovy-wslite:1.1.3'
implementation 'org.codehaus.groovy:groovy-all:3.0.23'
// implementation 'com.github.groovy-wslite:groovy-wslite:1.1.3'
implementation "org.codehaus.groovy:groovy-all:$groovyVersion"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
implementation 'com.upplication:s3fs:2.2.2'

Expand All @@ -108,8 +109,8 @@ allprojects {
}
// Documentation required libraries
groovyDoc 'org.fusesource.jansi:jansi:2.4.1'
groovyDoc 'org.codehaus.groovy:groovy-groovydoc:3.0.23'
groovyDoc 'org.codehaus.groovy:groovy-ant:3.0.23'
groovyDoc "org.codehaus.groovy:groovy-groovydoc:$groovyVersion"
groovyDoc "org.codehaus.groovy:groovy-ant:$groovyVersion"
}

test {
Expand All @@ -127,42 +128,44 @@ allprojects {
// Disable strict javadoc checks
// See http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
tasks.withType(Javadoc).configureEach {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

tasks.withType(Jar) {
tasks.withType(Jar).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

// patched as described here
// http://forums.gradle.org/gradle/topics/gradle_task_groovydoc_failing_with_noclassdeffounderror
tasks.withType(Groovydoc) {
tasks.withType(Groovydoc).configureEach {
groovyClasspath = project.configurations.groovyDoc
includes = ['nextflow/**']
}

// Required to run tests on Java 9 and higher in compatibility mode
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
tasks.withType(Test) {
jvmArgs([
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.nio=ALL-UNNAMED',
'--add-opens=java.base/java.nio.file.spi=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.fs=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED',
'--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED',
])
tasks.withType(Test).tap {
configureEach {
jvmArgs([
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.nio=ALL-UNNAMED',
'--add-opens=java.base/java.nio.file.spi=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.fs=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED',
'--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED',
])
}
}
}
}
Expand Down Expand Up @@ -195,8 +198,8 @@ task exportClasspath {
dependsOn allprojects.jar
doLast {
def all = getRuntimeConfigs()
def libs = all.collect { File file -> file.canonicalPath; }
['nextflow', 'nf-commons', 'nf-httfs'].each { libs << file("modules/$it/build/libs/${it}-${version}.jar").canonicalPath }
def libs = all.collect { File file -> file.canonicalPath }
['nextflow', 'nf-commons', 'nf-httfs'].each { libs << file("modules/$it/build/libs/${it}-${nextflowVersion}.jar").canonicalPath }
file('.launch.classpath').text = libs.unique().join(':')
}
}
14 changes: 14 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
// Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
id 'groovy-gradle-plugin'
}

repositories {
// Use the plugin portal to apply community plugins in convention plugins.
gradlePluginPortal()
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
// Apply the common convention plugin for shared build configuration between library and application projects.
id 'io.nextflow.groovy-common-conventions'

// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
// Apply the groovy Plugin to add support for Groovy.
id 'groovy'
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

ext {
jdkVersion = '11'
javaLangVersion = 19
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaLangVersion) // from nf-schema
}
}

compileJava {
options.release.set(jdkVersion.toInteger())
}

tasks.withType(GroovyCompile) {
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
}

tasks.withType(Test) {
jvmArgs ([
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.nio=ALL-UNNAMED',
'--add-opens=java.base/java.nio.file.spi=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.fs=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED',
'--add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED',
'--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED',
])
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
// Apply the common convention plugin for shared build configuration between library and application projects.
id 'io.nextflow.groovy-common-conventions'
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
}

4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nextflowVersion = 23.10.0
groovyVersion = 3.0.19
jdkVersion = 11
javaLangVersion = 19
8 changes: 4 additions & 4 deletions groovysh-task.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ gradle.projectsLoaded {
afterEvaluate { project ->
if (!project.repositories.any { it.name == 'MavenRepo' }) {
project.repositories {
// To be able to load org.apache.groovy:groovy-groovysh and dependencies
// To be able to load org.codehaus.groovy:groovy-groovysh and dependencies
mavenCentral {
content {
includeGroup 'org.apache.groovy'
includeGroup 'org.codehaus.groovy'
includeGroup 'jline'
includeGroup 'com.github.javaparser'
includeGroup 'org.ow2.asm'
Expand All @@ -21,7 +21,7 @@ gradle.projectsLoaded {
}

project.dependencies {
groovyshdependencies 'org.apache.groovy:groovy-groovysh:4.0.24'
groovyshdependencies 'org.codehaus.groovy:groovy-groovysh:4.0.24'
}

project.tasks.register('groovysh') {
Expand All @@ -35,7 +35,7 @@ gradle.projectsLoaded {

def groovyshClass
def groovyShell
groovyshClass = Class.forName('org.apache.groovy.groovysh.Groovysh', true, groovyshClassLoader)
groovyshClass = Class.forName('org.codehaus.groovy.groovysh.Groovysh', true, groovyshClassLoader)
if (groovyshClass) {
groovyShell = groovyshClass.newInstance()
if (groovyShell) {
Expand Down
Loading

0 comments on commit 9ee6f9a

Please sign in to comment.