Skip to content

Commit

Permalink
Fix bug with task :run arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
nseah21 committed Jul 4, 2023
1 parent 6e99a7c commit cdfd739
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,13 @@ tasks.named<ProcessResources>("processSystemtestResources").configure {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

tasks.compileJava {
tasks.named("compileJava").configure {
mustRunAfter(zipReport)
}

tasks.named("run") {
dependsOn(zipReport)

/* The second arguments indicate the default value associated with the property. */
doFirst {
val args = System.getProperty("args", "").split("")
System.setProperty("version", getRepoSenseVersion())
}
tasks.named<JavaExec>("run").configure {
args(System.getProperty("args", "").split(" "))
jvmArgs("-Dversion=${getRepoSenseVersion()}")
}

checkstyle {
Expand Down Expand Up @@ -169,19 +164,19 @@ tasks.test {
}
}

tasks.shadowJar {
tasks.named("shadowJar").configure {
dependsOn(zipReport)
}

tasks.compileJava {
tasks.named("compileJava").configure {
mustRunAfter("zipReport")
}

tasks.processResources {
tasks.named("processResources").configure {
mustRunAfter("zipReport")
}

tasks.named<ShadowJar>("shadowJar") {
tasks.named<ShadowJar>("shadowJar").configure {
archiveFileName.set("RepoSense.jar")
destinationDirectory.set(file("${buildDir}/jar/"))

Expand All @@ -200,11 +195,11 @@ val checkstyleMain = tasks.named("checkstyleMain")
val checkstyleTest = tasks.named("checkstyleTest")
val checkstyleSystemtest = tasks.named("checkstyleSystemtest")

tasks.named("checkstyleTest") {
tasks.named("checkstyleTest").configure {
mustRunAfter(checkstyleMain)
}

tasks.named("checkstyleSystemtest") {
tasks.named("checkstyleSystemtest").configure {
mustRunAfter(checkstyleTest)
}

Expand Down Expand Up @@ -242,11 +237,11 @@ val systemtest = tasks.register<Test>("systemtest") {
}
}

tasks.compileJava {
tasks.named("compileJava").configure {
mustRunAfter(zipReport)
}

tasks.processResources {
tasks.named("processResources").configure {
mustRunAfter(zipReport)
}

Expand Down Expand Up @@ -280,7 +275,7 @@ val installCypress = tasks.register<Exec>("installCypress") {
setArgs(listOf("/c", "npm", "ci", "--production", "false", "--loglevel", "info", "--progress", "true"))
}

tasks.named("serveTestReportInBackground") {
tasks.named("serveTestReportInBackground").configure {
mustRunAfter(installCypress)
}

Expand Down

0 comments on commit cdfd739

Please sign in to comment.