Fixes after review
This commit is contained in:
committed by
Vyacheslav Gerasimov
parent
14e586d5a5
commit
058ef31d7a
+4
-5
@@ -80,8 +80,8 @@ dependencies {
|
||||
}
|
||||
|
||||
val commonBuildDir = File(rootDir, "build")
|
||||
val distDir = "$rootDir/dist"
|
||||
val distKotlinHomeDir = "$distDir/kotlinc"
|
||||
val distDir by extra("$rootDir/dist")
|
||||
val distKotlinHomeDir by extra("$distDir/kotlinc")
|
||||
val distLibDir = "$distKotlinHomeDir/lib"
|
||||
val commonLocalDataDir = "$rootDir/local"
|
||||
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
|
||||
@@ -89,8 +89,7 @@ val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
|
||||
val ideaPluginDir = "$distDir/artifacts/ideaPlugin/Kotlin"
|
||||
val ideaUltimatePluginDir = "$distDir/artifacts/ideaUltimatePlugin/Kotlin"
|
||||
|
||||
extra["distDir"] = distDir
|
||||
extra["distKotlinHomeDir"] = distKotlinHomeDir
|
||||
// TODO: use "by extra()" syntax where possible
|
||||
extra["distLibDir"] = project.file(distLibDir)
|
||||
extra["libsDir"] = project.file(distLibDir)
|
||||
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
|
||||
@@ -139,7 +138,7 @@ extra["versions.jflex"] = "1.7.0"
|
||||
val markdownVer = "4054 - Kotlin 1.0.2-dev-566".replace(" ", "%20") // fixed here, was last with "status:SUCCESS,tag:forKotlin"
|
||||
extra["markdownParserRepo"] = "https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJMarkdownParser_Build/$markdownVer/([artifact]_[ext]/)[artifact](.[ext])"
|
||||
|
||||
fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty("intellijUltimateEnabled")?.let {
|
||||
fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)?.let {
|
||||
val v = it.toString()
|
||||
if (v.isBlank()) true
|
||||
else v.toBoolean()
|
||||
|
||||
@@ -51,7 +51,6 @@ extra["intellijRepo"] = "https://www.jetbrains.com/intellij-repository"
|
||||
extra["intellijReleaseType"] = "releases" // or "snapshots"
|
||||
extra["versions.androidDxSources"] = "5.0.0_r2"
|
||||
|
||||
extra["customDepsRepo"] = "$rootDir/repo"
|
||||
extra["customDepsOrg"] = "kotlin.build.custom.deps"
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -12,8 +12,8 @@ val intellijUltimateEnabled: Boolean by rootProject.extra
|
||||
val intellijRepo: String by rootProject.extra
|
||||
val intellijReleaseType: String by rootProject.extra
|
||||
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
|
||||
val androidStudioRelease = if (rootProject.extra.has("versions.androidStudioRelease")) rootProject.extra["versions.androidStudioRelease"] as String else null
|
||||
val androidStudioBuild = if (rootProject.extra.has("versions.androidStudioBuild")) rootProject.extra["versions.androidStudioBuild"] as String else null
|
||||
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
|
||||
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
|
||||
val intellijSeparateSdks: Boolean by rootProject.extra
|
||||
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
|
||||
val installIntellijUltimate = intellijUltimateEnabled
|
||||
|
||||
@@ -69,7 +69,6 @@ val protobufLiteTask = "$protobufLiteProject:prepare"
|
||||
|
||||
fun DependencyHandler.protobufFull(): ProjectDependency =
|
||||
project(protobufRelocatedProject, configuration = "default").apply { isTransitive = false }
|
||||
val protobufFullTask = "$protobufLiteProject:prepare"
|
||||
|
||||
fun File.matchMaybeVersionedArtifact(baseName: String) = name.matches(baseName.toMaybeVersionedJarRegex())
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ projectTest {
|
||||
workingDir = rootDir
|
||||
systemProperty("kotlin.test.script.classpath", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
|
||||
doFirst {
|
||||
systemProperty("ant.classpath", antLauncherJar.asPath)
|
||||
systemProperty("ant.launcher.class", "org.apache.tools.ant.Main")
|
||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +527,9 @@ class KotlinCoreEnvironment private constructor(
|
||||
?: PathUtil.getResourcePathForClass(this::class.java).takeIf { it.hasConfigFile(configFilePath) }
|
||||
// hack for load extensions when compiler run directly from project directory (e.g. in tests)
|
||||
?: File("compiler/cli/src").takeIf { it.hasConfigFile(configFilePath) }
|
||||
?: throw IllegalStateException("Unable to find extension point configuration $configFilePath (cp:\n ${(Thread.currentThread().contextClassLoader as? UrlClassLoader)?.urls?.joinToString("\n ") { it.file }})")
|
||||
?: throw IllegalStateException(
|
||||
"Unable to find extension point configuration $configFilePath " +
|
||||
"(cp:\n ${(Thread.currentThread().contextClassLoader as? UrlClassLoader)?.urls?.joinToString("\n ") { it.file }})")
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginRoot, configFilePath, Extensions.getRootArea())
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<project name="KotlinLexer" default="lexer">
|
||||
<property name="home" value="${basedir}"/>
|
||||
<property name="builddir" value="${basedir}/build"/>
|
||||
<property name="flex.classpath" value="${home}/../../dependencies/jflex/JFlex.jar"/>
|
||||
<property name="flex.classpath" value=""/>
|
||||
<property name="out.dir" value="${builddir}/tmpout"/>
|
||||
|
||||
<macrodef name="flex">
|
||||
|
||||
+4
-4
@@ -25,14 +25,14 @@ public abstract class AbstractAntTaskTest extends KotlinIntegrationTestBase {
|
||||
protected void doTest(String testFile) throws Exception {
|
||||
String testDataDir = new File(testFile).getAbsolutePath();
|
||||
|
||||
String antClasspath = System.getProperty("ant.classpath");
|
||||
String antClasspath = System.getProperty("kotlin.ant.classpath");
|
||||
if (antClasspath == null) {
|
||||
throw new RuntimeException("Unable to get a valid classpath from 'ant.classpath' property, please set it accordingly");
|
||||
throw new RuntimeException("Unable to get a valid classpath from 'kotlin.ant.classpath' property, please set it accordingly");
|
||||
}
|
||||
|
||||
String antLauncherClass = System.getProperty("ant.launcher.class");
|
||||
String antLauncherClass = System.getProperty("kotlin.ant.launcher.class");
|
||||
if (antLauncherClass == null) {
|
||||
throw new RuntimeException("Unable to get a valid class FQN from 'ant.launcher.class' property, please set it accordingly");
|
||||
throw new RuntimeException("Unable to get a valid class FQN from 'kotlin.ant.launcher.class' property, please set it accordingly");
|
||||
}
|
||||
|
||||
runJava(
|
||||
|
||||
@@ -97,7 +97,6 @@ val extractAndroidJar by tasks.creating {
|
||||
inputs.files(androidPlatform)
|
||||
val targetFile = File(libsDestDir, "android.jar")
|
||||
outputs.files(targetFile)
|
||||
outputs.upToDateWhen { targetFile.exists() } // TODO: consider more precise check, e.g. hash-based
|
||||
doFirst {
|
||||
project.copy {
|
||||
from(zipTree(androidPlatform.singleFile).matching { include("**/android.jar") }.files.first())
|
||||
|
||||
@@ -21,10 +21,7 @@ dependencies {
|
||||
}
|
||||
|
||||
task("prepare") {
|
||||
// TODO: find out why it doesn't work without explicit dependsOn
|
||||
dependsOn(":custom-dependencies:protobuf-relocated:prepare")
|
||||
val inputJar = relocatedProtobuf.files.single()
|
||||
inputs.files(inputJar)
|
||||
inputs.files(relocatedProtobuf) // this also adds a dependency
|
||||
outputs.file(outputJarPath)
|
||||
doFirst {
|
||||
File(outputJarPath).parentFile.mkdirs()
|
||||
@@ -49,7 +46,7 @@ task("prepare") {
|
||||
return result
|
||||
}
|
||||
|
||||
val allFiles = loadAllFromJar(File(inputJar))
|
||||
val allFiles = loadAllFromJar(File(relocatedProtobuf.singleFile))
|
||||
|
||||
val keepClasses = arrayListOf<String>()
|
||||
|
||||
|
||||
@@ -58,8 +58,10 @@ afterEvaluate {
|
||||
"-Dapple.laf.useScreenMenuBar=true",
|
||||
"-Dapple.awt.graphics.UseQuartz=true",
|
||||
"-Dsun.io.useCanonCaches=false",
|
||||
"-Dkotlin.internal.mode.enabled=true",
|
||||
"-Didea.ProcessCanceledException=disabled"
|
||||
"-Dkotlin.internal.mode.enabled=true"
|
||||
)
|
||||
if (project.hasProperty("noPCE")) {
|
||||
jvmArgs("-Didea.ProcessCanceledException=disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-19
@@ -1,22 +1,6 @@
|
||||
|
||||
apply { plugin("kotlin") }
|
||||
|
||||
val usedIntellijPlugins = arrayOf(
|
||||
"properties",
|
||||
"gradle",
|
||||
"Groovy",
|
||||
"coverage",
|
||||
"maven",
|
||||
"android",
|
||||
"junit",
|
||||
"testng",
|
||||
"IntelliLang",
|
||||
"testng",
|
||||
"copyright",
|
||||
"properties",
|
||||
"java-i18n",
|
||||
"java-decompiler")
|
||||
|
||||
dependencies {
|
||||
testRuntime(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
testRuntime(intellijDep())
|
||||
@@ -41,9 +25,20 @@ dependencies {
|
||||
testRuntime(project(":sam-with-receiver-ide-plugin"))
|
||||
testRuntime(project(":allopen-ide-plugin"))
|
||||
testRuntime(project(":noarg-ide-plugin"))
|
||||
usedIntellijPlugins.forEach {
|
||||
testRuntime(intellijPluginDep(it))
|
||||
}
|
||||
testRuntime(intellijPluginDep("properties"))
|
||||
testRuntime(intellijPluginDep("gradle"))
|
||||
testRuntime(intellijPluginDep("Groovy"))
|
||||
testRuntime(intellijPluginDep("coverage"))
|
||||
testRuntime(intellijPluginDep("maven"))
|
||||
testRuntime(intellijPluginDep("android"))
|
||||
testRuntime(intellijPluginDep("junit"))
|
||||
testRuntime(intellijPluginDep("testng"))
|
||||
testRuntime(intellijPluginDep("IntelliLang"))
|
||||
testRuntime(intellijPluginDep("testng"))
|
||||
testRuntime(intellijPluginDep("copyright"))
|
||||
testRuntime(intellijPluginDep("properties"))
|
||||
testRuntime(intellijPluginDep("java-i18n"))
|
||||
testRuntime(intellijPluginDep("java-decompiler"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -62,8 +62,8 @@ projectTest {
|
||||
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
||||
workingDir = rootDir
|
||||
doFirst {
|
||||
systemProperty("ant.classpath", antLauncherJar.asPath)
|
||||
systemProperty("ant.launcher.class", "org.apache.tools.ant.Main")
|
||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ projectTest("quickTest") {
|
||||
workingDir = rootDir
|
||||
systemProperty("kotlin.js.skipMinificationTest", "true")
|
||||
doFirst {
|
||||
systemProperty("ant.classpath", antLauncherJar.asPath)
|
||||
systemProperty("ant.launcher.class", "org.apache.tools.ant.Main")
|
||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ class KotlinAndroidJpsPlugin : KotlinJpsCompilerArgumentsProvider {
|
||||
val module = moduleBuildTarget.module
|
||||
if (!hasAndroidJpsPlugin() || !isAndroidModuleWithoutGradle(module)) return emptyList()
|
||||
|
||||
val inJar = File(PathUtil.getJarPathForClass(this::class.java)).isFile
|
||||
val manifestFile = getAndroidManifest(moduleBuildTarget.module)
|
||||
|
||||
return if (manifestFile != null) {
|
||||
@@ -74,7 +73,7 @@ class KotlinAndroidJpsPlugin : KotlinJpsCompilerArgumentsProvider {
|
||||
compilerPluginJar = File("dist/kotlinc/lib/$JAR_FILE_NAME")
|
||||
} else {
|
||||
// Inside Kotlin/jps directory (Kotlin plugin)
|
||||
val libDirectory = File(PathUtil.getJarPathForClass(this::class.java)).parentFile.parentFile
|
||||
val libDirectory = jpsPluginJar.parentFile.parentFile
|
||||
compilerPluginJar = File(libDirectory, JAR_FILE_NAME)
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ val packCompiler by task<ShadowJar> {
|
||||
configurations = listOf(fatJar)
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
destinationDir = File(buildDir, "libs")
|
||||
dependsOn(protobufFullTask)
|
||||
|
||||
setupPublicJar("before-proguard")
|
||||
from(fatJarContents)
|
||||
|
||||
Reference in New Issue
Block a user