Switch ant usages to regular dependency
This commit is contained in:
committed by
Vyacheslav Gerasimov
parent
486c3a2aff
commit
361d8536ac
@@ -127,6 +127,7 @@ extra["versions.kotlinx-coroutines-core"] = "0.14.1"
|
|||||||
extra["versions.kotlinx-coroutines-jdk8"] = "0.14.1"
|
extra["versions.kotlinx-coroutines-jdk8"] = "0.14.1"
|
||||||
extra["versions.json"] = "20160807"
|
extra["versions.json"] = "20160807"
|
||||||
extra["versions.native-platform"] = "0.14"
|
extra["versions.native-platform"] = "0.14"
|
||||||
|
extra["versions.ant-launcher"] = "1.8.0"
|
||||||
|
|
||||||
val markdownVer = "4054 - Kotlin 1.0.2-dev-566".replace(" ", "%20") // fixed here, was last with "status:SUCCESS,tag:forKotlin"
|
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])"
|
extra["markdownParserRepo"] = "https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJMarkdownParser_Build/$markdownVer/([artifact]_[ext]/)[artifact](.[ext])"
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ val testDistProjects = listOf(
|
|||||||
)
|
)
|
||||||
|
|
||||||
val testJvm6ServerRuntime by configurations.creating
|
val testJvm6ServerRuntime by configurations.creating
|
||||||
|
val antLauncherJar by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
depDistProjects.forEach {
|
depDistProjects.forEach {
|
||||||
@@ -62,16 +63,19 @@ dependencies {
|
|||||||
testRuntime(projectDist(":kotlin-reflect"))
|
testRuntime(projectDist(":kotlin-reflect"))
|
||||||
testRuntime(projectDist(":kotlin-daemon-client"))
|
testRuntime(projectDist(":kotlin-daemon-client"))
|
||||||
testRuntime(preloadedDeps("dx", subdir = "android-5.0/lib"))
|
testRuntime(preloadedDeps("dx", subdir = "android-5.0/lib"))
|
||||||
testRuntime(files("${System.getProperty("java.home")}/../lib/tools.jar"))
|
testRuntime(files(toolsJar()))
|
||||||
|
|
||||||
testJvm6ServerRuntime(projectTests(":compiler:tests-common-jvm6"))
|
testJvm6ServerRuntime(projectTests(":compiler:tests-common-jvm6"))
|
||||||
|
|
||||||
|
antLauncherJar(commonDep("org.apache.ant", "ant"))
|
||||||
|
antLauncherJar(files(toolsJar()))
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(intellij { include("openapi.jar", "idea.jar", "util.jar", "asm-all.jar", "commons-httpclient-3.1-patched.jar") })
|
testCompile(intellij { include("openapi.jar", "idea.jar", "util.jar", "asm-all.jar", "commons-httpclient-3.1-patched.jar") })
|
||||||
testRuntime(intellijCoreJar())
|
|
||||||
testRuntime(intellij())
|
testRuntime(intellij())
|
||||||
|
testRuntime(intellijCoreJar())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,6 +92,10 @@ projectTest {
|
|||||||
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
systemProperty("kotlin.test.script.classpath", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
|
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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.codegenTest(target: Int, jvm: Int,
|
fun Project.codegenTest(target: Int, jvm: Int,
|
||||||
|
|||||||
+12
-6
@@ -25,11 +25,20 @@ public abstract class AbstractAntTaskTest extends KotlinIntegrationTestBase {
|
|||||||
protected void doTest(String testFile) throws Exception {
|
protected void doTest(String testFile) throws Exception {
|
||||||
String testDataDir = new File(testFile).getAbsolutePath();
|
String testDataDir = new File(testFile).getAbsolutePath();
|
||||||
|
|
||||||
|
String antClasspath = System.getProperty("ant.classpath");
|
||||||
|
if (antClasspath == null) {
|
||||||
|
throw new RuntimeException("Unable to get a valid classpath from 'ant.classpath' property, please set it accordingly");
|
||||||
|
}
|
||||||
|
|
||||||
|
String antLauncherClass = System.getProperty("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");
|
||||||
|
}
|
||||||
|
|
||||||
runJava(
|
runJava(
|
||||||
testDataDir,
|
testDataDir,
|
||||||
"build.log",
|
"build.log",
|
||||||
"-Xmx192m",
|
"-Xmx192m",
|
||||||
"-jar", getAntHome() + File.separator + "lib" + File.separator + "ant-launcher.jar",
|
|
||||||
"-Dkotlin.lib=" + KotlinIntegrationTestBase.getCompilerLib(),
|
"-Dkotlin.lib=" + KotlinIntegrationTestBase.getCompilerLib(),
|
||||||
"-Dkotlin.runtime.jar=" + ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath(),
|
"-Dkotlin.runtime.jar=" + ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath(),
|
||||||
"-Dkotlin.reflect.jar=" + ForTestCompileRuntime.reflectJarForTests().getAbsolutePath(),
|
"-Dkotlin.reflect.jar=" + ForTestCompileRuntime.reflectJarForTests().getAbsolutePath(),
|
||||||
@@ -39,6 +48,8 @@ public abstract class AbstractAntTaskTest extends KotlinIntegrationTestBase {
|
|||||||
"-Dkotlin.stdlib.jdk8.jar=" + new File("dist/kotlinc/lib/kotlin-stdlib-jdk8.jar").getAbsolutePath(),
|
"-Dkotlin.stdlib.jdk8.jar=" + new File("dist/kotlinc/lib/kotlin-stdlib-jdk8.jar").getAbsolutePath(),
|
||||||
"-Dtest.data=" + testDataDir,
|
"-Dtest.data=" + testDataDir,
|
||||||
"-Dtemp=" + tmpdir,
|
"-Dtemp=" + tmpdir,
|
||||||
|
"-cp", antClasspath,
|
||||||
|
antLauncherClass,
|
||||||
"-f", "build.xml"
|
"-f", "build.xml"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -49,9 +60,4 @@ public abstract class AbstractAntTaskTest extends KotlinIntegrationTestBase {
|
|||||||
return super.normalizeOutput(testDataDir, content)
|
return super.normalizeOutput(testDataDir, content)
|
||||||
.replaceAll("Total time: .+\n", "Total time: [time]\n");
|
.replaceAll("Total time: .+\n", "Total time: [time]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private static String getAntHome() {
|
|
||||||
return KotlinIntegrationTestBase.getKotlinProjectHome().getAbsolutePath() + File.separator + "dependencies" + File.separator + "ant-1.8";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ apply { plugin("kotlin") }
|
|||||||
|
|
||||||
configureIntellijPlugin()
|
configureIntellijPlugin()
|
||||||
|
|
||||||
|
val antLauncherJar by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(protobufFull())
|
testCompile(protobufFull())
|
||||||
testCompile(projectTests(":compiler:tests-common"))
|
testCompile(projectTests(":compiler:tests-common"))
|
||||||
@@ -33,6 +35,9 @@ dependencies {
|
|||||||
testRuntime(projectDist(":kotlin-preloader")) // it's required for ant tests
|
testRuntime(projectDist(":kotlin-preloader")) // it's required for ant tests
|
||||||
testRuntime(project(":compiler:backend-common"))
|
testRuntime(project(":compiler:backend-common"))
|
||||||
testRuntime(commonDep("org.fusesource.jansi", "jansi"))
|
testRuntime(commonDep("org.fusesource.jansi", "jansi"))
|
||||||
|
|
||||||
|
antLauncherJar(commonDep("org.apache.ant", "ant"))
|
||||||
|
antLauncherJar(files(toolsJar()))
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
@@ -59,6 +64,10 @@ val testDistProjects = listOf(
|
|||||||
projectTest {
|
projectTest {
|
||||||
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
|
doFirst {
|
||||||
|
systemProperty("ant.classpath", antLauncherJar.asPath)
|
||||||
|
systemProperty("ant.launcher.class", "org.apache.tools.ant.Main")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
testsJar {}
|
testsJar {}
|
||||||
@@ -67,6 +76,10 @@ projectTest("quickTest") {
|
|||||||
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
systemProperty("kotlin.js.skipMinificationTest", "true")
|
systemProperty("kotlin.js.skipMinificationTest", "true")
|
||||||
|
doFirst {
|
||||||
|
systemProperty("ant.classpath", antLauncherJar.asPath)
|
||||||
|
systemProperty("ant.launcher.class", "org.apache.tools.ant.Main")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt")
|
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt")
|
||||||
|
|||||||
@@ -124,9 +124,6 @@
|
|||||||
<get src="http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jarjar/jarjar-1.4.jar" dest="${dependencies}/download/jarjar-1.4.jar" usetimestamp="true"/>
|
<get src="http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jarjar/jarjar-1.4.jar" dest="${dependencies}/download/jarjar-1.4.jar" usetimestamp="true"/>
|
||||||
<copy file="${dependencies}/download/jarjar-1.4.jar" tofile="${dependencies}/jarjar.jar" overwrite="true"/>
|
<copy file="${dependencies}/download/jarjar-1.4.jar" tofile="${dependencies}/jarjar.jar" overwrite="true"/>
|
||||||
|
|
||||||
<!-- ant 1.8.2 -->
|
|
||||||
<get-ant-library version="1.8.2" folderName="ant-1.8"/>
|
|
||||||
|
|
||||||
<!-- dx.jar -->
|
<!-- dx.jar -->
|
||||||
<property name="android-build-tools.zip" value="build-tools_r21.1.1-linux.zip"/>
|
<property name="android-build-tools.zip" value="build-tools_r21.1.1-linux.zip"/>
|
||||||
<get
|
<get
|
||||||
|
|||||||
Reference in New Issue
Block a user