Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
tags-ignore:
- '*'
pull_request:
types: [opened, reopened, synchronize]
types: [ opened, reopened, synchronize ]

jobs:
linux-image:
Expand Down Expand Up @@ -62,7 +62,6 @@ jobs:
with:
name: tw-agent-jar
path: build/libs/tw-agent.jar


release:
name: Release
Expand Down
2 changes: 1 addition & 1 deletion HEADER.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright ${year}, ${name}.
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 Down
156 changes: 71 additions & 85 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
* defined by the Mozilla Public License, v. 2.0.
*/

import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'org.graalvm.buildtools.native'
id("io.micronaut.application") version "4.4.2"
id 'com.github.johnrengelman.shadow' version '8.1.1'
alias(libs.plugins.licenser)
alias(libs.plugins.graalvmNative)
alias(libs.plugins.micronautApplication)
alias(libs.plugins.shadow)
}

version = project.file('VERSION').text.strip()
Expand All @@ -25,62 +23,83 @@ repositories {
mavenCentral()
}

micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("io.seqera.tower.agent.*")
dependencies {
annotationProcessor(libs.picocliCodegen)
annotationProcessor(libs.micronautHttpValidation)
annotationProcessor(libs.micronautInjectJava)
annotationProcessor(libs.micronautGraal)
implementation(libs.micronautHttpClient)
implementation(libs.micronautRuntime)
implementation(libs.micronautPicocli)
implementation(libs.micronautRxjava2)
implementation(libs.micronautRxjava2HttpClient)
implementation(libs.picocli)
implementation(libs.javaxAnnotation)
implementation(libs.javaxInject)
runtimeOnly(libs.logbackClassic)
runtimeOnly(libs.snakeyaml)
compileOnly(libs.graalvmSvm)

implementation(libs.micronautValidation)
implementation(libs.micronautJacksonDatabind)

testImplementation(platform(libs.junitBom))
testImplementation(libs.junitJupiter)
}

license {
rule(file('HEADER.txt'))
exclude('**/*.properties')
exclude('**/*.xml')
exclude('gradlew')
}

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

def junitVersion = providers.gradleProperty('junit.jupiter.version')
.forUseAtConfigurationTime()
.get()
graalvmNative {
binaries {
main {
imageName = 'tw-agent'
mainClass = 'io.seqera.tower.agent.Agent'
configurationFileDirectories.from(file('conf'))
if (System.env.getOrDefault("PLATFORM", "") == "linux-x86_64") {
buildArgs(['--static', '--libc=musl'])
}
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')
}

dependencies {
annotationProcessor("info.picocli:picocli-codegen")
annotationProcessor("io.micronaut:micronaut-http-validation")
annotationProcessor("io.micronaut:micronaut-inject-java")
annotationProcessor("io.micronaut:micronaut-graal")
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut.picocli:micronaut-picocli")
implementation("io.micronaut.rxjava2:micronaut-rxjava2")
implementation("io.micronaut.rxjava2:micronaut-rxjava2-http-client")
implementation("info.picocli:picocli")
implementation("javax.annotation:javax.annotation-api")
implementation("javax.inject:javax.inject:1")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("org.yaml:snakeyaml")
compileOnly("org.graalvm.nativeimage:svm")

implementation("io.micronaut.validation:micronaut-validation")
implementation("io.micronaut:micronaut-jackson-databind")

testImplementation(platform("org.junit:junit-bom:${junitVersion}"))
testImplementation('org.junit.jupiter:junit-jupiter')
test {
verbose = true
}
}
}

license {
header = project.file('HEADER.txt')
properties {
name = 'Seqera'
year = '2021-2024'
micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("io.seqera.tower.agent.*")
}
exclude '**/*.properties'
exclude 'gradlew'
}

application {
mainClass.set("io.seqera.tower.agent.Agent")
}

task buildInfo {
tasks.register('buildInfo') {
doLast {
def version = rootProject.file('VERSION').text.trim()
def versionApi = rootProject.file('VERSION-API').text.trim()
def commitId = System.env.getOrDefault("GITHUB_SHA", "unknown").substring(0,7)
def commitId = System.env.getOrDefault("GITHUB_SHA", "unknown").substring(0, 7)
def info = """\
version=${version}
versionApi=${versionApi}
Expand All @@ -92,52 +111,19 @@ task buildInfo {
}
}

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

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
dependsOn tasks.named('buildInfo')
}

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

test {
tasks.named('test') {
useJUnitPlatform()
dependsOn checkLicenses
dependsOn tasks.named('checkLicenses')
}


graalvmNative {
binaries {
main {
imageName = 'tw-agent'
mainClass = 'io.seqera.tower.agent.Agent'
configurationFileDirectories.from(file('conf'))
buildArgs(DefaultNativePlatform.currentOperatingSystem.isLinux() ? ['--static', '--libc=musl'] : [])
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')
}

test {
verbose = true
}
}
}




5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
micronautVersion=4.10.0
native.gradle.plugin.version = 0.10.4
junit.jupiter.version = 5.8.1
junit.platform.version = 1.8.1
micronautVersion=4.10.8
33 changes: 33 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[versions]
graalvmNativeVersion = "0.10.6"
junitVersion = "5.14.3"
licenserVersion = "2.2.2"
micronautApplicationVersion = "4.6.2"
shadowVersion = "9.3.1"

[libraries]
graalvmSvm = { group = "org.graalvm.nativeimage", name = "svm" }
javaxAnnotation = { group = "javax.annotation", name = "javax.annotation-api" }
javaxInject = { group = "javax.inject", name = "javax.inject", version = "1" }
junitBom = { group = "org.junit", name = "junit-bom", version.ref = "junitVersion" }
junitJupiter = { group = "org.junit.jupiter", name = "junit-jupiter" }
logbackClassic = { group = "ch.qos.logback", name = "logback-classic" }
micronautGraal = { group = "io.micronaut", name = "micronaut-graal" }
micronautHttpClient = { group = "io.micronaut", name = "micronaut-http-client" }
micronautHttpValidation = { group = "io.micronaut", name = "micronaut-http-validation" }
micronautInjectJava = { group = "io.micronaut", name = "micronaut-inject-java" }
micronautJacksonDatabind = { group = "io.micronaut", name = "micronaut-jackson-databind" }
micronautPicocli = { group = "io.micronaut.picocli", name = "micronaut-picocli" }
micronautRuntime = { group = "io.micronaut", name = "micronaut-runtime" }
micronautRxjava2 = { group = "io.micronaut.rxjava2", name = "micronaut-rxjava2" }
micronautRxjava2HttpClient = { group = "io.micronaut.rxjava2", name = "micronaut-rxjava2-http-client" }
micronautValidation = { group = "io.micronaut.validation", name = "micronaut-validation" }
picocli = { group = "info.picocli", name = "picocli" }
picocliCodegen = { group = "info.picocli", name = "picocli-codegen" }
snakeyaml = { group = "org.yaml", name = "snakeyaml" }

[plugins]
graalvmNative = { id = "org.graalvm.buildtools.native", version.ref = "graalvmNativeVersion" }
licenser = { id = "dev.yumi.gradle.licenser", version.ref = "licenserVersion" }
micronautApplication = { id = "io.micronaut.application", version.ref = "micronautApplicationVersion" }
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
Expand Up @@ -17,7 +17,7 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 1 addition & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
*/

pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
Expand All @@ -23,7 +20,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-agent"
3 changes: 1 addition & 2 deletions src/main/java/io/seqera/tower/agent/Agent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024, 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.agent;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/seqera/tower/agent/AgentClientSocket.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024, 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.agent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024, 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.agent.exceptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024, 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.agent.exceptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024, 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.agent.exchange;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024, 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.agent.exchange;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024, 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.agent.exchange;
Expand Down
Loading
Loading