Skip to content

Commit 332988b

Browse files
committed
Specify release version in maven plugin descriptor
1 parent ccf20ea commit 332988b

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

Diff for: build-logic/src/main/kotlin/kotlinx/kover/conventions/kover-publishing-conventions.gradle.kts

-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ fun MavenPublication.addMetadata() {
170170
if (!name.isPresent) {
171171
name.set(artifactId)
172172
}
173-
if (hasProperty("releaseVersion")) {
174-
version = property("releaseVersion") as String
175-
}
176173
groupId = "org.jetbrains.kotlinx"
177174
description.set(extension.description)
178175

Diff for: build-logic/src/main/kotlin/kotlinx/kover/conventions/kover-release-conventions.gradle.kts

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import java.time.format.DateTimeFormatter
1010
// ====================
1111
tasks.register("prepareRelease") {
1212
doLast {
13-
if (!project.hasProperty("releaseVersion")) {
14-
throw GradleException("Property 'releaseVersion' is required to run this task")
13+
if (project.version.toString().endsWith("-SNAPSHOT")) {
14+
throw GradleException("Version shouldn't be snapshot")
1515
}
16-
val releaseVersion = project.property("releaseVersion") as String
16+
val releaseVersion = project.version.toString()
1717
val prevReleaseVersion = project.property("kover.release.version") as String
1818

1919
val projectDir = layout.projectDirectory
@@ -30,8 +30,6 @@ tasks.register("prepareRelease") {
3030
// replace versions in docs
3131
projectDir.dir("docs").patchDocs(releaseVersion, prevReleaseVersion)
3232
}
33-
34-
3533
}
3634
}
3735

Diff for: kover-features-jvm/build.gradle.kts

+1-7
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,10 @@ repositories {
5656
}
5757

5858
tasks.processResources {
59-
val version = if (project.hasProperty("releaseVersion")) {
60-
project.property("releaseVersion").toString()
61-
} else {
62-
project.version.toString()
63-
}
64-
6559
val file = destinationDir.resolve("kover.version")
6660

6761
doLast {
68-
file.writeText(version)
62+
file.writeText(project.version.toString())
6963
}
7064
}
7165

Diff for: kover-jvm-agent/build.gradle.kts

+1-7
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,14 @@ dependencies {
4545
fatJar(libs.intellij.agent)
4646
}
4747

48-
val targetVersion = if (project.hasProperty("releaseVersion")) {
49-
project.property("releaseVersion").toString()
50-
} else {
51-
project.version.toString()
52-
}
53-
5448
tasks.jar {
5549
manifest {
5650
attributes(
5751
"Premain-Class" to "kotlinx.kover.jvmagent.KoverJvmAgentPremain",
5852
"Can-Retransform-Classes" to "true",
5953
// We need to pass this parameter, because IntelliJ agent collects data in the bootstrap class loader
6054
// it is not possible to use other loaders because some of them (for example, FilteredClassLoader) restrict access to agent classes
61-
"Boot-Class-Path" to "${project.name}-$targetVersion.jar"
55+
"Boot-Class-Path" to "${project.name}-${project.version}.jar"
6256
)
6357
}
6458
}

0 commit comments

Comments
 (0)