Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Feb 19, 2023
1 parent e67bdde commit 6802c8a
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ignore Gradle project-specific cache directory
.gradle
.idea
.nextflow
.nextflow*

# Ignore Gradle build output directory
build
Expand Down
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,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(17)
}
}

compileJava {
options.release.set(11)
}

tasks.withType(GroovyCompile) {
sourceCompatibility = '11'
targetCompatibility = '11'
}

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'
}

20 changes: 20 additions & 0 deletions plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ subprojects {
"sha512sum": "${computeSha512(zip)}"
}
""".stripIndent()
// cleanup tmp dir
file("$buildDir/tmp/makeZip").deleteDir()
}
outputs.file("$buildDir/libs/${project.name}-${project.version}.zip")
}
Expand Down Expand Up @@ -139,10 +141,28 @@ subprojects {
skipExisting = true
}

jar {
from sourceSets.main.allSource
doLast {
file("$buildDir/tmp/jar").deleteDir()
}
}

tasks.withType(GenerateModuleMetadata) {
enabled = false
}

task upload(dependsOn: [uploadPlugin] ) { }
}

/*
* Upload all plugins to the corresponding GitHub repos
*/
task upload(dependsOn: [subprojects.uploadPlugin]) { }

/*
* Copies the plugins required dependencies in the corresponding lib directory
*/
classes.dependsOn subprojects.copyPluginLibs

/*
Expand Down
7 changes: 1 addition & 6 deletions plugins/nf-hello/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@

plugins {
// Apply the groovy plugin to add support for Groovy
id 'groovy'
id 'io.nextflow.groovy-library-conventions'
id 'idea'
}

group = 'io.nextflow'
// DO NOT SET THE VERSION HERE
// THE VERSION FOR PLUGINS IS DEFINED IN THE `/resources/META-INF/MANIFEST.NF` file
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

idea {
module.inheritOutputDirs = true
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
*/

rootProject.name = 'nf-hello'
include 'plugins'
include('plugins')
include('plugins:nf-hello')

0 comments on commit 6802c8a

Please sign in to comment.