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:
committed by
Alexey Tsvetkov
parent
66f1f87757
commit
d4a86b7f6d
@@ -54,7 +54,19 @@
|
|||||||
<build>
|
<build>
|
||||||
<testSourceDirectory>test/kotlin</testSourceDirectory>
|
<testSourceDirectory>test/kotlin</testSourceDirectory>
|
||||||
<plugins>
|
<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>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
@@ -68,11 +80,6 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<artifacts>
|
<artifacts>
|
||||||
<artifact>
|
|
||||||
<file>${kotlin-dist}/kotlin-compiler-sources.jar</file>
|
|
||||||
<type>jar</type>
|
|
||||||
<classifier>sources</classifier>
|
|
||||||
</artifact>
|
|
||||||
<artifact>
|
<artifact>
|
||||||
<file>${kotlin-dist}/kotlin-compiler-javadoc.jar</file>
|
<file>${kotlin-dist}/kotlin-compiler-javadoc.jar</file>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
@@ -110,6 +117,7 @@
|
|||||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
||||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||||
<createDependencyReducedPom>true</createDependencyReducedPom>
|
<createDependencyReducedPom>true</createDependencyReducedPom>
|
||||||
|
<createSourcesJar>true</createSourcesJar>
|
||||||
<filters>
|
<filters>
|
||||||
<filter>
|
<filter>
|
||||||
<artifact>*:kotlin-runtime</artifact>
|
<artifact>*:kotlin-runtime</artifact>
|
||||||
@@ -189,6 +197,11 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>${surefire-version}</version>
|
<version>${surefire-version}</version>
|
||||||
|
<configuration>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<compilerJar>${artifactId}-${parent.version}.jar</compilerJar>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>integration-test</id>
|
<id>integration-test</id>
|
||||||
|
|||||||
+6
-2
@@ -36,8 +36,12 @@ public class CompilerSmokeTest {
|
|||||||
|
|
||||||
private val javaExecutable = File( File(System.getProperty("java.home"), "bin"), "java")
|
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()
|
private val embeddableJar: File by lazy {
|
||||||
?: throw FileNotFoundException("cannot find kotlin-compiler-embeddable*.jar in the directory " + File(".").absolutePath)
|
val f = File(System.getProperty("compilerJar") ?: "kotlin-compiler-embeddable.jar")
|
||||||
|
if (!f.exists())
|
||||||
|
throw FileNotFoundException("cannot find kotlin-compiler-embeddable.jar ($f)")
|
||||||
|
f
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testSmoke() {
|
fun testSmoke() {
|
||||||
|
|||||||
Reference in New Issue
Block a user