Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions HEADER.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright ${year}, ${name}.
Copyright 2021-2026, Seqera.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the good one was the template one

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new license header template does not allow customizable placeholders. The old one is not compatible with Gradle 9.x because it was discontinued. Since this file is still a template I would argue is not so much of an issue: you change the year once in here and run the applyLicense


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -10,5 +10,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

limitations under the License.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
0.21.0
0.22.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, my idea is to release this as next version (includes dependency version bumps that need to be solved for a security issue due next sprint)



2 changes: 1 addition & 1 deletion VERSION-API
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.98.0
1.109.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, upgrading platform version API to latest cloud api available

// Only first line of this file is read
// This version should be bumped to the minimum version where dependent API changes were introduced
// But never higher then the current Platform API Version deployed in Cloud Production: https://cloud.seqera.io/api/service-info
177 changes: 87 additions & 90 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ plugins {
id 'java'
id 'application'
id 'jacoco'
id 'org.cadixdev.licenser' version '0.6.1'
id 'org.graalvm.buildtools.native' version '0.10.6'
id 'com.gradleup.shadow' version '8.3.9'
alias(libs.plugins.yumiLicenser)
alias(libs.plugins.graalvmNative)
alias(libs.plugins.shadow)
}

// define these in the `gradle.properties` file
Expand All @@ -23,53 +23,95 @@ repositories {
}

dependencies {
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'ch.qos.logback:logback-core:1.5.25'
implementation 'ch.qos.logback:logback-classic:1.5.25'
implementation(libs.javaxAnnotation)
implementation(libs.jakartaAnnotation)
implementation(libs.slf4jApi)
implementation(libs.logbackCore)
implementation(libs.logbackClassic)

implementation 'io.seqera.tower:tower-java-sdk:1.107.0'
implementation(libs.towerJavaSdk)
// Upgrade transitive Jersey client dependencies to non-vulnerable 2.x version
implementation "org.glassfish.jersey.core:jersey-client:2.47"
implementation "org.glassfish.jersey.media:jersey-media-multipart:2.47"
implementation "org.glassfish.jersey.media:jersey-media-json-jackson:2.47"
implementation "org.glassfish.jersey.inject:jersey-hk2:2.47"

implementation 'info.picocli:picocli:4.6.3'
implementation 'org.apache.commons:commons-compress:1.28.0'
implementation 'org.tukaani:xz:1.9'
implementation 'io.github.classgraph:classgraph:4.8.165'
annotationProcessor 'info.picocli:picocli-codegen:4.6.3'

testImplementation 'org.mock-server:mockserver-client-java:5.15.0'
testImplementation 'org.mock-server:mockserver-netty:5.15.0'
testImplementation 'org.mock-server:mockserver-junit-jupiter:5.15.0'
implementation(libs.jerseyClient)
implementation(libs.jerseyMediaMultipart)
implementation(libs.jerseyMediaJsonJackson)
implementation(libs.jerseyHk2)

implementation(libs.picocli)
implementation(libs.commonsCompress)
implementation(libs.xz)
implementation(libs.classgraph)
annotationProcessor(libs.picocliCodegen)

testImplementation(libs.mockserverClientJava)
testImplementation(libs.mockserverNetty)
testImplementation(libs.mockserverJunitJupiter)
// Upgrade transitive mock-server dependencies to non-vulnerable 2.x version
testImplementation 'commons-io:commons-io:2.20.0'
testImplementation(libs.commonsIo)

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation(libs.junitJupiterApi)
testImplementation(libs.junitJupiterParams)
testRuntimeOnly(libs.junitJupiterEngine)
testRuntimeOnly(libs.junitPlatformLauncher)

}

license {
header = project.file('HEADER.txt')
properties {
name = 'Seqera'
year = '2021-2023'
rule(file('HEADER.txt'))
exclude('**/*.properties')
exclude('**/*.xml')
exclude('gradlew')
exclude('conf/**')
}

application {
mainClass.set('io.seqera.tower.cli.Tower')
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
exclude '**/*.properties'
exclude 'gradlew'
exclude 'conf/**'
}

task buildInfo {
graalvmNative {
toolchainDetection = true
binaries {
main {
imageName = 'tw'
mainClass = 'io.seqera.tower.cli.Tower'
configurationFileDirectories.from(file('conf'))

if (System.env.getOrDefault("PLATFORM", "") == "linux-x86_64") {
buildArgs(['--static', '--libc=musl', '--gc=G1', '-march=compatibility'])
}
buildArgs.add('--allow-incomplete-classpath')
buildArgs.add('--report-unsupported-elements-at-runtime')
buildArgs.add('-H:+AddAllCharsets')
buildArgs.add('-H:EnableURLProtocols=https,http')
buildArgs.add('-H:+ReportExceptionStackTraces')

javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.matching("Oracle Corporation")
}

}

test {
verbose = true
}
}
}

configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

tasks.register('buildInfo') {
doLast {
def version = rootProject.file('VERSION').text.trim()
def versionApi = rootProject.file('VERSION-API').readLines().get(0).trim()
def commitId = System.env.getOrDefault("GITHUB_SHA", "unknown").substring(0,7)
def commitId = System.env.getOrDefault("GITHUB_SHA", "unknown").substring(0, 7)
def platform = System.env.getOrDefault("PLATFORM", "java")
def info = """\
version=${version}
Expand All @@ -83,24 +125,13 @@ task buildInfo {
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

compileJava {
sourceCompatibility = JavaVersion.toVersion("11")
targetCompatibility = JavaVersion.toVersion("11")
tasks.named('compileJava') {
options.release = 21
options.compilerArgs += ["-Aproject=${project.name}"]
dependsOn buildInfo
dependsOn tasks.named('buildInfo')
}

application {
mainClass.set('io.seqera.tower.cli.Tower')
}

run {
tasks.named('run') {
// Pass CLI arguments via: `./gradlew run --args='arg1 arg2'`, or via: `./gradlew run -Pargs='arg1 arg2'`
if (project.hasProperty('args')) {
args project.args.split('\\s+')
Expand All @@ -120,56 +151,22 @@ tasks.register('runReflectionConfigGenerator', JavaExec) {
jvmArgs = ["-agentlib:native-image-agent=access-filter-file=conf/access-filter-file.json,config-merge-dir=conf/"]
}

shadowJar {
tasks.named('shadowJar') {
archiveBaseName.set('tw')
archiveClassifier.set('')
archiveVersion.set('')
}

test {
tasks.named('test') {
// Use junit platform for unit tests
useJUnitPlatform()
dependsOn checkLicenses
dependsOn tasks.named('checkLicenses')
// Run tests with GraalVM Tracing Agent enabled
if (System.getProperty('tracing-agent')?.toBoolean()) {
jvmArgs = ["-agentlib:native-image-agent=access-filter-file=conf/access-filter-file.json,config-merge-dir=conf/"]
}
}

graalvmNative {
toolchainDetection = true
binaries {
main {
imageName = 'tw'
mainClass = 'io.seqera.tower.cli.Tower'
configurationFileDirectories.from(file('conf'))

if (System.env.getOrDefault("PLATFORM", "") == "linux-x86_64") {
buildArgs(['--static', '--libc=musl', '--gc=G1', '-march=compatibility'])
}
buildArgs.add('--allow-incomplete-classpath')
buildArgs.add('--report-unsupported-elements-at-runtime')
buildArgs.add('-H:+AddAllCharsets')
buildArgs.add('-H:EnableURLProtocols=https,http')
buildArgs.add('-H:+ReportExceptionStackTraces')

javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.matching("Oracle Corporation")
}

}

test {
verbose = true
}
}
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

jacocoTestReport {
dependsOn test // tests are required to run before generating the report
tasks.named('jacocoTestReport') {
dependsOn tasks.named('test') // tests are required to run before generating the report
}
47 changes: 47 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[versions]
classgraphVersion = "4.8.180"
commonsCompressVersion = "1.28.0"
commonsIoVersion = "2.21.0"
graalvmNativeVersion = "0.10.6"
jakartaAnnotationVersion = "3.0.0"
javaxAnnotationVersion = "1.3.2"
jerseyVersion = "2.47"
junitVersion = "5.12.2"
licenserVersion = "2.2.2"
logbackVersion = "1.5.32"
mockserverVersion = "5.15.0"
picocliVersion = "4.6.3"
shadowVersion = "9.3.1"
slf4jVersion = "2.0.17"
towerJavaSdkVersion = "1.107.0"
xzVersion = "1.10"

[libraries]
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraphVersion" }
commonsCompress = { group = "org.apache.commons", name = "commons-compress", version.ref = "commonsCompressVersion" }
commonsIo = { group = "commons-io", name = "commons-io", version.ref = "commonsIoVersion" }
jakartaAnnotation = { group = "jakarta.annotation", name = "jakarta.annotation-api", version.ref = "jakartaAnnotationVersion" }
javaxAnnotation = { group = "javax.annotation", name = "javax.annotation-api", version.ref = "javaxAnnotationVersion" }
jerseyClient = { group = "org.glassfish.jersey.core", name = "jersey-client", version.ref = "jerseyVersion" }
jerseyHk2 = { group = "org.glassfish.jersey.inject", name = "jersey-hk2", version.ref = "jerseyVersion" }
jerseyMediaJsonJackson = { group = "org.glassfish.jersey.media", name = "jersey-media-json-jackson", version.ref = "jerseyVersion" }
jerseyMediaMultipart = { group = "org.glassfish.jersey.media", name = "jersey-media-multipart", version.ref = "jerseyVersion" }
junitJupiterApi = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitVersion" }
junitJupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junitVersion" }
junitJupiterParams = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junitVersion" }
junitPlatformLauncher = { group = "org.junit.platform", name = "junit-platform-launcher" }
logbackClassic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logbackVersion" }
logbackCore = { group = "ch.qos.logback", name = "logback-core", version.ref = "logbackVersion" }
mockserverClientJava = { group = "org.mock-server", name = "mockserver-client-java", version.ref = "mockserverVersion" }
mockserverJunitJupiter = { group = "org.mock-server", name = "mockserver-junit-jupiter", version.ref = "mockserverVersion" }
mockserverNetty = { group = "org.mock-server", name = "mockserver-netty", version.ref = "mockserverVersion" }
picocli = { group = "info.picocli", name = "picocli", version.ref = "picocliVersion" }
picocliCodegen = { group = "info.picocli", name = "picocli-codegen", version.ref = "picocliVersion" }
slf4jApi = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4jVersion" }
towerJavaSdk = { group = "io.seqera.tower", name = "tower-java-sdk", version.ref = "towerJavaSdkVersion" }
xz = { group = "org.tukaani", name = "xz", version.ref = "xzVersion" }

[plugins]
yumiLicenser = { id = "dev.yumi.gradle.licenser", version.ref = "licenserVersion" }
graalvmNative = { id = "org.graalvm.buildtools.native", version.ref = "graalvmNativeVersion" }
shadow = { id = "com.gradleup.shadow", version.ref = "shadowVersion" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
// required to download the toolchain (jdk) from a remote repository
// https://github.com/gradle/foojay-toolchains
// https://docs.gradle.org/current/userguide/toolchains.html#sub:download_repositories
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}

rootProject.name = 'tower-cli'
3 changes: 1 addition & 2 deletions src/main/java/io/seqera/tower/cli/Tower.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023, Seqera.
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023, Seqera.
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.seqera.tower.cli.commands;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/seqera/tower/cli/commands/AbstractCmd.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023, Seqera.
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.seqera.tower.cli.commands;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023, Seqera.
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.seqera.tower.cli.commands;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/seqera/tower/cli/commands/ActionsCmd.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023, Seqera.
* Copyright 2021-2026, Seqera.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.seqera.tower.cli.commands;
Expand Down
Loading
Loading