[K/N] Remove old Compiler and Meta Version ^KT-55677 Fixed
* Replace it with KotlinCompilerVersion * K/N version should be set now with `deployVersion`. * Cleanup deprecated functions in older versions of the Gradle plugin * Cleanup tests for older versions of compiler downloader Merge-request: KT-MR-8436 Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
5ec626b29d
commit
c9aeadd31f
+2
-3
@@ -11,8 +11,7 @@ import kotlinx.metadata.klib.KlibModuleMetadata
|
||||
import kotlinx.metadata.klib.className
|
||||
import kotlinx.metadata.klib.fqName
|
||||
import org.jetbrains.kotlin.backend.common.serialization.KlibIrVersion
|
||||
import org.jetbrains.kotlin.konan.CURRENT
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import org.jetbrains.kotlin.konan.file.File
|
||||
import org.jetbrains.kotlin.konan.library.impl.KonanLibraryLayoutForWriter
|
||||
import org.jetbrains.kotlin.konan.library.impl.KonanLibraryWriterImpl
|
||||
@@ -41,7 +40,7 @@ fun createInteropLibrary(
|
||||
val version = KotlinLibraryVersioning(
|
||||
libraryVersion = libraryVersion,
|
||||
abiVersion = KotlinAbiVersion.CURRENT,
|
||||
compilerVersion = CompilerVersion.CURRENT.toString(),
|
||||
compilerVersion = KotlinCompilerVersion.VERSION,
|
||||
metadataVersion = KlibMetadataVersion.INSTANCE.toString(),
|
||||
irVersion = KlibIrVersion.INSTANCE.toString()
|
||||
)
|
||||
|
||||
@@ -21,11 +21,8 @@ sourceSets {
|
||||
compiler {
|
||||
kotlin {
|
||||
srcDir 'compiler/ir/backend.native/src/'
|
||||
srcDir(VersionGeneratorKt.kotlinNativeVersionSrc(project))
|
||||
}
|
||||
resources.srcDir 'compiler/ir/backend.native/resources/'
|
||||
/* PATH to META-INF */
|
||||
resources.srcDir VersionGeneratorKt.kotlinNativeVersionResourceFile(project).parentFile.parent
|
||||
}
|
||||
cli_bc {
|
||||
kotlin.srcDir 'cli.bc/src'
|
||||
@@ -235,7 +232,7 @@ publishing {
|
||||
maven(MavenPublication) {
|
||||
groupId = 'org.jetbrains.kotlin'
|
||||
artifactId = 'backend.native'
|
||||
version = konanVersionFull
|
||||
version = kotlinVersion
|
||||
|
||||
from components.java
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.cli.bc
|
||||
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import org.jetbrains.annotations.NotNull
|
||||
import org.jetbrains.annotations.Nullable
|
||||
import org.jetbrains.kotlin.analyzer.CompilationErrorException
|
||||
@@ -22,9 +21,8 @@ import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser
|
||||
import org.jetbrains.kotlin.config.CommonConfigurationKeys
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import org.jetbrains.kotlin.config.Services
|
||||
import org.jetbrains.kotlin.konan.CURRENT
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.library.metadata.KlibMetadataVersion
|
||||
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
@@ -49,7 +47,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
@Nullable paths: KotlinPaths?): ExitCode {
|
||||
|
||||
if (arguments.version) {
|
||||
println("Kotlin/Native: ${CompilerVersion.CURRENT}")
|
||||
println("Kotlin/Native: ${KotlinCompilerVersion.getVersion() ?: "SNAPSHOT"}")
|
||||
return ExitCode.OK
|
||||
}
|
||||
|
||||
@@ -76,7 +74,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
|Compilation failed: ${e.message}
|
||||
|
||||
| * Source files: ${environment.getSourceFiles().joinToString(transform = KtFile::getName)}
|
||||
| * Compiler version info: Konan: ${CompilerVersion.CURRENT} / Kotlin: ${KotlinVersion.CURRENT}
|
||||
| * Compiler version: ${KotlinCompilerVersion.getVersion()}
|
||||
| * Output kind: ${configuration.get(KonanConfigKeys.PRODUCE)}
|
||||
|
||||
""".trimMargin())
|
||||
|
||||
+12
-5
@@ -14,9 +14,7 @@ import org.jetbrains.kotlin.cli.common.config.kotlinSourceRoots
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||
import org.jetbrains.kotlin.config.CommonConfigurationKeys
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.konan.CURRENT
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.konan.MetaVersion
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import org.jetbrains.kotlin.konan.file.File
|
||||
import org.jetbrains.kotlin.konan.library.KonanLibrary
|
||||
import org.jetbrains.kotlin.konan.properties.loadProperties
|
||||
@@ -171,8 +169,8 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
get() = configuration.get(KonanConfigKeys.VERIFY_IR) == true
|
||||
|
||||
val needCompilerVerification: Boolean
|
||||
get() = configuration.get(KonanConfigKeys.VERIFY_COMPILER) ?:
|
||||
(optimizationsEnabled || CompilerVersion.CURRENT.meta != MetaVersion.RELEASE)
|
||||
get() = configuration.get(KonanConfigKeys.VERIFY_COMPILER)
|
||||
?: (optimizationsEnabled || !KotlinCompilerVersion.VERSION.isRelease())
|
||||
|
||||
val appStateTracking: AppStateTracking by lazy {
|
||||
configuration.get(BinaryOptions.appStateTracking) ?: AppStateTracking.DISABLED
|
||||
@@ -508,3 +506,12 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
|
||||
fun CompilerConfiguration.report(priority: CompilerMessageSeverity, message: String)
|
||||
= this.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY).report(priority, message)
|
||||
|
||||
private fun String.isRelease(): Boolean {
|
||||
// major.minor.patch-meta-build where patch, meta and build are optional.
|
||||
val versionPattern = "(\\d+)\\.(\\d+)(?:\\.(\\d+))?(?:-(\\p{Alpha}*\\p{Alnum}|[\\p{Alpha}-]*))?(?:-(\\d+))?".toRegex()
|
||||
val (_, _, _, metaString, build) = versionPattern.matchEntire(this)?.destructured
|
||||
?: throw IllegalStateException("Cannot parse Kotlin/Native version: $this")
|
||||
|
||||
return metaString.isEmpty() && build.isEmpty()
|
||||
}
|
||||
+2
-3
@@ -10,8 +10,7 @@ import org.jetbrains.kotlin.backend.konan.KonanConfigKeys
|
||||
import org.jetbrains.kotlin.backend.konan.OutputFiles
|
||||
import org.jetbrains.kotlin.backend.konan.driver.PhaseContext
|
||||
import org.jetbrains.kotlin.backend.konan.driver.PhaseEngine
|
||||
import org.jetbrains.kotlin.konan.CURRENT
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import org.jetbrains.kotlin.konan.library.impl.buildLibrary
|
||||
import org.jetbrains.kotlin.library.KotlinAbiVersion
|
||||
import org.jetbrains.kotlin.library.KotlinLibraryVersioning
|
||||
@@ -28,7 +27,7 @@ internal val WriteKlibPhase = createSimpleNamedCompilerPhase<PhaseContext, Seria
|
||||
val libraryName = config.moduleId
|
||||
val shortLibraryName = config.shortModuleName
|
||||
val abiVersion = KotlinAbiVersion.CURRENT
|
||||
val compilerVersion = CompilerVersion.CURRENT.toString()
|
||||
val compilerVersion = KotlinCompilerVersion.getVersion().toString()
|
||||
val libraryVersion = configuration.get(KonanConfigKeys.LIBRARY_VERSION)
|
||||
val metadataVersion = KlibMetadataVersion.INSTANCE.toString()
|
||||
val irVersion = KlibIrVersion.INSTANCE.toString()
|
||||
|
||||
+1
-3
@@ -19,12 +19,10 @@ import org.jetbrains.kotlin.ir.util.SYNTHETIC_OFFSET
|
||||
import org.jetbrains.kotlin.ir.util.isTypeParameter
|
||||
import org.jetbrains.kotlin.ir.util.isUnsigned
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.konan.CURRENT
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.konan.file.File
|
||||
|
||||
internal object DWARF {
|
||||
val producer = "konanc ${CompilerVersion.CURRENT} / kotlin-compiler: ${KotlinVersion.CURRENT}"
|
||||
val producer = "kotlin-compiler: ${KotlinVersion.CURRENT}"
|
||||
const val debugInfoVersion = 3 /* TODO: configurable? */
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,14 +29,13 @@ val rootProperties = Properties().apply {
|
||||
}
|
||||
|
||||
val kotlinVersion = project.bootstrapKotlinVersion
|
||||
val konanVersion: String by rootProperties
|
||||
val slackApiVersion: String by rootProperties
|
||||
val ktorVersion: String by rootProperties
|
||||
val shadowVersion: String by rootProperties
|
||||
val metadataVersion: String by rootProperties
|
||||
|
||||
group = "org.jetbrains.kotlin"
|
||||
version = konanVersion
|
||||
version = kotlinVersion
|
||||
|
||||
repositories {
|
||||
maven("https://cache-redirector.jetbrains.com/maven-central")
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.jetbrains.kotlin.konan.util.*
|
||||
import org.jetbrains.kotlin.CopySamples
|
||||
import org.jetbrains.kotlin.CopyCommonSources
|
||||
import org.jetbrains.kotlin.PlatformInfo
|
||||
import org.jetbrains.kotlin.KotlinBuildPusher
|
||||
import org.jetbrains.kotlin.cpp.CompilationDatabasePlugin
|
||||
import org.jetbrains.kotlin.cpp.CppUsage
|
||||
import org.jetbrains.kotlin.cpp.GitClangFormatPlugin
|
||||
@@ -84,9 +83,6 @@ ext {
|
||||
kotlinScriptRuntimeModule= project(":kotlin-script-runtime")
|
||||
kotlinUtilKliMetadatabModule= project(":kotlin-util-klib-metadata")
|
||||
|
||||
konanVersionFull = ext.kotlinNativeVersion
|
||||
gradlePluginVersion = konanVersionFull
|
||||
|
||||
// A separate map for each build for automatic cleaning the daemon after the build have finished.
|
||||
toolClassLoadersMap = new ConcurrentHashMap<Object, URLClassLoader>()
|
||||
}
|
||||
@@ -314,7 +310,7 @@ task distCompiler(type: Copy) {
|
||||
from(project.file('konan')) {
|
||||
into('konan')
|
||||
include('**/*.properties')
|
||||
filter(ReplaceTokens, tokens: [compilerVersion: konanVersionFull.toString()])
|
||||
filter(ReplaceTokens, tokens: [compilerVersion: kotlinVersion])
|
||||
// Set LLVM variant that will be used by default in the distribution.
|
||||
// `user` - smaller, includes only necessary components.
|
||||
// `dev` - bigger, includes (almost) every possible component. Use this one,
|
||||
@@ -559,7 +555,7 @@ task bundle {
|
||||
task bundleRegular(type: (isWindows()) ? Zip : Tar) {
|
||||
def simpleOsName = HostManager.platformName()
|
||||
archiveBaseName.set("kotlin-native-$simpleOsName")
|
||||
archiveVersion.set(konanVersionFull.toString())
|
||||
archiveVersion.set(kotlinVersion)
|
||||
from(UtilsKt.getKotlinNativeDist(project)) {
|
||||
include '**'
|
||||
exclude 'dependencies'
|
||||
@@ -576,7 +572,7 @@ task bundlePrebuilt(type: (isWindows()) ? Zip : Tar) {
|
||||
dependsOn("crossDistPlatformLibs")
|
||||
def simpleOsName = HostManager.platformName()
|
||||
archiveBaseName.set("kotlin-native-prebuilt-$simpleOsName")
|
||||
archiveVersion.set(konanVersionFull.toString())
|
||||
archiveVersion.set(kotlinVersion)
|
||||
from(UtilsKt.getKotlinNativeDist(project)) {
|
||||
include '**'
|
||||
exclude 'dependencies'
|
||||
@@ -631,7 +627,7 @@ task 'tc-dist'(type: (isWindows()) ? Zip : Tar) {
|
||||
dependsOn('distSources')
|
||||
def simpleOsName = HostManager.platformName()
|
||||
archiveBaseName.set("kotlin-native-dist-$simpleOsName")
|
||||
archiveVersion.set(konanVersionFull.toString())
|
||||
archiveVersion.set(kotlinVersion)
|
||||
from(UtilsKt.getKotlinNativeDist(project)) {
|
||||
include '**'
|
||||
exclude 'dependencies'
|
||||
@@ -659,7 +655,7 @@ task samplesTar(type: Tar) {
|
||||
}
|
||||
|
||||
configure([samplesZip, samplesTar]) {
|
||||
baseName "kotlin-native-samples-$konanVersionFull"
|
||||
baseName "kotlin-native-samples-$kotlinVersion"
|
||||
destinationDir = projectDir
|
||||
into(baseName)
|
||||
|
||||
@@ -694,54 +690,6 @@ project.tasks.register("copySamples", CopySamples) {
|
||||
destinationDir file('build/samples-under-test')
|
||||
}
|
||||
|
||||
task uploadBundle {
|
||||
dependsOn ':kotlin-native:bundle'
|
||||
if (isMac()) {
|
||||
dependsOn ':kotlin-native:bundleRestricted'
|
||||
}
|
||||
doLast {
|
||||
def kind = (konanVersionFull.meta == MetaVersion.DEV) ? "dev" : "releases"
|
||||
def ftpSettings = [
|
||||
server: project.findProperty("cdnUrl") ?: System.getenv("CDN_URL"),
|
||||
userid: project.findProperty("cdnUser") ?: System.getenv("CDN_USER"),
|
||||
password: project.findProperty("cdnPass") ?: System.getenv("CDN_PASS"),
|
||||
remoteDir: "/builds/$kind/$konanVersion/${HostManager.platformName()}"
|
||||
]
|
||||
ant {
|
||||
taskdef(name: 'ftp',
|
||||
classname: 'org.apache.tools.ant.taskdefs.optional.net.FTP',
|
||||
classpath: configurations.ftpAntTask.asPath)
|
||||
ftp([action: "mkdir"] + ftpSettings)
|
||||
ftp(ftpSettings) {
|
||||
fileset(file: bundle.archivePath)
|
||||
}
|
||||
if (isMac()) {
|
||||
ftp(ftpSettings) {
|
||||
fileset(file: bundleRestricted.archivePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task teamcityCompilerVersion {
|
||||
doLast {
|
||||
println("##teamcity[setParameter name='kotlin.native.version.base' value='$konanVersion']")
|
||||
println("##teamcity[setParameter name='kotlin.native.version.full' value='$konanVersionFull']")
|
||||
println("##teamcity[setParameter name='kotlin.native.version.meta' value='${konanVersionFull.meta.toString().toLowerCase()}']")
|
||||
println("##teamcity[buildNumber '${konanVersionFull.toString(true, true)}']")
|
||||
}
|
||||
}
|
||||
|
||||
task pusher(type: KotlinBuildPusher){
|
||||
kotlinVersion = project.kotlinVersion
|
||||
konanVersion = project.ext.kotlinNativeVersion
|
||||
buildServer = "buildserver.labs.intellij.net"
|
||||
compilerConfigurationId = System.getenv("TEAMCITY_COMPILER_ID") ?: "Kotlin_KotlinDev_Compiler"
|
||||
overrideConfigurationId = System.getenv("TEAMCITY_OVERRIDE_NATIVE_ID") ?: "Kotlin_KotlinDev_DeployMavenArtifacts_OverrideNative"
|
||||
token = project.findProperty("teamcityBearToken") ?: System.getenv("TEAMCITY_BEAR_TOKEN")
|
||||
}
|
||||
|
||||
compilationDatabase {
|
||||
allTargets {}
|
||||
}
|
||||
@@ -812,7 +760,7 @@ Map<KonanTarget, File> createConfigurations(List<File> bundles) {
|
||||
throw new IllegalArgumentException("Bundle archives are missing for $missingBundles")
|
||||
}
|
||||
result.each { target, file ->
|
||||
if (!file.name.contains(konanVersionFull.toString())) {
|
||||
if (!file.name.contains(kotlinVersion)) {
|
||||
throw new IllegalArgumentException("Incorrect version specified for the publish: ${file.name}")
|
||||
}
|
||||
}
|
||||
@@ -844,7 +792,7 @@ publishing {
|
||||
register("Bundle", MavenPublication) { mvn ->
|
||||
mvn.groupId = project.group.toString()
|
||||
mvn.artifactId = project.name
|
||||
mvn.version = konanVersionFull
|
||||
mvn.version = kotlinVersion
|
||||
|
||||
if (publishBundlesFromLocation) {
|
||||
def bundleArchives = bundlesLocationFiles
|
||||
@@ -873,7 +821,7 @@ publishing {
|
||||
register("BundlePrebuilt", MavenPublication) { mvn ->
|
||||
mvn.groupId = project.group.toString()
|
||||
mvn.artifactId = project.name + "-prebuilt"
|
||||
mvn.version = konanVersionFull
|
||||
mvn.version = kotlinVersion
|
||||
|
||||
if (publishBundlesFromLocation) {
|
||||
def prebuiltBundleArchives = bundlesLocationFiles
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
# A version of the Kotlin compiler that is used to build Kotlin/Native.
|
||||
remoteRoot=konan_tests
|
||||
konanVersion=1.6.0
|
||||
|
||||
# A version of Xcode required to build the Kotlin/Native compiler.
|
||||
xcodeMajorVersion=14
|
||||
@@ -33,5 +32,3 @@ slackApiVersion=1.2.0
|
||||
ktorVersion=1.2.1
|
||||
shadowVersion=7.1.2
|
||||
metadataVersion=0.0.1-dev-10
|
||||
|
||||
kotlinNativeVersionInResources=true
|
||||
|
||||
@@ -38,9 +38,6 @@ ext.kotlin_root = project.file("../..").absolutePath
|
||||
project.logger.info("kotlin_root: $kotlin_root")
|
||||
globalProperties.load(new java.io.FileReader(project.file("$kotlin_root/gradle.properties")))
|
||||
ext.kotlinNativeVersionInResources = true
|
||||
//TODO: fix VersionGeneratorKt.kotlinNativeVersionValue(project)
|
||||
def versionString = VersionGeneratorKt.kotlinNativeVersionResourceFile(project).readLines().first()
|
||||
def kotlinNativeVersionObject = CompilerVersionKt.parseCompilerVersion(versionString)
|
||||
|
||||
def platformManager = new PlatformManager(DistributionKt.buildDistribution(UtilsKt.getKotlinNativeDist(project).path), false)
|
||||
def kotlinDist = null
|
||||
@@ -67,10 +64,8 @@ subprojects { proj ->
|
||||
proj.ext["bootstrapKotlinVersion"] = BootstrapKt.getBootstrapKotlinVersion(proj)
|
||||
proj.ext["kotlin.native.home"] = proj.projectDir.relativePath(UtilsKt.getKotlinNativeDist(project))
|
||||
proj.ext["konan.home"] = proj.ext["kotlin.native.home"]
|
||||
proj.ext["konanVersion"] = kotlinNativeVersionObject.toString()
|
||||
proj.ext["kotlin.native.enabled"] = true
|
||||
proj.logger.info("${proj.name}<<<[kotlin.native.home] = ${proj.ext["kotlin.native.home"]}")
|
||||
proj.logger.info("${proj.name}<<<[konanVersion] = ${proj.ext["konanVersion"]}>>>")
|
||||
if (project.hasProperty("kotlin_dist")) {
|
||||
proj.ext["kotlin_dist"] = kotlinDist.path
|
||||
proj.logger.info("${proj.name}<<<[kotlin_dist] = ${proj.ext["kotlin_dist"]}>>>")
|
||||
@@ -80,6 +75,7 @@ subprojects { proj ->
|
||||
proj.ext["kotlinVersion"] = findProperty("deployVersion")?.toString()?.identity { deploySnapshotStr ->
|
||||
if (deploySnapshotStr != "default.snapshot") deploySnapshotStr else defaultSnapshotVersion
|
||||
} ?: proj.ext["buildNumber"]
|
||||
proj.logger.info("${proj.name}<<<[kotlinVersion] = ${proj.ext["kotlinVersion"]}>>>")
|
||||
|
||||
proj.repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -7,5 +7,4 @@ import org.gradle.api.Project
|
||||
fun Project.kotlinInit(cacheRedirectorEnabled: Boolean) {
|
||||
extensions.extraProperties["defaultSnapshotVersion"] = kotlinBuildProperties.defaultSnapshotVersion
|
||||
extensions.extraProperties["kotlinVersion"] = findProperty("kotlinVersion")
|
||||
extensions.extraProperties["konanVersion"] = findProperty("konanVersion")
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ task konanJsonReport {
|
||||
"linkBenchmarksAnalyzerDebugFrameworkMacos${archSuffix}".toString(),
|
||||
"cinteropLibcurlMacos${archSuffix}".toString()])
|
||||
def properties = getCommonProperties() + ['type' : 'native',
|
||||
'compilerVersion': "${konanVersion}".toString(),
|
||||
'compilerVersion': "${kotlinVersion}".toString(),
|
||||
'flags' : compilerFlags(buildType).sort(),
|
||||
'benchmarks' : '[]',
|
||||
'compileTime' : [nativeCompileTime],
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.jetbrains.kotlin.konan.library
|
||||
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.konan.file.File
|
||||
import org.jetbrains.kotlin.konan.library.impl.KonanLibraryImpl
|
||||
import org.jetbrains.kotlin.konan.library.impl.createKonanLibraryComponents
|
||||
|
||||
@@ -32,7 +32,7 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
|
||||
classpath "org.jetbrains.kotlin:kotlin-native-shared:$kotlinVersion"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ dependencies {
|
||||
bundleDependencies "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
bundleDependencies "org.jetbrains.kotlin:kotlin-gradle-plugin-api:$kotlinVersion"
|
||||
bundleDependencies "org.jetbrains.kotlin:kotlin-native-utils:$kotlinVersion"
|
||||
bundleDependencies "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
|
||||
bundleDependencies "org.jetbrains.kotlin:kotlin-native-shared:$kotlinVersion"
|
||||
bundleDependencies "org.jetbrains.kotlin:kotlin-util-io:$kotlinVersion"
|
||||
bundleDependencies "org.jetbrains.kotlin:kotlin-util-klib:$kotlinVersion"
|
||||
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ import org.gradle.api.tasks.Internal
|
||||
import org.jetbrains.kotlin.gradle.plugin.tasks.KonanArtifactWithLibrariesTask
|
||||
import org.jetbrains.kotlin.gradle.plugin.tasks.KonanBuildingTask
|
||||
import org.jetbrains.kotlin.konan.*
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.konan.library.defaultResolver
|
||||
import org.jetbrains.kotlin.konan.library.impl.KonanLibraryImpl
|
||||
import org.jetbrains.kotlin.konan.target.Distribution
|
||||
|
||||
+6
-7
@@ -41,8 +41,6 @@ import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.kotlin.gradle.plugin.konan.KonanPlugin.Companion.COMPILE_ALL_TASK_NAME
|
||||
import org.jetbrains.kotlin.gradle.plugin.tasks.*
|
||||
import org.jetbrains.kotlin.konan.CURRENT
|
||||
import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
import org.jetbrains.kotlin.konan.target.buildDistribution
|
||||
@@ -95,10 +93,11 @@ internal val Project.konanHome: String
|
||||
return project.kotlinNativeDist.absolutePath
|
||||
}
|
||||
|
||||
internal val Project.konanVersion: CompilerVersion
|
||||
// Used only for distribution downloading that is not used in the project and should be removed
|
||||
internal val Project.konanVersion: String
|
||||
get() = project.findProperty(KonanPlugin.ProjectProperty.KONAN_VERSION)
|
||||
?.toString()?.let { CompilerVersion.fromString(it) }
|
||||
?: project.findProperty("kotlinNativeVersion") as? CompilerVersion ?: CompilerVersion.CURRENT
|
||||
?.toString()
|
||||
?: project.version.toString()
|
||||
|
||||
internal val Project.konanBuildRoot get() = buildDir.resolve("konan")
|
||||
internal val Project.konanBinBaseDir get() = konanBuildRoot.resolve("bin")
|
||||
@@ -239,7 +238,7 @@ internal fun dumpProperties(task: Task) {
|
||||
println("target : $target")
|
||||
println("languageVersion : $languageVersion")
|
||||
println("apiVersion : $apiVersion")
|
||||
println("konanVersion : ${CompilerVersion.CURRENT}")
|
||||
println("konanVersion : ${KotlinVersion.CURRENT}")
|
||||
println("konanHome : $konanHome")
|
||||
println()
|
||||
}
|
||||
@@ -260,7 +259,7 @@ internal fun dumpProperties(task: Task) {
|
||||
println("linkerOpts : $linkerOpts")
|
||||
println("headers : ${headers.dump()}")
|
||||
println("linkFiles : ${linkFiles.dump()}")
|
||||
println("konanVersion : ${CompilerVersion.CURRENT}")
|
||||
println("konanVersion : ${KotlinVersion.CURRENT}")
|
||||
println("konanHome : $konanHome")
|
||||
println()
|
||||
}
|
||||
|
||||
-3
@@ -44,9 +44,6 @@ abstract class KonanBuildingTask: KonanArtifactWithLibrariesTask(), KonanBuildin
|
||||
val konanHome
|
||||
@Input get() = project.konanHome
|
||||
|
||||
val konanVersion
|
||||
@Input get() = project.konanVersion.toString(true, true)
|
||||
|
||||
@TaskAction
|
||||
abstract fun run()
|
||||
|
||||
|
||||
+3
-5
@@ -36,7 +36,8 @@ open class KonanCompilerDownloadTask : DefaultTask() {
|
||||
/**
|
||||
* If true the task will also download dependencies for targets specified by the konan.targets project extension.
|
||||
*/
|
||||
@Internal var downloadDependencies: Boolean = false
|
||||
@Internal
|
||||
var downloadDependencies: Boolean = false
|
||||
|
||||
@TaskAction
|
||||
fun downloadAndExtract() {
|
||||
@@ -48,10 +49,7 @@ open class KonanCompilerDownloadTask : DefaultTask() {
|
||||
val downloadUrlDirectory = buildString {
|
||||
append("$BASE_DOWNLOAD_URL/")
|
||||
val version = project.konanVersion
|
||||
when (version.meta) {
|
||||
MetaVersion.DEV -> append("dev/")
|
||||
else -> append("releases/")
|
||||
}
|
||||
if (version.contains("-dev-")) append("dev/") else append("releases/")
|
||||
append("$version/")
|
||||
append(project.simpleOsName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user