Skip to content

Commit 87cb4ae

Browse files
authored
Enable type-safe project accessors (#1824)
2 parents d680622 + 196afc0 commit 87cb4ae

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

_ext/gradle/java-setup.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tasks.withType(JavaCompile).configureEach {
1919
dependencies {
2020
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
2121
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
22-
testImplementation project(':testlib')
22+
testImplementation projects.testlib
2323
}
2424

2525
tasks.withType(Test).configureEach {

lib-extra/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ apply from: rootProject.file('gradle/java-publish.gradle')
99

1010
String VER_SOLSTICE = '1.3.1'
1111
dependencies {
12-
api project(':lib')
12+
api projects.lib
1313
// misc useful utilities
1414
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
1515
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
@@ -20,7 +20,7 @@ dependencies {
2020
implementation "dev.equo.ide:solstice:${VER_SOLSTICE}"
2121

2222
// testing
23-
testImplementation project(':testlib')
23+
testImplementation projects.testlib
2424
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
2525
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
2626
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"

plugin-gradle/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ apply from: rootProject.file('gradle/spotless-freshmark.gradle')
1010

1111
dependencies {
1212
if (version.endsWith('-SNAPSHOT') || (rootProject.spotlessChangelog.versionNext == rootProject.spotlessChangelog.versionLast)) {
13-
api project(':lib')
14-
api project(':lib-extra')
13+
api projects.lib
14+
api projects.libExtra
1515
} else {
1616
api "com.diffplug.spotless:spotless-lib:${rootProject.spotlessChangelog.versionLast}"
1717
api "com.diffplug.spotless:spotless-lib-extra:${rootProject.spotlessChangelog.versionLast}"
@@ -21,7 +21,7 @@ dependencies {
2121
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
2222
implementation "org.eclipse.jgit:org.eclipse.jgit:${VER_JGIT}"
2323

24-
testImplementation project(':testlib')
24+
testImplementation projects.testlib
2525
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
2626
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
2727
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"

plugin-maven/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ String VER_MAVEN_API = '3.0'
3030
String VER_ECLIPSE_AETHER = '1.1.0'
3131
String VER_PLEXUS_RESOURCES = '1.2.0'
3232
dependencies {
33-
implementation project(':lib')
34-
implementation project(':lib-extra')
33+
implementation projects.lib
34+
implementation projects.libExtra
3535

3636
compileOnly "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
3737
compileOnly "org.apache.maven.plugin-tools:maven-plugin-annotations:${VER_MAVEN_API}"

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ gradleEnterprise {
7171
}
7272

7373
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
74+
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
7475

7576
rootProject.name = 'spotless'
7677

testlib/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ version = rootProject.spotlessChangelog.versionNext
66
apply from: rootProject.file('gradle/java-setup.gradle')
77

88
dependencies {
9-
api project(':lib')
10-
api files(project(':lib').sourceSets.sortPom.output.classesDirs)
9+
api projects.lib
10+
api files(projects.lib.dependencyProject.sourceSets.sortPom.output.classesDirs)
1111
api "com.diffplug.durian:durian-core:${VER_DURIAN}"
1212
api "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
1313
api "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"

0 commit comments

Comments
 (0)