51 lines
1.1 KiB
Groovy
51 lines
1.1 KiB
Groovy
plugins {
|
|
id 'java-gradle-plugin'
|
|
}
|
|
|
|
version = "0.1"
|
|
|
|
configurations {
|
|
embedded
|
|
compileOnly.extendsFrom(embedded)
|
|
}
|
|
|
|
dependencies {
|
|
embedded project(path: "executable-jar-common", configuration: "archives")
|
|
}
|
|
|
|
Provider<Copy> copyLauncher = tasks.register("copyLauncher", Copy) {
|
|
from(project("executable-jar-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
|
|
}
|
|
|
|
jar {
|
|
manifest {
|
|
attributes "version" : archiveVersion.get()
|
|
}
|
|
from {
|
|
configurations.named('embedded').map {
|
|
it.collect {
|
|
it.isDirectory() ? it : zipTree(it)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
gradlePlugin {
|
|
plugins {
|
|
create("ExecutableJarPlugin") {
|
|
id = "net.woggioni.gradle.executable-jar"
|
|
implementationClass = "net.woggioni.gradle.executable.jar.ExecutableJarPlugin"
|
|
}
|
|
}
|
|
}
|