Skip to content

Commit c9e7708

Browse files
authored
Merge pull request #88 from panic08/make-version-catalog
Make Version Catalog instead of storing the version in the main build.gradle
2 parents c7dad83 + f03f9b1 commit c9e7708

File tree

7 files changed

+60
-34
lines changed

7 files changed

+60
-34
lines changed

.idea/gradle.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
1-
buildscript {
2-
repositories {
3-
mavenCentral()
4-
}
5-
dependencies {
6-
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.0'
7-
}
1+
plugins {
2+
alias(libs.plugins.spotless)
83
}
94

10-
ext {
11-
jsoupVersion = '1.18.3'
12-
okhttpVersion = '4.12.0'
13-
gsonVersion = '2.12.1'
14-
lombokVersion = '1.18.36'
15-
junitVersion = '5.9.1'
16-
}
175

186
allprojects {
197
group = 'ru.funpay4j'
208
version = '1.0.6'
9+
10+
repositories {
11+
mavenCentral()
12+
}
2113
}
2214

2315
def javaVersion = JavaVersion.current()
2416

2517
subprojects { subproject ->
26-
if (subproject.name != 'examples' && javaVersion.compareTo(JavaVersion.VERSION_1_8) == 0) {
18+
if (subproject.name != 'examples' && javaVersion == JavaVersion.VERSION_1_8) {
2719
apply plugin: 'com.diffplug.spotless'
2820

2921
spotless {
@@ -39,10 +31,6 @@ subprojects { subproject ->
3931
}
4032
}
4133

42-
repositories {
43-
mavenCentral()
44-
}
45-
4634
tasks.withType(Test).configureEach {
4735
systemProperty 'file.encoding', 'UTF-8'
4836
}

buildSrc/settings.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dependencyResolutionManagement {
2+
versionCatalogs {
3+
buildLibs {
4+
from(files("../gradle/libs.versions.toml"))
5+
}
6+
}
7+
}

client/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ plugins {
44

55
dependencies {
66
implementation project(":utils")
7-
implementation "com.squareup.okhttp3:okhttp:${rootProject.ext.okhttpVersion}"
8-
testImplementation "com.squareup.okhttp3:mockwebserver:${rootProject.ext.okhttpVersion}"
9-
implementation "com.google.code.gson:gson:${rootProject.ext.gsonVersion}"
10-
implementation "org.jsoup:jsoup:${rootProject.ext.jsoupVersion}"
11-
annotationProcessor "org.projectlombok:lombok:${rootProject.ext.lombokVersion}"
12-
testImplementation platform("org.junit:junit-bom:${rootProject.ext.junitVersion}")
13-
testImplementation 'org.junit.jupiter:junit-jupiter'
7+
implementation libs.okhttp
8+
testImplementation libs.mockwebserver
9+
implementation libs.gson
10+
implementation libs.jsoup
11+
annotationProcessor libs.lombok
12+
testImplementation platform(libs.junitBom)
13+
testImplementation libs.junit
1414
}
1515

1616
configurations {

core/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ plugins {
44

55
dependencies {
66
api project(":client")
7-
implementation "com.squareup.okhttp3:okhttp:${rootProject.ext.okhttpVersion}"
8-
testImplementation "com.squareup.okhttp3:mockwebserver:${rootProject.ext.okhttpVersion}"
9-
annotationProcessor "org.projectlombok:lombok:${rootProject.ext.lombokVersion}"
10-
testImplementation platform("org.junit:junit-bom:${rootProject.ext.junitVersion}")
11-
testImplementation 'org.junit.jupiter:junit-jupiter'
7+
implementation libs.okhttp
8+
testImplementation libs.mockwebserver
9+
annotationProcessor libs.lombok
10+
testImplementation platform(libs.junitBom)
11+
testImplementation libs.junit
1212
}
1313

1414
configurations {

gradle/libs.versions.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[versions]
2+
jsoup = "1.18.3"
3+
okhttp = "4.12.0"
4+
gson = "2.12.1"
5+
lombok = "1.18.36"
6+
junit = "5.9.1"
7+
spotless = "5.17.0"
8+
9+
[libraries]
10+
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
11+
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
12+
mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
13+
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
14+
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }
15+
junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
16+
junitBom = { module = "org.junit:junit-bom", version.ref = "junit" }
17+
18+
[plugins]
19+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }

utils/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ plugins {
33
}
44

55
dependencies {
6-
annotationProcessor "org.projectlombok:lombok:${rootProject.ext.lombokVersion}"
7-
testImplementation platform("org.junit:junit-bom:${rootProject.ext.junitVersion}")
8-
testImplementation 'org.junit.jupiter:junit-jupiter'
6+
annotationProcessor libs.lombok
7+
testImplementation platform(libs.junitBom)
8+
testImplementation libs.junit
99
}
1010

1111
configurations {

0 commit comments

Comments
 (0)