Skip to content

Commit 2e4db07

Browse files
committed
Move version definition to root level
1 parent 0856693 commit 2e4db07

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ plugins {
66
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
77
}
88

9-
val libVersion by extra("2.6.0")
9+
// Set a property
10+
extra["pi4jVersion"] = "2.6.0"
11+
extra["slf4jVersion"] = "2.0.12"
12+
extra["kotlinCoroutinesVersion"] = "1.6.4"
1013

1114
group = "com.pi4j"
12-
version = libVersion
15+
version = "2.6.0"
1316

1417
repositories {
1518
mavenCentral()

example/build.gradle.kts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ repositories {
1616
}
1717

1818
dependencies {
19+
val pi4jVersion: String by rootProject.extra
20+
val slf4jVersion: String by rootProject.extra
21+
val kotlinCoroutinesVersion: String by rootProject.extra
1922
implementation(project(":lib"))
20-
implementation("com.pi4j:pi4j-core:2.6.0")
21-
implementation("com.pi4j:pi4j-plugin-raspberrypi:2.6.0")
22-
implementation("com.pi4j:pi4j-plugin-pigpio:2.6.0")
23-
implementation("com.pi4j:pi4j-plugin-gpiod:2.6.0")
24-
implementation("com.pi4j:pi4j-plugin-linuxfs:2.6.0")
25-
implementation("com.pi4j:pi4j-plugin-mock:2.6.0")
26-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
27-
implementation("org.slf4j:slf4j-api:2.0.12")
28-
implementation("org.slf4j:slf4j-simple:2.0.12")
23+
implementation("com.pi4j:pi4j-core:$pi4jVersion")
24+
implementation("com.pi4j:pi4j-plugin-raspberrypi:$pi4jVersion")
25+
implementation("com.pi4j:pi4j-plugin-pigpio:$pi4jVersion")
26+
implementation("com.pi4j:pi4j-plugin-gpiod:$pi4jVersion")
27+
implementation("com.pi4j:pi4j-plugin-linuxfs:$pi4jVersion")
28+
implementation("com.pi4j:pi4j-plugin-mock:$pi4jVersion")
29+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
30+
implementation("org.slf4j:slf4j-api:$slf4jVersion")
31+
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
2932
testImplementation(kotlin("test"))
3033
}
3134

lib/build.gradle.kts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@ plugins {
55
signing
66
}
77
val libName = "pi4j-ktx"
8-
val libVersion: String by rootProject.extra
98

109
group = "com.pi4j"
11-
version = libVersion
1210

1311
repositories {
1412
mavenCentral()
1513
}
1614

1715
dependencies {
18-
compileOnly("com.pi4j:pi4j-core:2.6.0")
19-
testImplementation("com.pi4j:pi4j-core:2.6.0")
20-
compileOnly("com.pi4j:pi4j-plugin-mock:2.6.0")
21-
testImplementation("com.pi4j:pi4j-plugin-mock:2.6.0")
22-
compileOnly("org.slf4j:slf4j-api:2.0.12")
23-
testImplementation("org.slf4j:slf4j-api:2.0.12")
24-
compileOnly("org.slf4j:slf4j-simple:2.0.12")
25-
testImplementation("org.slf4j:slf4j-simple:2.0.12")
26-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
16+
val pi4jVersion: String by rootProject.extra
17+
val slf4jVersion: String by rootProject.extra
18+
val kotlinCoroutinesVersion: String by rootProject.extra
19+
compileOnly("com.pi4j:pi4j-core:$pi4jVersion")
20+
testImplementation("com.pi4j:pi4j-core:$pi4jVersion")
21+
compileOnly("com.pi4j:pi4j-plugin-mock:$pi4jVersion")
22+
testImplementation("com.pi4j:pi4j-plugin-mock:$pi4jVersion")
23+
compileOnly("org.slf4j:slf4j-api:$slf4jVersion")
24+
testImplementation("org.slf4j:slf4j-api:$slf4jVersion")
25+
compileOnly("org.slf4j:slf4j-simple:$slf4jVersion")
26+
testImplementation("org.slf4j:slf4j-simple:$slf4jVersion")
27+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
2728
testImplementation(kotlin("test"))
2829
}
2930

@@ -51,13 +52,14 @@ publishing {
5152
}
5253
}
5354
publications {
55+
val pi4jVersion: String by rootProject.extra
5456
create<MavenPublication>(libName) {
5557
groupId = "com.pi4j"
5658
artifactId = libName
57-
version = libVersion
59+
version = pi4jVersion
5860
from(components["java"])
5961
pom {
60-
version = libVersion
62+
version = pi4jVersion
6163
artifactId = libName
6264
name.set("pi4j-ktx")
6365
description.set("Kotlin DSL for Pi4J V2")

0 commit comments

Comments
 (0)