Switch to 181 platform

This commit is contained in:
Vyacheslav Gerasimov
2018-04-27 18:25:17 +03:00
parent df59af8ee8
commit bc403ce744
673 changed files with 25853 additions and 922 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ dependencies {
fatJarContents(intellijDep()) { includeIntellijCoreJarDependencies(project, { !(it.startsWith("jdom") || it.startsWith("log4j")) }) }
fatJarContents(intellijDep()) { includeJars("jna-platform") }
fatJarContentsStripServices(intellijDep("jps-standalone")) { includeJars("jps-model") }
fatJarContentsStripMetadata(intellijDep()) { includeJars("oromatcher", "jdom", "log4j") }
fatJarContentsStripMetadata(intellijDep()) { includeJars("oro-2.0.8", "jdom", "log4j") }
}
+132
View File
@@ -0,0 +1,132 @@
import java.io.File
import proguard.gradle.ProGuardTask
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.file.DuplicatesStrategy
description = "Kotlin Compiler"
plugins {
`java`
}
// You can run Gradle with "-Pkotlin.build.proguard=true" to enable ProGuard run on kotlin-compiler.jar (on TeamCity, ProGuard always runs)
val shrink =
findProperty("kotlin.build.proguard")?.toString()?.toBoolean()
?: hasProperty("teamcity")
val compilerManifestClassPath =
"kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar"
val fatJarContents by configurations.creating
val fatJarContentsStripMetadata by configurations.creating
val fatJarContentsStripServices by configurations.creating
val fatSourcesJarContents by configurations.creating
val proguardLibraryJars by configurations.creating
val fatJar by configurations.creating
val compilerJar by configurations.creating
val archives by configurations
val compile by configurations
val compilerBaseName = name
val outputJar = File(buildDir, "libs", "$compilerBaseName.jar")
val compilerModules: Array<String> by rootProject.extra
compilerModules.forEach { evaluationDependsOn(it) }
val compiledModulesSources = compilerModules.map {
project(it).the<JavaPluginConvention>().sourceSets.getByName("main").allSource
}
dependencies {
compilerModules.forEach {
fatJarContents(project(it)) { isTransitive = false }
}
compiledModulesSources.forEach {
fatSourcesJarContents(it)
}
fatJarContents(project(":core:builtins", configuration = "builtins"))
fatJarContents(commonDep("javax.inject"))
fatJarContents(commonDep("org.jline", "jline"))
fatJarContents(commonDep("org.fusesource.jansi", "jansi"))
fatJarContents(protobufFull())
fatJarContents(commonDep("com.google.code.findbugs", "jsr305"))
fatJarContents(commonDep("io.javaslang", "javaslang"))
fatJarContents(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
proguardLibraryJars(files(firstFromJavaHomeThatExists("jre/lib/rt.jar", "../Classes/classes.jar"),
firstFromJavaHomeThatExists("jre/lib/jsse.jar", "../Classes/jsse.jar"),
toolsJar()))
proguardLibraryJars(projectDist(":kotlin-stdlib"))
proguardLibraryJars(projectDist(":kotlin-script-runtime"))
proguardLibraryJars(projectDist(":kotlin-reflect"))
proguardLibraryJars(projectDist(":kotlin-scripting-common"))
proguardLibraryJars(projectDist(":kotlin-scripting-jvm"))
compile(project(":kotlin-stdlib"))
compile(project(":kotlin-script-runtime"))
compile(project(":kotlin-reflect"))
fatJarContents(intellijCoreDep()) { includeJars("intellij-core") }
fatJarContents(intellijDep()) { includeIntellijCoreJarDependencies(project, { !(it.startsWith("jdom") || it.startsWith("log4j")) }) }
fatJarContents(intellijDep()) { includeJars("jna-platform") }
fatJarContentsStripServices(intellijDep("jps-standalone")) { includeJars("jps-model") }
fatJarContentsStripMetadata(intellijDep()) { includeJars("oromatcher", "jdom", "log4j") }
}
val packCompiler by task<ShadowJar> {
configurations = listOf(fatJar)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
destinationDir = File(buildDir, "libs")
setupPublicJar("before-proguard")
from(fatJarContents)
afterEvaluate {
fatJarContentsStripServices.files.forEach { from(zipTree(it)) { exclude("META-INF/services/**") } }
fatJarContentsStripMetadata.files.forEach { from(zipTree(it)) { exclude("META-INF/jb/** META-INF/LICENSE") } }
}
manifest.attributes.put("Class-Path", compilerManifestClassPath)
manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.cli.jvm.K2JVMCompiler")
}
val proguard by task<ProGuardTask> {
dependsOn(packCompiler)
configuration("$rootDir/compiler/compiler.pro")
val outputJar = File(buildDir, "libs", "$compilerBaseName-after-proguard.jar")
inputs.files(packCompiler.outputs.files.singleFile)
outputs.file(outputJar)
// TODO: remove after dropping compatibility with ant build
doFirst {
System.setProperty("kotlin-compiler-jar-before-shrink", packCompiler.outputs.files.singleFile.canonicalPath)
System.setProperty("kotlin-compiler-jar", outputJar.canonicalPath)
}
libraryjars(mapOf("filter" to "!META-INF/versions/**"), proguardLibraryJars)
printconfiguration("$buildDir/compiler.pro.dump")
}
noDefaultJar()
val pack = if (shrink) proguard else packCompiler
dist(targetName = compilerBaseName + ".jar",
fromTask = pack)
runtimeJarArtifactBy(pack, pack.outputs.files.singleFile) {
name = compilerBaseName
classifier = ""
}
sourcesJar {
from(fatSourcesJarContents)
}
javadocJar()
publish()