Skip to content

Commit

Permalink
build: Moved all common build configs to parent
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Feb 12, 2025
1 parent 69874e0 commit 2992e8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
19 changes: 18 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ subprojects { p ->
coverage {
jacoco {
enabled = hasTestsAt(p.file('src/test'))
toolVersion = jacocoPluginVersion
}
}
}
Expand All @@ -158,6 +157,24 @@ subprojects { p ->
}
}

gradleProjects {
subprojects {
dirs(['core']) {
compileJava {
options.compilerArgs += ["-AprojectPath=${project.group}/${project.name}"]
}

if (!(project.findProperty('automatic.module.name.skip') ?: false).toBoolean()) {
jar {
manifest {
attributes('Automatic-Module-Name': project.findProperty('automatic.module.name'))
}
}
}
}
}
}

boolean hasTestsAt(File testDir) {
testDir.exists() && testDir.listFiles()?.size()
}
12 changes: 0 additions & 12 deletions core/riot-core/riot-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@ dependencies {
testImplementation 'org.awaitility:awaitility'
}

compileJava {
options.compilerArgs += ["-AprojectPath=${project.group}/${project.name}"]
}

if (!(project.findProperty('automatic.module.name.skip') ?: false).toBoolean()) {
jar {
manifest {
attributes('Automatic-Module-Name': project.findProperty('automatic.module.name'))
}
}
}

project.rootProject.gradle.addBuildListener(new BuildAdapter() {
@Override
void projectsEvaluated(Gradle gradle) {
Expand Down

0 comments on commit 2992e8d

Please sign in to comment.