added Jenkinsfile
This commit is contained in:
22
Jenkinsfile
vendored
Normal file
22
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Files
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage("Build") {
|
||||
steps {
|
||||
sh "./gradlew clean build"
|
||||
archiveArtifacts artifacts: 'build/libs/*.jar',
|
||||
allowEmptyArchive: true,
|
||||
fingerprint: true,
|
||||
onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
stage("Publish") {
|
||||
steps {
|
||||
sh "./gradlew publish"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
build.gradle
25
build.gradle
@@ -35,23 +35,23 @@ allprojects {
|
||||
version = getProperty("version.envelope")
|
||||
|
||||
configurations {
|
||||
embedded
|
||||
embedded {
|
||||
visible = false
|
||||
canBeConsumed = false
|
||||
}
|
||||
compileOnly.extendsFrom(embedded)
|
||||
tar {
|
||||
visible = false
|
||||
canBeConsumed = false
|
||||
transitive = false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
tar project(path: "launcher", configuration: 'tar')
|
||||
embedded project(path: "common", configuration: "archives")
|
||||
}
|
||||
|
||||
Provider<Copy> copyLauncher = tasks.register("copyLauncher", Copy) {
|
||||
from(project("launcher").tasks.named("tar").map {it.outputs })
|
||||
into(new File(project.buildDir, "resources/main/META-INF"))
|
||||
}
|
||||
|
||||
tasks.named("processResources") {
|
||||
inputs.files(copyLauncher)
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
@@ -68,6 +68,9 @@ jar {
|
||||
}
|
||||
}
|
||||
}
|
||||
into('LIB-INF') {
|
||||
from(configurations.named('tar'))
|
||||
}
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
@@ -82,7 +85,7 @@ gradlePlugin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = woggioniMavenRepositoryUrl
|
||||
url = publishMavenRepositoryUrl
|
||||
}
|
||||
}
|
||||
publications {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
woggioniMavenRepositoryUrl=https://mvn.woggioni.net/
|
||||
woggioniMavenRepositoryUrl=https://woggioni.net/mvn/
|
||||
publishMavenRepositoryUrl=https://mvn.woggioni.net/
|
||||
|
||||
version.envelope=0.1
|
||||
version.lombok=1.18.16
|
||||
|
@@ -7,8 +7,16 @@ plugins {
|
||||
ext.setProperty("jpms.module.name", "net.woggioni.envelope")
|
||||
|
||||
configurations {
|
||||
embedded
|
||||
embedded {
|
||||
visible = false
|
||||
canBeConsumed = false
|
||||
}
|
||||
compileOnly.extendsFrom(embedded)
|
||||
tar {
|
||||
visible = true
|
||||
canBeConsumed = true
|
||||
transitive = false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -38,7 +46,7 @@ jar {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("tar", Tar) {
|
||||
Provider<Tar> tarTaskProvider = tasks.register("tar", Tar) {
|
||||
archiveFileName = "${project.name}.tar"
|
||||
from(project.tasks.named(JavaPlugin.JAR_TASK_NAME)
|
||||
.flatMap(Jar.&getArchiveFile)
|
||||
@@ -60,3 +68,7 @@ tasks.named(JavaPlugin.COMPILE_JAVA_TASK_NAME, JavaCompile) {
|
||||
options.compilerArgs.addAll(["--patch-module", "net.woggioni.envelope=$path"])
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
tar tarTaskProvider
|
||||
}
|
@@ -14,7 +14,7 @@ final class LauncherResource implements ReadableResource {
|
||||
private final URL url;
|
||||
|
||||
private LauncherResource() {
|
||||
url = getClass().getResource(String.format("/META-INF/%s", getDisplayName()));
|
||||
url = getClass().getResource(String.format("/LIB-INF/%s", getDisplayName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user