11import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2- import org.hibernate.build.publish.auth.maven.MavenRepoAuthPlugin
32import org.jetbrains.kotlin.gradle.dsl.JvmTarget
43
54plugins {
@@ -8,18 +7,12 @@ plugins {
87 id(" org.jlleitschuh.gradle.ktlint" ) version Versions .KTLINT_PLUGIN
98 kotlin(" jvm" ) version Versions .KOTLIN
109 kotlin(" plugin.serialization" ) version Versions .KOTLIN
11- id(" maven-publish" )
1210 id(" signing" )
13- id(" org.hibernate.build.maven-repo-auth" ) version Versions .MAVEN_REPO_AUTH_PLUGIN apply false
14- }
15-
16- if (! project.hasProperty(" isGithubActions" )) {
17- // only use this plugin if we're running locally, not on github.
18- apply<MavenRepoAuthPlugin >()
11+ id(" com.vanniktech.maven.publish" ) version Versions .MAVEN_PUBLISH
1912}
2013
2114group = " io.newm"
22- version = " 2.5.0 -SNAPSHOT"
15+ version = " 2.5.1 -SNAPSHOT"
2316
2417java.sourceCompatibility = JavaVersion .VERSION_21
2518java.targetCompatibility = JavaVersion .VERSION_21
@@ -44,7 +37,6 @@ dependencies {
4437 implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions .COROUTINES } " )
4538 implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${Versions .COROUTINES } " )
4639 implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions .KOTLINX_SERIALIZATION } " )
47- implementation(" org.jetbrains.kotlinx:kotlinx-datetime:${Versions .KOTLINX_DATETIME } " )
4840
4941 implementation(" org.apache.commons:commons-numbers-fraction:${Versions .COMMONS_NUMBERS } " )
5042
@@ -61,86 +53,42 @@ ktlint {
6153 version.set(Versions .KTLINT )
6254}
6355
64- tasks {
65-
66- val sourcesJar by registering(Jar ::class ) {
67- archiveClassifier.set(" sources" )
68- dependsOn(" classes" )
69- from(sourceSets[" main" ].allSource)
70- }
71-
72- val javadocJar by registering(Jar ::class ) {
73- archiveClassifier.set(" javadoc" )
74- dependsOn(" javadoc" )
75- from(" ${layout.buildDirectory} /javadoc" )
76- }
77-
78- artifacts {
79- archives(javadocJar)
80- archives(sourcesJar)
81- }
82-
83- assemble {
84- dependsOn(" sourcesJar" , " javadocJar" )
85- }
56+ signing {
57+ useGpgCmd()
8658}
8759
88- publishing {
89- repositories {
90- maven {
91- name = " ossrh"
92- val releasesRepoUrl = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
93- val snapshotsRepoUrl = " https://s01.oss.sonatype.org/content/repositories/snapshots/"
94- if (project.hasProperty(" release" )) {
95- setUrl(releasesRepoUrl)
96- } else {
97- setUrl(snapshotsRepoUrl)
60+ mavenPublishing {
61+ publishToMavenCentral()
62+ signAllPublications()
63+ coordinates(" io.newm" , " kogmios" , version.toString())
64+ pom {
65+ name.set(" Kogmios" )
66+ description.set(" Kotlin Wrapper for Ogmios" )
67+ url.set(" https://github.com/projectNEWM/kogmios" )
68+ licenses {
69+ license {
70+ name.set(" Apache 2.0" )
71+ url.set(" https://github.com/projectNEWM/kogmios/blob/master/LICENSE" )
72+ distribution.set(" https://github.com/projectNEWM/kogmios/blob/master/LICENSE" )
9873 }
9974 }
100- }
101- publications {
102- create<MavenPublication >(" mavenKotlin" ) {
103- from(components[" kotlin" ])
104- artifact(tasks[" sourcesJar" ])
105- artifact(tasks[" javadocJar" ])
106-
107- pom {
108- groupId = " io.newm"
109- artifactId = " kogmios"
110-
111- name.set(" Kogmios" )
112- description.set(" Kotlin Wrapper for Ogmios" )
113- url.set(" https://github.com/projectNEWM/kogmios" )
114- licenses {
115- license {
116- name.set(" Apache 2.0" )
117- url.set(" https://github.com/projectNEWM/kogmios/blob/master/LICENSE" )
118- }
119- }
120- developers {
121- developer {
122- id.set(" AndrewWestberg" )
123- name.set(" Andrew Westberg" )
124- email.set(" andrewwestberg@gmail.com" )
125- organization.set(" NEWM" )
126- organizationUrl.set(" https://newm.io" )
127- }
128- }
129- scm {
130- connection.set(" scm:git:git://github.com/projectNEWM/kogmios.git" )
131- developerConnection.set(" scm:git:ssh://github.com/projectNEWM/kogmios.git" )
132- url.set(" https://github.com/projectNEWM/kogmios" )
133- }
75+ developers {
76+ developer {
77+ id.set(" AndrewWestberg" )
78+ name.set(" Andrew Westberg" )
79+ email.set(" andrewwestberg@gmail.com" )
80+ organization.set(" NEWM" )
81+ organizationUrl.set(" https://newm.io" )
13482 }
13583 }
84+ scm {
85+ connection.set(" scm:git:git://github.com/projectNEWM/kogmios.git" )
86+ developerConnection.set(" scm:git:ssh://github.com/projectNEWM/kogmios.git" )
87+ url.set(" https://github.com/projectNEWM/kogmios" )
88+ }
13689 }
13790}
13891
139- signing {
140- useGpgCmd()
141- sign(publishing.publications[" mavenKotlin" ])
142- }
143-
14492fun isNonStable (version : String ): Boolean {
14593 val stableKeyword = listOf (" RELEASE" , " FINAL" , " GA" ).any { version.uppercase().contains(it) }
14694 val regex = " ^[0-9,.v-]+(-r)?$" .toRegex()
@@ -153,17 +101,17 @@ tasks.withType<Test> {
153101}
154102
155103tasks.withType<DependencyUpdatesTask > {
156- // Example 1: reject all non stable versions
104+ // Example 1: reject all non stable versions
157105 rejectVersionIf {
158106 isNonStable(candidate.version)
159107 }
160108
161- // Example 2: disallow release candidates as upgradable versions from stable versions
109+ // Example 2: disallow release candidates as upgradable versions from stable versions
162110 rejectVersionIf {
163111 isNonStable(candidate.version) && ! isNonStable(currentVersion)
164112 }
165113
166- // Example 3: using the full syntax
114+ // Example 3: using the full syntax
167115 resolutionStrategy {
168116 componentSelection {
169117 all {
@@ -193,6 +141,7 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
193141 " -opt-in=kotlin.RequiresOptIn" ,
194142 " -opt-in=kotlinx.serialization.ExperimentalSerializationApi" ,
195143 " -opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" ,
144+ " -opt-in=kotlin.time.ExperimentalTime" ,
196145 )
197146 jvmTarget.set(JvmTarget .JVM_21 )
198147 }
0 commit comments