Skip to content

Commit

Permalink
(#23) Peg JVM target version
Browse files Browse the repository at this point in the history
  • Loading branch information
jayasuryat committed Aug 20, 2023
1 parent 422a6b0 commit 61f4035
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

apply {
from("buildScripts/spotless_pre_commit_hook.gradle")
// from("buildScripts/spotless_pre_commit_hook.gradle")
from("buildScripts/publish/publish-root.gradle")
}

Expand All @@ -23,8 +23,16 @@ allprojects.forEach { project ->
}
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
subprojects {

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

tasks.withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
}

tasks.register("publishAllPublicationsToSonatypeRepository")
Expand All @@ -38,3 +46,21 @@ if (publishAll != null) {
}
}
}

project("mendable-app").afterEvaluate {

fun findJarTaskInSubproject(projectName: String): Task? {
return project.rootProject.subprojects
.find { project -> project.name == projectName }
?.tasks?.named("jar")
?.get()
}

val metricsFile = findJarTaskInSubproject("metrics-file") ?: return@afterEvaluate
val scanner = findJarTaskInSubproject("scanner") ?: return@afterEvaluate
val parser = findJarTaskInSubproject("parser") ?: return@afterEvaluate
val mendable = findJarTaskInSubproject("mendable") ?: return@afterEvaluate
val mendableApp = findJarTaskInSubproject("mendable-app") ?: return@afterEvaluate

mendableApp.dependsOn(metricsFile, scanner, parser, mendable)
}

0 comments on commit 61f4035

Please sign in to comment.