Skip to content

Commit ac9e7eb

Browse files
committed
Fix jitpack publication java8 compatibility
1 parent 3f7b779 commit ac9e7eb

File tree

7 files changed

+75
-10
lines changed

7 files changed

+75
-10
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ dependencies {
134134
}
135135
```
136136

137+
```kotlin
138+
dependencies {
139+
implementation("io.github.nsk90:kstatemachine:<Tag>")
140+
}
141+
```
142+
137143
Where `<Tag>` is a library version.
138144

139145
### JitPack
@@ -142,6 +148,7 @@ Add the [JitPack](https://jitpack.io/#nsk90/kstatemachine/Tag) repository to you
142148
root `build.gradle` at the end of repositories:
143149

144150
```groovy
151+
// groovy
145152
allprojects {
146153
repositories {
147154
// ...
@@ -150,14 +157,30 @@ allprojects {
150157
}
151158
```
152159

160+
```kotlin
161+
// kotlin
162+
repositories {
163+
// ...
164+
maven { url = uri("https://jitpack.io") }
165+
}
166+
```
167+
153168
Add the dependency:
154169

155170
```groovy
171+
// groovy
156172
dependencies {
157173
implementation 'com.github.nsk90:kstatemachine:<Tag>'
158174
}
159175
```
160176

177+
```kotlin
178+
// kotlin
179+
dependencies {
180+
implementation("com.github.nsk90:kstatemachine:<Tag>")
181+
}
182+
```
183+
161184
Where `<Tag>` is a library version.
162185

163186
## Build

buildSrc/build.gradle.kts

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

55
repositories {
66
mavenCentral()
7-
}
8-
9-
java {
10-
sourceCompatibility = JavaVersion.VERSION_1_8
11-
targetCompatibility = JavaVersion.VERSION_1_8
127
}

buildSrc/src/main/kotlin/ru/nsk/Versions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object Versions {
22
// library
3-
const val libraryGroup = "ru.nsk"
3+
const val libraryGroup = "io.github.nsk90"
44
const val libraryVersion = "0.17.0"
55

66
// tools

buildSrc/src/main/kotlin/ru/nsk/maven-publish.gradle.kts

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ val localProperties = Properties().apply {
3131

3232
publishing {
3333
publications {
34-
create<MavenPublication>("mavenJava") {
34+
create<MavenPublication>("mavenCentral") {
3535
groupId = "io.github.nsk90"
3636
artifactId = "kstatemachine"
3737
version = rootProject.version as String
@@ -83,6 +83,49 @@ publishing {
8383
}
8484
}
8585
}
86+
87+
create<MavenPublication>("mavenJitpack") {
88+
groupId = "com.github.nsk90"
89+
artifactId = "kstatemachine"
90+
version = rootProject.version as String
91+
92+
from(components["java"])
93+
94+
pom {
95+
name.set(rootProject.name)
96+
description.set(
97+
"KStateMachine is a Kotlin DSL library for creating finite state machines (FSM) " +
98+
"and hierarchical state machines (HSM)."
99+
)
100+
url.set("https://github.com/nsk90/kstatemachine")
101+
inceptionYear.set("2020")
102+
103+
issueManagement {
104+
system.set("GitHub")
105+
url.set("https://github.com/nsk90/kstatemachine/issues")
106+
}
107+
licenses {
108+
license {
109+
name.set("Boost Software License 1.0")
110+
url.set("https://raw.githubusercontent.com/nsk90/kstatemachine/master/LICENSE")
111+
distribution.set("repo")
112+
}
113+
}
114+
developers {
115+
developer {
116+
id.set("nsk")
117+
name.set("Mikhail Fedotov")
118+
email.set("[email protected]")
119+
url.set("https://github.com/nsk90")
120+
}
121+
}
122+
scm {
123+
url.set("https://github.com/nsk90/kstatemachine")
124+
connection.set("scm:git:git://github.com/nsk90/kstatemachine.git")
125+
developerConnection.set("scm:git:ssh://[email protected]/nsk90/kstatemachine.git")
126+
}
127+
}
128+
}
86129
}
87130
}
88131

@@ -97,7 +140,7 @@ localProperties.getProperty("signing.gnupg.executable")?.let { executable ->
97140

98141
signing {
99142
useGpgCmd()
100-
sign(publishing.publications["mavenJava"])
143+
sign(publishing.publications["mavenCentral"])
101144
}
102145
}
103146
}

kstatemachine/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ tasks {
2323
}
2424
}
2525

26+
java {
27+
sourceCompatibility = JavaVersion.VERSION_1_8
28+
targetCompatibility = JavaVersion.VERSION_1_8
29+
}
30+
2631
dependencies {
2732
testImplementation("io.kotest:kotest-assertions-core:${Versions.kotest}")
2833
testImplementation("io.kotest:kotest-framework-datatest:${Versions.kotest}")

kstatemachine/src/test/kotlin/ru/nsk/kstatemachine/ExternalTransitionTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class ExternalTransitionTest : StringSpec({
117117
val callbacks = mockkCallbacks()
118118
lateinit var state1: State
119119
lateinit var state11: State
120-
lateinit var state12: State
121120

122121
val machine = createStateMachine {
123122
callbacks.listen(this)

samples/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ application {
1212

1313
dependencies {
1414
implementation(project(":kstatemachine"))
15-
}
15+
}

0 commit comments

Comments
 (0)