Skip to content

Commit

Permalink
Generate correct plugin version sources in core module.
Browse files Browse the repository at this point in the history
  • Loading branch information
lamba92 committed Dec 14, 2023
1 parent 9efc988 commit f9e1a87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions plugin/core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@file:Suppress("UnstableApiUsage")

import kotlin.math.max
import org.jetbrains.packagesearch.gradle.GeneratePackageSearchObject


Expand Down Expand Up @@ -42,13 +43,19 @@ kotlin.sourceSets.main {

val pkgsPluginId: String by project

val runNumber = System.getenv("RUN_NUMBER")?.toInt() ?: 0
val runAttempt = System.getenv("RUN_ATTEMPT")?.toInt() ?: 0
val snapshotMinorVersion = max(0, runNumber + runAttempt - 1)
val versionString = project.version.toString()

tasks {
withType<Test> {
environment("DB_PATH", layout.buildDirectory.file("tests/cache.db").get().asFile.absolutePath)
}
val generatePluginDataSources by registering(GeneratePackageSearchObject::class) {
pluginId = pkgsPluginId
outputDir = generatedDir
pluginVersion = versionString.replace("-SNAPSHOT", ".$snapshotMinorVersion")
packageName = "com.jetbrains.packagesearch.plugin.core"
}
sourcesJar {
Expand Down

0 comments on commit f9e1a87

Please sign in to comment.