Skip to content

Commit

Permalink
Execute example code from Jar instead of using classes/resources folders
Browse files Browse the repository at this point in the history
If in one Java Module, classes and resources need to be physically
combined.

Signed-off-by: Jendrik Johannes <[email protected]>
  • Loading branch information
jjohannes committed Feb 22, 2024
1 parent 3c881f0 commit 9c91763
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ tasks.withType<JavaCompile>().configureEach {

tasks.register<RunAllExample>("runAllExamples") {
sources.from(sourceSets.main.get().java.asFileTree)
rtClasspath.from(sourceSets.main.get().runtimeClasspath)
rtClasspath.from(configurations.runtimeClasspath.get() + files(tasks.jar))
}

tasks.addRule("Pattern: run<Example>: Runs an example.") {
if (startsWith("run")) {
tasks.register<JavaExec>(this) {
classpath = sourceSets.main.get().runtimeClasspath
classpath = configurations.runtimeClasspath.get() + files(tasks.jar)
mainModule = "com.hedera.hashgraph.examples"
mainClass = "com.hedera.hashgraph.sdk.examples.${this@addRule.substring("run".length)}Example"

Expand Down

0 comments on commit 9c91763

Please sign in to comment.