Build maven-like stdlib sources artifacts during dist
This is needed to emulate gradle and maven like projects in plugin tests.
This commit is contained in:
+10
@@ -74,11 +74,21 @@ public class ForTestCompileRuntime {
|
|||||||
return assertExists(new File("dist/kotlinc/lib/kotlin-stdlib-sources.jar"));
|
return assertExists(new File("dist/kotlinc/lib/kotlin-stdlib-sources.jar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static File stdlibMavenSourcesJarForTests() {
|
||||||
|
return assertExists(new File("dist/maven/kotlin-stdlib-sources.jar"));
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static File stdlibCommonForTests() {
|
public static File stdlibCommonForTests() {
|
||||||
return assertExists(new File("dist/common/kotlin-stdlib-common.jar"));
|
return assertExists(new File("dist/common/kotlin-stdlib-common.jar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static File stdlibCommonSourcesForTests() {
|
||||||
|
return assertExists(new File("dist/common/kotlin-stdlib-common-sources.jar"));
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static File stdlibJsForTests() {
|
public static File stdlibJsForTests() {
|
||||||
return assertExists(new File("dist/kotlinc/lib/kotlin-stdlib-js.jar"));
|
return assertExists(new File("dist/kotlinc/lib/kotlin-stdlib-js.jar"));
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ artifacts {
|
|||||||
// TODO: call the "dist" task instead, once we need to publish kotlin-stdlib-common.jar with the compiler distribution
|
// TODO: call the "dist" task instead, once we need to publish kotlin-stdlib-common.jar with the compiler distribution
|
||||||
task distCommon(type: Copy) {
|
task distCommon(type: Copy) {
|
||||||
from(jar)
|
from(jar)
|
||||||
|
from(sourcesJar)
|
||||||
into "$distDir/common"
|
into "$distDir/common"
|
||||||
rename "-${java.util.regex.Pattern.quote(version)}", ''
|
rename "-${java.util.regex.Pattern.quote(version)}", ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,17 +116,26 @@ task distSourcesJar(type: Jar) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task distMavenSources(type: Copy) {
|
||||||
|
from(sourcesJar)
|
||||||
|
into "$distDir/maven"
|
||||||
|
rename "-${java.util.regex.Pattern.quote(version)}", ''
|
||||||
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
archives javadocJar
|
archives javadocJar
|
||||||
}
|
}
|
||||||
|
|
||||||
dist {
|
dist {
|
||||||
|
dependsOn distMavenSources
|
||||||
|
|
||||||
[jar, distSourcesJar].forEach {
|
[jar, distSourcesJar].forEach {
|
||||||
from(it) {
|
from(it) {
|
||||||
rename('dist-', '')
|
rename('dist-', '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
from (configurations.compile) {
|
from (configurations.compile) {
|
||||||
include 'annotations*.jar'
|
include 'annotations*.jar'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user