Skip to content

Commit

Permalink
Generalize the sortPom stuff to facilitate diffplug#524 (glue code).
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Sep 30, 2021
1 parent 2b85d84 commit b95e93b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ version = rootProject.spotlessChangelog.versionNext
apply from: rootProject.file('gradle/java-setup.gradle')
apply from: rootProject.file('gradle/java-publish.gradle')

sourceSets {
sortPom {
def NEEDS_GLUE = [
'sortPom'
]
for (glue in NEEDS_GLUE) {
sourceSets.register(glue) {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output

java {
}
java {}
}
}

Expand All @@ -33,8 +34,7 @@ spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even min
test { useJUnitPlatform() }

jar {
// Add directories with generated sources (might be several - one for every supported language).
from sourceSets.sortPom.output.classesDirs
// Add output directories of the sourceset's resources.
from sourceSets.sortPom.output.resourcesDir
for (glue in NEEDS_GLUE) {
from sourceSets.getByName(glue).output.classesDirs
}
}

0 comments on commit b95e93b

Please sign in to comment.