Skip to content

Commit 00e0ee2

Browse files
authored
Merge pull request #4041 from square/jw.remove-plugins.2024-01-24
Remove use of plugins block
2 parents 7c96096 + 286b439 commit 00e0ee2

File tree

6 files changed

+35
-37
lines changed

6 files changed

+35
-37
lines changed

build.gradle

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ buildscript {
55
dependencies {
66
classpath libs.androidPlugin
77
classpath libs.robovmPlugin
8+
classpath libs.kotlin.gradlePlugin
9+
classpath libs.kotlin.serializationPlugin
10+
classpath libs.dokkaPlugin
11+
classpath libs.gradleMavenPublishPlugin
12+
classpath libs.spotlessPlugin
13+
classpath libs.errorpronePlugin
14+
classpath libs.animalSnifferPlugin
15+
classpath libs.protobufPlugin
816
}
917
repositories {
1018
mavenCentral()
@@ -13,17 +21,6 @@ buildscript {
1321
}
1422
}
1523

16-
plugins {
17-
alias(libs.plugins.kotlin.jvm) apply false
18-
alias(libs.plugins.kotlin.serialization) apply false
19-
alias(libs.plugins.dokka) apply false
20-
alias(libs.plugins.errorprone) apply false
21-
alias(libs.plugins.mavenPublish) apply false
22-
alias(libs.plugins.protobuf) apply false
23-
alias(libs.plugins.animalsniffer) apply false
24-
alias(libs.plugins.spotless) apply false
25-
}
26-
2724
subprojects {
2825
repositories {
2926
mavenCentral()
@@ -87,7 +84,7 @@ subprojects {
8784
}
8885
}
8986

90-
plugins.apply(libs.plugins.spotless.get().pluginId)
87+
plugins.apply('com.diffplug.spotless')
9188
spotless {
9289
java {
9390
googleJavaFormat(libs.googleJavaFormat.get().version)

gradle/libs.versions.toml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,28 @@ protobuf = "3.25.1"
1919
robovm = "2.3.14"
2020
kotlinx-serialization = "1.6.2"
2121

22-
[plugins]
23-
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
24-
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
25-
dokka = { id = "org.jetbrains.dokka", version = "1.9.10" }
26-
errorprone = { id = "net.ltgt.errorprone", version = "3.1.0" }
27-
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.18.0" }
28-
protobuf = { id = "com.google.protobuf", version = "0.9.4" }
29-
animalsniffer = { id = "ru.vyarus.animalsniffer", version = "1.7.1" }
30-
spotless = "com.diffplug.spotless:6.23.3"
31-
3222
[libraries]
3323
androidPlugin = { module = "com.android.tools.build:gradle", version = "4.2.2" }
3424
robovmPlugin = { module = "com.mobidevelop.robovm:robovm-gradle-plugin", version.ref = "robovm" }
35-
kotlinStdLib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
25+
dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.9.10"
26+
gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
27+
spotlessPlugin = "com.diffplug.spotless:spotless-plugin-gradle:6.23.3"
28+
29+
kotlin-stdLib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
30+
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
31+
kotlin-serializationPlugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
32+
33+
errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:3.1.0"
34+
errorproneCore = { module = "com.google.errorprone:error_prone_core", version = "2.10.0" }
35+
errorproneJavac = { module = "com.google.errorprone:javac", version = "9+181-r4173-1" }
36+
37+
animalSnifferPlugin = "ru.vyarus:gradle-animalsniffer-plugin:1.7.1"
38+
animalSnifferAnnotations = { module = "org.codehaus.mojo:animal-sniffer-annotations", version = "1.23" }
39+
40+
protobufPlugin = "com.google.protobuf:protobuf-gradle-plugin:0.9.4"
41+
protobuf = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" }
42+
protoc = { module = "com.google.protobuf:protoc", version.ref = "protobuf" }
43+
3644
kotlinCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.7.3" }
3745
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
3846
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
@@ -43,7 +51,6 @@ junit = { module = "junit:junit", version = "4.13.2" }
4351
assertj = { module = "org.assertj:assertj-core", version = "3.13.2" }
4452
guava = { module = "com.google.guava:guava", version = "32.1.3-jre" }
4553
android = { module = "com.google.android:android", version = "4.1.1.4" }
46-
animalSnifferAnnotations = { module = "org.codehaus.mojo:animal-sniffer-annotations", version = "1.23" }
4754
findBugsAnnotations = { module = "com.google.code.findbugs:jsr305", version = "3.0.2" }
4855
androidxTestRunner = { module = "androidx.test:runner", version = "1.4.0" }
4956
rxjava = { module = "io.reactivex:rxjava", version = "1.3.8" }
@@ -58,13 +65,9 @@ jaxbImpl = { module = "org.glassfish.jaxb:jaxb-runtime", version = "4.0.4" }
5865
jaxb3Api = { module = "jakarta.xml.bind:jakarta.xml.bind-api", version = "3.0.1" }
5966
jaxb3Impl = { module = "com.sun.xml.bind:jaxb-impl", version = "3.0.2" }
6067
moshi = { module = "com.squareup.moshi:moshi", version = "1.15.0" }
61-
protobuf = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" }
62-
protoc = { module = "com.google.protobuf:protoc", version.ref = "protobuf" }
6368
simpleXml = { module = "org.simpleframework:simple-xml", version = "2.7.1" }
6469
wireRuntime = { module = "com.squareup.wire:wire-runtime", version = "2.2.0" }
6570
jsoup = { module = "org.jsoup:jsoup", version = "1.17.1" }
6671
robovm = { module = "com.mobidevelop.robovm:robovm-rt", version.ref = "robovm" }
67-
errorproneCore = { module = "com.google.errorprone:error_prone_core", version = "2.10.0" }
68-
errorproneJavac = { module = "com.google.errorprone:javac", version = "9+181-r4173-1" }
6972
googleJavaFormat = "com.google.googlejavaformat:google-java-format:1.19.1"
7073
ktlint = "com.pinterest.ktlint:ktlint-cli:1.1.0"

retrofit-bom/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
plugins {
2-
id 'java-platform'
3-
alias libs.plugins.mavenPublish
4-
}
1+
apply plugin: 'java-platform'
2+
apply plugin: 'com.vanniktech.maven.publish'
53

64
// TODO: This could be simplified after updating maven publish plugin, see https://vanniktech.github.io/gradle-maven-publish-plugin/what/#java-platform.
75
publishing {
@@ -15,7 +13,7 @@ publishing {
1513
dependencies {
1614
constraints {
1715
rootProject.subprojects { subproject ->
18-
subproject.plugins.withId(libs.plugins.mavenPublish.get().pluginId) {
16+
subproject.plugins.withId('com.vanniktech.maven.publish') {
1917
// Exclude self project from BOM.
2018
if (subproject != this.project) {
2119
api subproject

retrofit-mock/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ apply plugin: 'com.vanniktech.maven.publish'
44

55
dependencies {
66
api projects.retrofit
7-
compileOnly libs.kotlinStdLib
7+
compileOnly libs.kotlin.stdLib
88
compileOnly libs.findBugsAnnotations
99

1010
testImplementation libs.junit
1111
testImplementation libs.assertj
12-
testImplementation libs.kotlinStdLib
12+
testImplementation libs.kotlin.stdLib
1313
testImplementation libs.kotlinCoroutines
1414
}
1515

retrofit/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies {
66
api libs.okhttp
77

88
compileOnly libs.android
9-
compileOnly libs.kotlinStdLib
9+
compileOnly libs.kotlin.stdLib
1010
compileOnly libs.kotlinCoroutines
1111

1212
compileOnly libs.animalSnifferAnnotations

retrofit/kotlin-test/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ dependencies {
66
testImplementation libs.junit
77
testImplementation libs.assertj
88
testImplementation libs.mockwebserver
9-
testImplementation libs.kotlinStdLib
9+
testImplementation libs.kotlin.stdLib
1010
testImplementation libs.kotlinCoroutines
1111
}

0 commit comments

Comments
 (0)