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