Generate proper sources jar for compiler-embeddable, fixing problem with locating embeddable compiler jar in tests, revealed by the change

KT-8487
This commit is contained in:
Ilya Chernikov
2016-01-07 12:50:54 +01:00
committed by Alexey Tsvetkov
parent 66f1f87757
commit d4a86b7f6d
2 changed files with 25 additions and 8 deletions
@@ -54,7 +54,19 @@
<build>
<testSourceDirectory>test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>generate-sources-for-shade-plugin</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
@@ -68,11 +80,6 @@
</goals>
<configuration>
<artifacts>
<artifact>
<file>${kotlin-dist}/kotlin-compiler-sources.jar</file>
<type>jar</type>
<classifier>sources</classifier>
</artifact>
<artifact>
<file>${kotlin-dist}/kotlin-compiler-javadoc.jar</file>
<type>jar</type>
@@ -110,6 +117,7 @@
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<createSourcesJar>true</createSourcesJar>
<filters>
<filter>
<artifact>*:kotlin-runtime</artifact>
@@ -189,6 +197,11 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-version}</version>
<configuration>
<systemPropertyVariables>
<compilerJar>${artifactId}-${parent.version}.jar</compilerJar>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>integration-test</id>
@@ -36,8 +36,12 @@ public class CompilerSmokeTest {
private val javaExecutable = File( File(System.getProperty("java.home"), "bin"), "java")
private val embeddableJar = File(".").listFiles { it -> it.name.startsWith("kotlin-compiler-embeddable", ignoreCase = true) && it.name.endsWith(".jar", ignoreCase = true) }?.firstOrNull()
?: throw FileNotFoundException("cannot find kotlin-compiler-embeddable*.jar in the directory " + File(".").absolutePath)
private val embeddableJar: File by lazy {
val f = File(System.getProperty("compilerJar") ?: "kotlin-compiler-embeddable.jar")
if (!f.exists())
throw FileNotFoundException("cannot find kotlin-compiler-embeddable.jar ($f)")
f
}
@Test
fun testSmoke() {