diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 6fa64a8..0000000 --- a/build.gradle +++ /dev/null @@ -1,6352 +0,0 @@ -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - -repositories { - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -repositories { - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -repositories { - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -repositories { - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -repositories { - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -repositories { - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - mavenCentral() -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" -} - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} -buildscript { - ext.kotlin_version = "1.7.0" - ext.CI_PROJECT_ID = System.env.CI_PROJECT_ID - - repositories { mavenCentral() } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - -apply plugin: "org.jetbrains.kotlin.jvm" -apply plugin: "java-library" -apply plugin: "java-test-fixtures" -apply plugin: "maven-publish" -apply plugin: "kotlinx-serialization" - - -group = "org.domaindrivenarchitecture.provs" -version = "0.17.1-SNAPSHOT" - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - - -test { - // set properties for the tests - def propertiesForTests = ["testdockerwithoutsudo"] - for (def prop : propertiesForTests) { - def value = System.getProperty(prop) - if (value != null) { - systemProperty prop, value - } - } - - useJUnitPlatform { - def excludedTags = System.getProperty("excludeTags") - if (System.getProperty("excludeTags") != null) { - excludeTags(excludedTags.split(",")) - } - if (System.getenv("CI_JOB_TOKEN") != null) { - excludeTags("containernonci") - } - } -} - -compileJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestFixturesJava.options.debugOptions.debugLevel = "source,lines,vars" -compileTestJava.options.debugOptions.debugLevel = "source,lines,vars" - -// https://stackoverflow.com/questions/21904269/configure-gradle-to-publish-sources-and-javadoc -java { - withSourcesJar() - withJavadocJar() -} - - -dependencies { - - api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2") - api("org.jetbrains.kotlinx:kotlinx-cli:0.3.4") - - api('com.charleskorn.kaml:kaml:0.43.0') - - api("org.slf4j:slf4j-api:1.7.36") - api('ch.qos.logback:logback-classic:1.2.11') - api('ch.qos.logback:logback-core:1.2.11') - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - implementation("com.hierynomus:sshj:0.32.0") - - implementation("aws.sdk.kotlin:s3:0.17.1-beta") - - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi('io.mockk:mockk:1.12.3') - - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") -} - - -task uberjarDesktop(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.desktop.application.ApplicationKt" - } - archiveFileName = "provs-desktop.jar" -} - - -task uberjarServer(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.server.application.ApplicationKt" - } - archiveFileName = "provs-server.jar" -} - - -task uberjarSyspec(type: Jar) { - - from sourceSets.main.output - - dependsOn configurations.runtimeClasspath - from { - configurations.runtimeClasspath.findAll { it.name.endsWith("jar") }.collect { zipTree(it) } - } { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" - } - - manifest { - attributes "Implementation-Title": "Uberjar of provs", - "Implementation-Version": project.version, - "Main-Class": "org.domaindrivenarchitecture.provs.syspec.application.ApplicationKt" - } - archiveFileName = "provs-syspec.jar" -} -def projectRoot = rootProject.projectDir - - -// copy jar to /usr/local/bin and make it executable -// Remark: to be able to use it you must have jarwrapper installed (sudo apt install jarwrapper) -task installlocally { - dependsOn(uberjarServer, uberjarDesktop, uberjarSyspec) - doLast { - exec { commandLine("sh", "-c", "sudo apt-get update & sudo apt-get install jarwrapper") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-server.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-desktop.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo cp $projectRoot/build/libs/provs-syspec.jar /usr/local/bin/") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-server.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-desktop.jar") } - exec { commandLine("sh", "-c", "sudo chmod 755 /usr/local/bin/provs-syspec.jar") } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - from sourceSets.main.allSource - archiveClassifier.set("sources") -} - - -publishing { - publications { - library(MavenPublication) { - from components.java - } - } - repositories { - if (System.getenv("CI_JOB_TOKEN") != null) { - // see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html - maven { - url "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - mavenLocal() - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index bbf2883..0000000 --- a/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "dummy", - "description": "Generate c4k yaml for a jitsi deployment.", - "author": "meissa GmbH", - "version": "3.0.0", - "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-jitsi#readme", - "repository": "https://www.npmjs.com/package/c4k-jitsi", - "license": "APACHE2", - "main": "c4k-jitsi.js", - "bin": { - "c4k-jitsi": "./c4k-jitsi.js" - }, - "keywords": [ - "cljs", - "jitsi", - "k8s", - "c4k", - "deployment", - "yaml", - "convention4kubernetes" - ], - "bugs": { - "url": "https://gitlab.com/domaindrivenarchitecture/c4k-jitsi/issues" - }, - "dependencies": { - "js-base64": "^3.6.1", - "js-yaml": "^4.0.0" - }, - "devDependencies": { - "shadow-cljs": "^2.11.18", - "source-map-support": "^0.5.19" - } -} \ No newline at end of file diff --git a/project.clj b/project.clj deleted file mode 100644 index 6e14c1f..0000000 --- a/project.clj +++ /dev/null @@ -1,46 +0,0 @@ -(defproject org.domaindrivenarchitecture/c4k-website "1.1.3-SNAPSHOT" - :description "website c4k-installation package" - :url "https://domaindrivenarchitecture.org" - :license {:name "Apache License, Version 2.0" - :url "https://www.apache.org/licenses/LICENSE-2.0.html"} - :dependencies [[org.clojure/clojure "1.11.1"] - [org.clojure/tools.reader "1.3.6"] - [org.domaindrivenarchitecture/c4k-common-clj "5.0.1"] - [hickory "0.7.1"]] - :target-path "target/%s/" - :source-paths ["src/main/cljc" - "src/main/clj"] - :resource-paths ["src/main/resources"] - :repositories [["snapshots" :clojars] - ["releases" :clojars]] - :deploy-repositories [["snapshots" {:sign-releases false :url "https://clojars.org/repo"}] - ["releases" {:sign-releases false :url "https://clojars.org/repo"}]] - :profiles {:test {:test-paths ["src/test/cljc"] - :resource-paths ["src/test/resources"] - :dependencies [[dda/data-test "0.1.1"]]} - :dev {:plugins [[lein-shell "0.5.0"]]} - :uberjar {:aot :all - :main dda.c4k-website.uberjar - :uberjar-name "c4k-website-standalone.jar" - :dependencies [[org.clojure/tools.cli "1.0.214"] - [ch.qos.logback/logback-classic "1.4.5" - :exclusions [com.sun.mail/javax.mail]] - [org.slf4j/jcl-over-slf4j "2.0.6"]]}} - :release-tasks [["test"] - ["vcs" "assert-committed"] - ["change" "version" "leiningen.release/bump-version" "release"] - ["vcs" "commit"] - ["vcs" "tag" "v" "--no-sign"] - ["change" "version" "leiningen.release/bump-version"]] - :aliases {"native" ["shell" - "native-image" - "--report-unsupported-elements-at-runtime" - "--initialize-at-build-time" - "-jar" "target/uberjar/c4k-website-standalone.jar" - "-H:ResourceConfigurationFiles=graalvm-resource-config.json" - "-H:Log=registerResource" - "-H:Name=target/graalvm/${:name}"] - "inst" ["shell" - "sh" - "-c" - "lein uberjar && sudo install -m=755 target/uberjar/c4k-website-standalone.jar /usr/local/bin/c4k-website-standalone.jar"]})