mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
never downgrade Kotlin version when updating from sources: if currently bundled Kotlin plugin is newer than build/kotlinc, use the bundled plugin
This commit is contained in:
@@ -24,8 +24,25 @@ target('default': 'Ensures that build/kotlinc directory contains JARs from Kotli
|
||||
def communityHome = guessHome(this)
|
||||
def reasonToUpdate = getReasonToUpdate(communityHome, new File(communityHome, "build/kotlinc"))
|
||||
if (reasonToUpdate == null) {
|
||||
projectBuilder.info("Compatible Kotlin plugin already installed, no update is required")
|
||||
return
|
||||
if (isDefined("workIdeaHome")) {
|
||||
def workKotlinVersionFile = new File(workIdeaHome, "plugins/Kotlin/kotlinc/build.txt")
|
||||
if (workKotlinVersionFile.exists()) {
|
||||
try {
|
||||
def currentKotlinVersionFile = new File(communityHome, "build/kotlinc/build.txt")
|
||||
if (VersionComparatorUtil.compare(currentKotlinVersionFile.text, workKotlinVersionFile.text) < 0) {
|
||||
reasonToUpdate = "a newer version is installed in $workIdeaHome"
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
reasonToUpdate = "cannot read Kotlin version: $e"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (reasonToUpdate == null) {
|
||||
projectBuilder.info("Compatible Kotlin plugin already installed, no update is required")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
projectBuilder.info("Kotlin plugin will be updated: $reasonToUpdate")
|
||||
|
||||
Reference in New Issue
Block a user