-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tasks for creating executable jar's for the examples. The gradle task `buildExamples` will output fat jar's for each of the examples, which can be later run with ``` java -jar <Example>.jar ```
- Loading branch information
Showing
3 changed files
with
113 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,12 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
|
||
plugins { | ||
kotlin("jvm") | ||
kotlin("plugin.serialization") | ||
id("com.gradleup.shadow") | ||
} | ||
|
||
kotlin { | ||
|
@@ -50,6 +53,29 @@ tasks { | |
"ZSubThr" | ||
) | ||
|
||
examples.forEach { example -> | ||
register<ShadowJar>("${example}Jar") { | ||
group = "build" | ||
description = "Build a fat JAR for the $example example" | ||
from(sourceSets["main"].output) | ||
manifest { | ||
attributes["Main-Class"] = "io.zenoh.${example}Kt" | ||
} | ||
configurations.empty() | ||
configurations.add(project.configurations.getByName("runtimeClasspath")) | ||
|
||
archiveBaseName.set(example) | ||
archiveVersion.set("") | ||
archiveClassifier.set("") | ||
} | ||
} | ||
|
||
register("buildExamples") { | ||
group = "build" | ||
description = "Build all fat JARs for the Zenoh Kotlin examples" | ||
dependsOn(examples.map { "${it}Jar" }) | ||
} | ||
|
||
examples.forEach { example -> | ||
register(example, JavaExec::class) { | ||
dependsOn("CompileZenohJNI") | ||
|