diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 00000000..66a0569c --- /dev/null +++ b/buildSrc/build.gradle @@ -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() +} + diff --git a/buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle b/buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle new file mode 100644 index 00000000..ecc029b2 --- /dev/null +++ b/buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle @@ -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' +} diff --git a/buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle b/buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle new file mode 100644 index 00000000..d51949f0 --- /dev/null +++ b/buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle @@ -0,0 +1,48 @@ +/* + * 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() +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } +} + +compileJava { + options.release.set(17) +} + +tasks.withType(GroovyCompile) { + sourceCompatibility = '17' + targetCompatibility = '17' +} + +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', + ]) +} diff --git a/buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle b/buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle new file mode 100644 index 00000000..0183e2cc --- /dev/null +++ b/buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle @@ -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' +} +