[build] version of kotlin native stored in resouces
This commit is contained in:
committed by
Stanislav Erokhin
parent
bdc87edfd0
commit
905c0c3dd3
@@ -96,7 +96,10 @@ repositories {
|
||||
}
|
||||
}
|
||||
|
||||
val generateCompilerVersion by tasks.registering(VersionGenerator::class) {}
|
||||
val generateCompilerVersion by tasks.registering(VersionGenerator::class) {
|
||||
kotlinNativeVersionInResources=true
|
||||
defaultVersionFileLocation()
|
||||
}
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
dependsOn(generateCompilerVersion)
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.konan
|
||||
import java.io.*
|
||||
|
||||
val VERSION_PATH = "/META-INF/kotlin-native.compiler.version"
|
||||
val CompilerVersion.Companion.CURRENT: CompilerVersion
|
||||
get() {
|
||||
return InputStreamReader(this::class.java.getResourceAsStream(VERSION_PATH)).use {
|
||||
it.readLines().single().parseCompilerVersion()
|
||||
}
|
||||
}
|
||||
|
||||
val currentCompilerVersion = CompilerVersion.CURRENT
|
||||
Reference in New Issue
Block a user