Skip to content

Commit

Permalink
Move version definition to root level
Browse files Browse the repository at this point in the history
  • Loading branch information
FDelporte committed Jul 25, 2024
1 parent 0856693 commit 2e4db07
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

val libVersion by extra("2.6.0")
// Set a property
extra["pi4jVersion"] = "2.6.0"
extra["slf4jVersion"] = "2.0.12"
extra["kotlinCoroutinesVersion"] = "1.6.4"

group = "com.pi4j"
version = libVersion
version = "2.6.0"

repositories {
mavenCentral()
Expand Down
21 changes: 12 additions & 9 deletions example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ repositories {
}

dependencies {
val pi4jVersion: String by rootProject.extra
val slf4jVersion: String by rootProject.extra
val kotlinCoroutinesVersion: String by rootProject.extra
implementation(project(":lib"))
implementation("com.pi4j:pi4j-core:2.6.0")
implementation("com.pi4j:pi4j-plugin-raspberrypi:2.6.0")
implementation("com.pi4j:pi4j-plugin-pigpio:2.6.0")
implementation("com.pi4j:pi4j-plugin-gpiod:2.6.0")
implementation("com.pi4j:pi4j-plugin-linuxfs:2.6.0")
implementation("com.pi4j:pi4j-plugin-mock:2.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
implementation("org.slf4j:slf4j-api:2.0.12")
implementation("org.slf4j:slf4j-simple:2.0.12")
implementation("com.pi4j:pi4j-core:$pi4jVersion")
implementation("com.pi4j:pi4j-plugin-raspberrypi:$pi4jVersion")
implementation("com.pi4j:pi4j-plugin-pigpio:$pi4jVersion")
implementation("com.pi4j:pi4j-plugin-gpiod:$pi4jVersion")
implementation("com.pi4j:pi4j-plugin-linuxfs:$pi4jVersion")
implementation("com.pi4j:pi4j-plugin-mock:$pi4jVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
testImplementation(kotlin("test"))
}

Expand Down
28 changes: 15 additions & 13 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ plugins {
signing
}
val libName = "pi4j-ktx"
val libVersion: String by rootProject.extra

group = "com.pi4j"
version = libVersion

repositories {
mavenCentral()
}

dependencies {
compileOnly("com.pi4j:pi4j-core:2.6.0")
testImplementation("com.pi4j:pi4j-core:2.6.0")
compileOnly("com.pi4j:pi4j-plugin-mock:2.6.0")
testImplementation("com.pi4j:pi4j-plugin-mock:2.6.0")
compileOnly("org.slf4j:slf4j-api:2.0.12")
testImplementation("org.slf4j:slf4j-api:2.0.12")
compileOnly("org.slf4j:slf4j-simple:2.0.12")
testImplementation("org.slf4j:slf4j-simple:2.0.12")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
val pi4jVersion: String by rootProject.extra
val slf4jVersion: String by rootProject.extra
val kotlinCoroutinesVersion: String by rootProject.extra
compileOnly("com.pi4j:pi4j-core:$pi4jVersion")
testImplementation("com.pi4j:pi4j-core:$pi4jVersion")
compileOnly("com.pi4j:pi4j-plugin-mock:$pi4jVersion")
testImplementation("com.pi4j:pi4j-plugin-mock:$pi4jVersion")
compileOnly("org.slf4j:slf4j-api:$slf4jVersion")
testImplementation("org.slf4j:slf4j-api:$slf4jVersion")
compileOnly("org.slf4j:slf4j-simple:$slf4jVersion")
testImplementation("org.slf4j:slf4j-simple:$slf4jVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
testImplementation(kotlin("test"))
}

Expand Down Expand Up @@ -51,13 +52,14 @@ publishing {
}
}
publications {
val pi4jVersion: String by rootProject.extra
create<MavenPublication>(libName) {
groupId = "com.pi4j"
artifactId = libName
version = libVersion
version = pi4jVersion
from(components["java"])
pom {
version = libVersion
version = pi4jVersion
artifactId = libName
name.set("pi4j-ktx")
description.set("Kotlin DSL for Pi4J V2")
Expand Down

0 comments on commit 2e4db07

Please sign in to comment.