x80486
08/04/2017, 8:16 PMShadowJar
plug-in using Kotlin DSL? I'm using Vert.x with Kotlin and so far the mergeServiceFiles
doesn't work; also I get some "unresolved reference" for manifest.attributes
(you know, the red bulb on the right). This is what I got so far...
plugins {
...
id("com.github.johnrengelman.shadow") version "2.0.1"
}
tasks.withType<ShadowJar> {
baseName = project.name
classifier = "shadow" // fat, shadow
manifest.attributes.apply {
put("Application-Name", project.name)
put("Gradle-Version", gradle.gradleVersion)
put("Implementation-Version", "${project.version}")
//put("Main-Class", "io.shido.MainVerticle")
put("Main-Verticle", "io.shido.MainVerticle")
}
mergeServiceFiles({ include("META-INF/services/io.vertx.core.spi.VerticleFactory") })
version = "${project.version}"
}
jlleitschuh
08/04/2017, 10:19 PMShadowJar
task extends Jar
so I think you can configure it like this:
https://github.com/wpilibsuite/shuffleboard/blob/master/build.gradle.kts#L141-L146x80486
08/14/2017, 2:04 PMconfigure<ApplicationPluginConvention> {
mainClassName = "io.vertx.core.Launcher"
}
tasks.withType<ShadowJar> {
baseName = project.name
classifier = "shadow" // fat, shadow
manifest.attributes.apply {
put("Application-Name", project.name)
put("Build-Date", ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_DATE_TIME))
//put("Build-Number", )
put("Created-By", System.getProperty("user.name"))
put("Gradle-Version", gradle.gradleVersion)
put("Implementation-Version", "${project.version}")
put("JDK-Version", System.getProperty("java.version"))
//put("Main-Class", "io.shido.MainVerticle")
put("Main-Verticle", "io.shido.MainVerticle") // This is your "entry" verticle, the one that deploys the others and things like that
}
mergeServiceFiles { include("META-INF/services/io.vertx.core.spi.VerticleFactory") }
version = "${project.version}"
}