90 lines
2.9 KiB
Groovy
90 lines
2.9 KiB
Groovy
apply plugin: 'java'
|
|
|
|
ext.aws_access_key_id = project.findProperty('aws_access_key_id') ?: System.getenv('AWS_ACCESS_KEY_ID')
|
|
ext.aws_secret_access_key = project.findProperty('aws_secret_access_key') ?: System.getenv('AWS_SECRET_ACCESS_KEY')
|
|
ext.publishRepoUrl = project.findProperty('publish_repo_url') ?: System.getenv('PUBLISH_REPO_URL') ?: ( version.endsWith('-SNAPSHOT') ? "s3://maven.seqera.io/snapshots" : "s3://maven.seqera.io/releases" )
|
|
|
|
jar.enabled = false
|
|
|
|
subprojects {
|
|
apply plugin: 'java'
|
|
apply plugin: 'groovy'
|
|
apply plugin: 'maven-publish'
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
}
|
|
|
|
group = 'io.nextflow'
|
|
version = project.file('VERSION').text.trim()
|
|
|
|
tasks.withType(GenerateModuleMetadata) {
|
|
enabled = false
|
|
}
|
|
|
|
/*
|
|
* Copy the plugin dependencies in the subproject `build/target/libs` directory
|
|
*/
|
|
task copyPluginLibs(type: Sync) {
|
|
group 'nextflow'
|
|
from configurations.runtimeClasspath
|
|
into 'build/target/libs'
|
|
}
|
|
|
|
/*
|
|
* Copy the plugin manifest to resources directory for dev mode discovery.
|
|
* In dev mode, pf4j looks for META-INF/MANIFEST.MF in the classpath directories,
|
|
* but Gradle only generates it during JAR creation. This task copies the manifest
|
|
* to the resources directory after the JAR is built.
|
|
*/
|
|
task copyPluginManifest(type: Copy) {
|
|
group 'nextflow'
|
|
from 'build/tmp/jar/MANIFEST.MF'
|
|
into 'build/resources/main/META-INF'
|
|
dependsOn jar
|
|
}
|
|
// Ensure manifest is available for test classpath (needed for dev mode plugin discovery)
|
|
tasks.matching { it.name == 'test' }.configureEach {
|
|
dependsOn copyPluginManifest
|
|
}
|
|
// Ensure packagePlugin task depends on copyPluginManifest to avoid implicit dependency issues
|
|
tasks.matching { it.name == 'packagePlugin' }.configureEach {
|
|
dependsOn copyPluginManifest
|
|
}
|
|
|
|
/*
|
|
* publish jars maven repo on S3
|
|
*/
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from components.java
|
|
suppressPomMetadataWarningsFor('testFixturesApiElements')
|
|
suppressPomMetadataWarningsFor('testFixturesRuntimeElements')
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
name = 'Seqera'
|
|
url = publishRepoUrl
|
|
credentials(AwsCredentials) {
|
|
// keys are defined in the `gradle.properties` file
|
|
accessKey aws_access_key_id
|
|
secretKey aws_secret_access_key
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
* "install" the plugin the project root build/plugins directory
|
|
*/
|
|
project.parent.tasks.getByName("assemble").dependsOn << assemble
|
|
|
|
/*
|
|
* Copies the plugins required dependencies in the corresponding lib directory
|
|
*/
|
|
classes.dependsOn subprojects.copyPluginLibs
|