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"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static File stdlibMavenSourcesJarForTests() {
|
||||
return assertExists(new File("dist/maven/kotlin-stdlib-sources.jar"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static File stdlibCommonForTests() {
|
||||
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
|
||||
public static File stdlibJsForTests() {
|
||||
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
|
||||
task distCommon(type: Copy) {
|
||||
from(jar)
|
||||
from(sourcesJar)
|
||||
into "$distDir/common"
|
||||
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 {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
dependsOn distMavenSources
|
||||
|
||||
[jar, distSourcesJar].forEach {
|
||||
from(it) {
|
||||
rename('dist-', '')
|
||||
}
|
||||
}
|
||||
|
||||
from (configurations.compile) {
|
||||
include 'annotations*.jar'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user