Skip to content

Commit

Permalink
Sort all the "glue" adaptors in the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Apr 6, 2023
1 parent ddc82c1 commit 7f245a8
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 57 deletions.
16 changes: 9 additions & 7 deletions lib-extra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ tasks.withType(Test).configureEach {
}

def NEEDS_P2_DEPS = [
'jdt',
// (alphabetic order please)
'cdt',
'groovy',
'cdt'
'jdt'
]
for (needsP2 in NEEDS_P2_DEPS) {
sourceSets.register(needsP2) {
Expand All @@ -68,9 +69,11 @@ tasks.withType(Test).configureEach {

apply plugin: 'dev.equo.p2deps'
p2deps {
into 'jdtCompileOnly', {
// (alphabetic order please)
into 'cdtCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
install 'org.eclipse.jdt.core'
p2repo 'https://download.eclipse.org/tools/cdt/releases/10.7/'
install 'org.eclipse.cdt.core'
}
into 'groovyCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
Expand All @@ -80,10 +83,9 @@ p2deps {
install 'org.eclipse.jdt.groovy.core'
install 'org.codehaus.groovy'
}
into 'cdtCompileOnly', {
into 'jdtCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
p2repo 'https://download.eclipse.org/tools/cdt/releases/10.7/'
install 'org.eclipse.cdt.core'
install 'org.eclipse.jdt.core'
}
}

Expand Down
97 changes: 47 additions & 50 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ apply from: rootProject.file('gradle/java-setup.gradle')
apply from: rootProject.file('gradle/java-publish.gradle')

def NEEDS_GLUE = [
'sortPom',
'palantirJavaFormat',
// (alphabetic order please)
'cleanthat',
'diktat',
'flexmark',
'gherkin',
'googleJavaFormat',
'gson',
'jackson',
'ktfmt',
'ktlint',
'flexmark',
'diktat',
'palantirJavaFormat',
'scalafmt',
'jackson',
'gson',
'cleanthat',
'gherkin'
'sortPom'
]
for (glue in NEEDS_GLUE) {
sourceSets.register(glue) {
Expand All @@ -31,6 +32,13 @@ for (glue in NEEDS_GLUE) {

versionCompatibility {
adapters {
// (alphabetic order please)
namespaces.register('Cleanthat') {
versions = [
'2.1',
]
targetSourceSetName = 'cleanthat'
}
namespaces.register('KtLint') {
// as discussed at https://github.com/diffplug/spotless/pull/1475
// we will support no more than 2 breaking changes at a time = 3 incompatible versions
Expand All @@ -42,12 +50,6 @@ versionCompatibility {
]
targetSourceSetName = 'ktlint'
}
namespaces.register('Cleanthat') {
versions = [
'2.1',
]
targetSourceSetName = 'cleanthat'
}
}
}

Expand All @@ -66,33 +68,39 @@ dependencies {
testCommonImplementation "org.assertj:assertj-core:$VER_ASSERTJ"
testCommonImplementation "com.diffplug.durian:durian-testlib:$VER_DURIAN"

// used for pom sorting
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:3.0.0'
sortPomCompileOnly 'org.slf4j:slf4j-api:2.0.0'

palantirJavaFormatCompileOnly 'com.palantir.javaformat:palantir-java-format:1.1.0' // this version needs to stay compilable against Java 8 for CI Job testNpm

googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.16.0' // minimum required version due to api changes before then

// used jackson-based formatters
jacksonCompileOnly 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
jacksonCompileOnly 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.2'

String VER_KTFMT = '0.43'
ktfmtCompileOnly "com.facebook:ktfmt:$VER_KTFMT"
String VER_KTLINT_GOOGLE_JAVA_FORMAT = '1.7' // for JDK 8 compatibility
// GLUE CODE (alphabetic order please)
// cleanthat
String VER_CLEANTHAT='2.13'
cleanthatCompileOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"
compatCleanthat2Dot1CompileAndTestOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"
// diktat
diktatCompileOnly 'org.cqfn.diktat:diktat-rules:1.2.5'
// flexmark
flexmarkCompileOnly 'com.vladsch.flexmark:flexmark-all:0.64.0'
// gherkin
gherkinCompileOnly 'io.cucumber:gherkin-utils:8.0.2'
gherkinCompileOnly 'org.slf4j:slf4j-api:2.0.0'
// googleJavaFormat
googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.16.0'
// gson
gsonCompileOnly 'com.google.code.gson:gson:2.10.1'
// jackson
String VER_JACKSON='2.14.2'
jacksonCompileOnly "com.fasterxml.jackson.core:jackson-databind:$VER_JACKSON"
jacksonCompileOnly "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$VER_JACKSON"
// ktfmt
ktfmtCompileOnly "com.facebook:ktfmt:0.43"
ktfmtCompileOnly("com.google.googlejavaformat:google-java-format") {
version {
strictly VER_KTLINT_GOOGLE_JAVA_FORMAT
strictly '1.7' // for JDK 8 compatibility
}
}

// ktlint
String VER_KTLINT='0.46.1'
ktlintCompileOnly "com.pinterest:ktlint:$VER_KTLINT"
ktlintCompileOnly "com.pinterest.ktlint:ktlint-core:$VER_KTLINT"
ktlintCompileOnly "com.pinterest.ktlint:ktlint-ruleset-experimental:$VER_KTLINT"
ktlintCompileOnly "com.pinterest.ktlint:ktlint-ruleset-standard:$VER_KTLINT"

compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.46.0'
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.46.0'
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.46.0'
Expand All @@ -102,24 +110,13 @@ dependencies {
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-core:0.48.0'
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.48.0'
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.48.0'

String VER_SCALAFMT="3.7.3"
scalafmtCompileOnly "org.scalameta:scalafmt-core_2.13:$VER_SCALAFMT"

String VER_DIKTAT = "1.2.5"
diktatCompileOnly "org.cqfn.diktat:diktat-rules:$VER_DIKTAT"

// used for markdown formatting
flexmarkCompileOnly 'com.vladsch.flexmark:flexmark-all:0.64.0'

gsonCompileOnly 'com.google.code.gson:gson:2.10.1'

String VER_CLEANTHAT="2.13"
cleanthatCompileOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"
compatCleanthat2Dot1CompileAndTestOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"

gherkinCompileOnly 'io.cucumber:gherkin-utils:8.0.2'
gherkinCompileOnly 'org.slf4j:slf4j-api:2.0.0'
// palantirJavaFormat
palantirJavaFormatCompileOnly 'com.palantir.javaformat:palantir-java-format:1.1.0' // this version needs to stay compilable against Java 8 for CI Job testNpm
// scalafmt
scalafmtCompileOnly "org.scalameta:scalafmt-core_2.13:3.7.3"
// sortPom
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:3.0.0'
sortPomCompileOnly 'org.slf4j:slf4j-api:2.0.0'
}

// we'll hold the core lib to a high standard
Expand Down

0 comments on commit 7f245a8

Please sign in to comment.