Switch ant usages to regular dependency

This commit is contained in:
Ilya Chernikov
2017-11-13 13:22:56 +01:00
committed by Vyacheslav Gerasimov
parent 486c3a2aff
commit 361d8536ac
5 changed files with 36 additions and 11 deletions
+1
View File
@@ -127,6 +127,7 @@ extra["versions.kotlinx-coroutines-core"] = "0.14.1"
extra["versions.kotlinx-coroutines-jdk8"] = "0.14.1"
extra["versions.json"] = "20160807"
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"
extra["markdownParserRepo"] = "https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJMarkdownParser_Build/$markdownVer/([artifact]_[ext]/)[artifact](.[ext])"
+10 -2
View File
@@ -41,6 +41,7 @@ val testDistProjects = listOf(
)
val testJvm6ServerRuntime by configurations.creating
val antLauncherJar by configurations.creating
dependencies {
depDistProjects.forEach {
@@ -62,16 +63,19 @@ dependencies {
testRuntime(projectDist(":kotlin-reflect"))
testRuntime(projectDist(":kotlin-daemon-client"))
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"))
antLauncherJar(commonDep("org.apache.ant", "ant"))
antLauncherJar(files(toolsJar()))
}
afterEvaluate {
dependencies {
testCompile(intellij { include("openapi.jar", "idea.jar", "util.jar", "asm-all.jar", "commons-httpclient-3.1-patched.jar") })
testRuntime(intellijCoreJar())
testRuntime(intellij())
testRuntime(intellijCoreJar())
}
}
@@ -88,6 +92,10 @@ projectTest {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
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")
}
}
fun Project.codegenTest(target: Int, jvm: Int,
@@ -25,11 +25,20 @@ 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");
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(
testDataDir,
"build.log",
"-Xmx192m",
"-jar", getAntHome() + File.separator + "lib" + File.separator + "ant-launcher.jar",
"-Dkotlin.lib=" + KotlinIntegrationTestBase.getCompilerLib(),
"-Dkotlin.runtime.jar=" + ForTestCompileRuntime.runtimeJarForTests().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(),
"-Dtest.data=" + testDataDir,
"-Dtemp=" + tmpdir,
"-cp", antClasspath,
antLauncherClass,
"-f", "build.xml"
);
}
@@ -49,9 +60,4 @@ public abstract class AbstractAntTaskTest extends KotlinIntegrationTestBase {
return super.normalizeOutput(testDataDir, content)
.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";
}
}
+13
View File
@@ -14,6 +14,8 @@ apply { plugin("kotlin") }
configureIntellijPlugin()
val antLauncherJar by configurations.creating
dependencies {
testCompile(protobufFull())
testCompile(projectTests(":compiler:tests-common"))
@@ -33,6 +35,9 @@ dependencies {
testRuntime(projectDist(":kotlin-preloader")) // it's required for ant tests
testRuntime(project(":compiler:backend-common"))
testRuntime(commonDep("org.fusesource.jansi", "jansi"))
antLauncherJar(commonDep("org.apache.ant", "ant"))
antLauncherJar(files(toolsJar()))
}
afterEvaluate {
@@ -59,6 +64,10 @@ val testDistProjects = listOf(
projectTest {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
workingDir = rootDir
doFirst {
systemProperty("ant.classpath", antLauncherJar.asPath)
systemProperty("ant.launcher.class", "org.apache.tools.ant.Main")
}
}
testsJar {}
@@ -67,6 +76,10 @@ projectTest("quickTest") {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
workingDir = rootDir
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")
-3
View File
@@ -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"/>
<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 -->
<property name="android-build-tools.zip" value="build-tools_r21.1.1-linux.zip"/>
<get