Setup project versions
Build parameters (with corresponding project properties): - build.number (buildNumber) - build number from build server, goes into manifest, by default snapshot - deployVersion (kotlinVersion, project.version) - version of artifacts, by default build.number - bootstrap.kotlin.version (bootstrapKotlinVersion) - version of bootstrap compiler
This commit is contained in:
committed by
Ilya Chernikov
parent
df04efcf14
commit
678caa5676
+18
-16
@@ -12,9 +12,8 @@ buildscript {
|
||||
"https://plugins.gradle.org/m2",
|
||||
"http://repository.jetbrains.com/utils/").filterNotNull()
|
||||
|
||||
extra["kotlin_version"] = bootstrapKotlinVersion
|
||||
extra["kotlinVersion"] = bootstrapKotlinVersion
|
||||
extra["kotlin_language_version"] = "1.1"
|
||||
extra["bootstrapKotlinVersion"] = bootstrapKotlinVersion
|
||||
|
||||
extra["repos"] = repos
|
||||
|
||||
extra["versions.shadow"] = "2.0.1"
|
||||
@@ -47,8 +46,16 @@ val configuredJdks: List<JdkId> =
|
||||
}
|
||||
}
|
||||
|
||||
val buildNumber = "1.1-SNAPSHOT"
|
||||
extra["build.number"] = buildNumber
|
||||
val defaultSnapshotVersion = "1.1-SNAPSHOT"
|
||||
val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion)
|
||||
val kotlinVersion by extra(findProperty("deployVersion")?.toString() ?: buildNumber)
|
||||
|
||||
val kotlinLanguageVersion by extra("1.1")
|
||||
|
||||
allprojects {
|
||||
group = "org.jetbrains.kotlin"
|
||||
version = kotlinVersion
|
||||
}
|
||||
|
||||
extra["kotlin_root"] = rootDir
|
||||
|
||||
@@ -165,11 +172,6 @@ val gradlePluginProjects = listOf(
|
||||
":kotlin-sam-with-receiver"
|
||||
)
|
||||
|
||||
allprojects {
|
||||
group = "org.jetbrains.kotlin"
|
||||
version = buildNumber
|
||||
}
|
||||
|
||||
apply {
|
||||
from("libraries/commonConfiguration.gradle")
|
||||
from("libraries/gradlePluginsConfiguration.gradle")
|
||||
@@ -230,12 +232,12 @@ allprojects {
|
||||
}
|
||||
configureJvmProject(javaHome!!, jvmTarget!!)
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-Xallow-kotlin-package")
|
||||
}
|
||||
|
||||
tasks.withType<Kotlin2JsCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-Xallow-kotlin-package")
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||
kotlinOptions {
|
||||
languageVersion = kotlinLanguageVersion
|
||||
apiVersion = kotlinLanguageVersion
|
||||
freeCompilerArgs = listOf("-Xallow-kotlin-package")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
|
||||
@@ -38,7 +38,7 @@ fun Jar.setupRuntimeJar(implementationTitle: String): Unit {
|
||||
put("Built-By", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Title", implementationTitle)
|
||||
put("Implementation-Version", project.rootProject.extra["build.number"])
|
||||
put("Implementation-Version", project.rootProject.extra["buildNumber"])
|
||||
}
|
||||
// from(project.configurations.getByName("build-version").files, action = { into("META-INF/") })
|
||||
}
|
||||
|
||||
@@ -130,15 +130,16 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
|
||||
}
|
||||
|
||||
fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit): Copy {
|
||||
val thisProject = this
|
||||
val pluginTask = task<Copy>("ideaPlugin") {
|
||||
body()
|
||||
into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path)
|
||||
rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "")
|
||||
rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "")
|
||||
}
|
||||
|
||||
task("idea-plugin") {
|
||||
dependsOn(pluginTask)
|
||||
}
|
||||
}
|
||||
|
||||
return pluginTask
|
||||
}
|
||||
@@ -156,6 +157,7 @@ fun Project.dist(targetDir: File? = null,
|
||||
val distJarCfg = configurations.getOrCreate("distJar")
|
||||
val distLibDir: File by rootProject.extra
|
||||
val distJarName = targetName ?: (the<BasePluginConvention>().archivesBaseName + ".jar")
|
||||
val thisProject = this
|
||||
|
||||
return task<Copy>("dist") {
|
||||
body()
|
||||
@@ -165,7 +167,7 @@ fun Project.dist(targetDir: File? = null,
|
||||
rename(it.outputs.files.singleFile.name, targetName)
|
||||
}
|
||||
}
|
||||
rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "")
|
||||
rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "")
|
||||
into(targetDir ?: distLibDir)
|
||||
project.addArtifact(distJarCfg, this, File(targetDir ?: distLibDir, distJarName))
|
||||
}
|
||||
@@ -185,7 +187,7 @@ fun Jar.setupPublicJar(classifier: String = "", classifierDescr: String? = null)
|
||||
put("Built-By", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Title", "${project.description} ${classifierDescr ?: classifier}".trim())
|
||||
put("Implementation-Version", project.rootProject.extra["build.number"])
|
||||
put("Implementation-Version", project.rootProject.extra["buildNumber"])
|
||||
}
|
||||
// from(project.configurations.getByName("build-version").files, action = { into("META-INF/") })
|
||||
}
|
||||
|
||||
@@ -77,13 +77,13 @@ ext.manifestAttributes = { Manifest manifest, Project project, String component
|
||||
attributes \
|
||||
'Implementation-Vendor': 'JetBrains',
|
||||
'Implementation-Title': project.archivesBaseName,
|
||||
'Implementation-Version': project.version,
|
||||
'Implementation-Version': project.buildNumber,
|
||||
'Build-Jdk': System.getProperty('java.version')
|
||||
|
||||
if (component != null) {
|
||||
attributes \
|
||||
'Kotlin-Runtime-Component': component,
|
||||
'Kotlin-Version': project.kotlin_language_version
|
||||
'Kotlin-Version': project.kotlinLanguageVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project
|
||||
}
|
||||
|
||||
publishPlugins.doFirst {
|
||||
assert !kotlin_version.contains('SNAPSHOT')
|
||||
assert !kotlinVersion.contains('SNAPSHOT')
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
|
||||
@@ -26,7 +26,7 @@ configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project
|
||||
}
|
||||
|
||||
publishPlugins.doFirst {
|
||||
assert !kotlin_version.contains('SNAPSHOT')
|
||||
assert !kotlinVersion.contains('SNAPSHOT')
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
|
||||
@@ -5,7 +5,7 @@ sourceSets {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$bootstrapKotlinVersion"
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
|
||||
@@ -3,7 +3,7 @@ description = 'Merge utility for Kotlin Standard Library for JS'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-compiler:$kotlin_version"
|
||||
compile "org.jetbrains.kotlin:kotlin-compiler:$bootstrapKotlinVersion"
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -6,7 +6,7 @@ val buildVersionFilePath = "${rootProject.extra["distDir"]}/build.txt"
|
||||
val buildVersion by configurations.creating
|
||||
|
||||
val prepare = task("prepare") {
|
||||
val versionString = rootProject.extra["build.number"].toString()
|
||||
val versionString = rootProject.extra["buildNumber"].toString()
|
||||
val versionFile = File(buildVersionFilePath)
|
||||
outputs.file(buildVersionFilePath)
|
||||
outputs.upToDateWhen {
|
||||
|
||||
Reference in New Issue
Block a user