Setup dist task to assemble libs for compiler distribution.
Produce special stdlib artifact with annotations for dist. Put js outputs to dist, they're required for JS backend tests. Use kotlin-compiler for maven, which has all required dependencies bundled. Clean local directory repository on clean. Change paths in tests to compiled artifacts.
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ public class ForTestCompileRuntime {
|
||||
@NotNull
|
||||
@Deprecated
|
||||
public static File[] runtimeClassesForTests() {
|
||||
return new File[] { assertExists(new File("dist/builtins")), assertExists(new File("dist/classes/builtins")), assertExists(new File("dist/classes/stdlib")) };
|
||||
return new File[] { assertExists(new File("dist/builtins")), assertExists(new File("libraries/stdlib/build/classes/builtins")), assertExists(new File("libraries/stdlib/build/classes/main")) };
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -29,6 +29,7 @@ class CodeConformanceTest : TestCase() {
|
||||
private val EXCLUDED_FILES_AND_DIRS = listOf(
|
||||
"android.tests.dependencies",
|
||||
"core/reflection.jvm/src/kotlin/reflect/jvm/internal/pcollections",
|
||||
"libraries/tools/kotlin-reflect/build",
|
||||
"libraries/tools/kotlin-reflect/target/copied-sources",
|
||||
"libraries/tools/binary-compatibility-validator/src/main/kotlin/org.jetbrains.kotlin.tools",
|
||||
"dependencies",
|
||||
|
||||
@@ -66,7 +66,7 @@ class NoErrorsInStdlibTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
}
|
||||
|
||||
override fun getProjectDescriptor(): LightProjectDescriptor {
|
||||
return object : KotlinJdkAndLibraryProjectDescriptor(File("dist/classes/builtins")) {
|
||||
return object : KotlinJdkAndLibraryProjectDescriptor(File("libraries/stdlib/build/classes/builtins")) {
|
||||
override fun getSdk(): Sdk? = PluginTestCaseBase.fullJdk()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ public final class RhinoUtils {
|
||||
try {
|
||||
runFileWithRhino(DIST_DIR_JS_PATH + "../../js/js.translator/testData/rhino-polyfills.js", context, scope);
|
||||
runFileWithRhino(DIST_DIR_JS_PATH + "kotlin.js", context, scope);
|
||||
runFileWithRhino(DIST_DIR_JS_PATH + "../classes/kotlin-test-js/kotlin-test.js", context, scope);
|
||||
runFileWithRhino(DIST_DIR_JS_PATH + "kotlin-test.js", context, scope);
|
||||
|
||||
//runFileWithRhino(pathToTestFilesRoot() + "jshint.js", context, scope);
|
||||
for (String jsLibrary : jsLibraries) {
|
||||
|
||||
+14
-1
@@ -14,7 +14,8 @@ buildscript {
|
||||
ext.JDK_16 = System.getenv("JDK_16")
|
||||
ext.JDK_17 = System.getenv("JDK_17")
|
||||
ext.JDK_18 = System.getenv("JDK_18")
|
||||
ext.bootstrapCompilerFile = project.file("${rootDir}/../dist/kotlinc/lib/kotlin-compiler.jar")
|
||||
ext.distDir = project.file("${rootDir}/../dist/kotlinc/lib")
|
||||
ext.bootstrapCompilerFile = project.file("${rootDir}/../dist/kotlin-compiler-for-maven.jar")
|
||||
|
||||
allprojects {
|
||||
group = 'org.jetbrains.kotlin'
|
||||
@@ -46,6 +47,12 @@ subprojects {
|
||||
|
||||
}
|
||||
|
||||
task clean {
|
||||
doLast {
|
||||
delete "${buildDir}/repo"
|
||||
}
|
||||
}
|
||||
|
||||
static def configureJvmProject(Project project) {
|
||||
project.configure(project) {
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
@@ -100,6 +107,12 @@ static def configurePublishing(Project project) {
|
||||
enabled signing.required
|
||||
}
|
||||
|
||||
task dist(type: Copy, dependsOn: assemble) {
|
||||
rename "-${java.util.regex.Pattern.quote(version)}", ''
|
||||
rename { String fileName -> 'gradle-' + fileName }
|
||||
into distDir
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
|
||||
@@ -41,3 +41,10 @@ artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
from(compileKotlin2Js.kotlinOptions.outputFile) {
|
||||
into '../../js'
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,10 @@ artifacts {
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", project.name]
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ artifacts {
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
// TODO: Why "-Xmulti-platfrom" ?
|
||||
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform", "-module-name", project.archivesBaseName]
|
||||
|
||||
@@ -6,6 +6,17 @@ configureJvmProject(project)
|
||||
configurePublishing(project)
|
||||
|
||||
sourceSets {
|
||||
annotations {
|
||||
if(!System.properties.'idea.active') {
|
||||
java {
|
||||
srcDir "${rootDir}/../core/runtime.jvm/src"
|
||||
include 'org/jetbrains/annotations/**'
|
||||
}
|
||||
kotlin {
|
||||
exclude '**/*'
|
||||
}
|
||||
}
|
||||
}
|
||||
builtins {
|
||||
java {
|
||||
srcDir "${rootDir}/../core/builtins/src"
|
||||
@@ -49,6 +60,16 @@ jar {
|
||||
from sourceSets.builtins.output
|
||||
}
|
||||
|
||||
task distJar(type: Jar) {
|
||||
baseName = 'dist-kotlin-stdlib'
|
||||
version = null
|
||||
manifestAttributes(manifest, project, 'Main')
|
||||
from("${rootDir}/../dist/builtins")
|
||||
from sourceSets.annotations.output
|
||||
from sourceSets.builtins.output
|
||||
from sourceSets.main.output
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
from "${rootDir}/../core/builtins/native"
|
||||
from sourceSets.builtins.kotlin
|
||||
@@ -59,6 +80,22 @@ artifacts {
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
[distJar, sourcesJar].forEach {
|
||||
from(it) {
|
||||
rename('dist-', '')
|
||||
}
|
||||
// legacy
|
||||
from(it) {
|
||||
rename('dist-', '')
|
||||
rename('kotlin-stdlib', 'kotlin-runtime')
|
||||
}
|
||||
}
|
||||
from (configurations.compile) {
|
||||
include 'annotations*.jar'
|
||||
}
|
||||
}
|
||||
|
||||
compileBuiltinsKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = [
|
||||
|
||||
@@ -35,6 +35,10 @@ artifacts {
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.jdkHome = JDK_17
|
||||
|
||||
@@ -37,6 +37,10 @@ artifacts {
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.jdkHome = JDK_18
|
||||
kotlinOptions.jvmTarget = 1.8
|
||||
|
||||
@@ -228,6 +228,20 @@ artifacts {
|
||||
}
|
||||
|
||||
|
||||
dist {
|
||||
[mergedJar, sourcesJar].forEach {
|
||||
from(it)
|
||||
// legacy
|
||||
from(it) {
|
||||
rename("kotlin-stdlib-js", 'kotlin-jslib')
|
||||
}
|
||||
}
|
||||
from(compileJs) {
|
||||
into '../../js'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
karma {
|
||||
dependencies(['qunitjs@1.23.1', 'karma-teamcity-reporter@0.1.2'])
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ compileTestKotlin {
|
||||
|
||||
test {
|
||||
dependsOn cleanCompileTestKotlin
|
||||
dependsOn(':kotlin-runtime:jar')
|
||||
dependsOn(':kotlin-stdlib:originalStdlibJar')
|
||||
|
||||
systemProperties['overwrite.output'] = System.getProperty("overwrite.output", "false")
|
||||
|
||||
@@ -167,11 +167,16 @@ task relocatedSourcesJar(type: Jar) {
|
||||
from "${core}/reflection.jvm/src"
|
||||
}
|
||||
|
||||
artifacts {
|
||||
def artifactJar = [file: file(outputJarPath), builtBy: proguard, name: archivesBaseName]
|
||||
def artifactJar = [file: file(outputJarPath), builtBy: proguard, name: archivesBaseName]
|
||||
|
||||
artifacts {
|
||||
runtime artifactJar
|
||||
archives artifactJar
|
||||
archives relocatedSourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
from(proguard)
|
||||
from(relocatedSourcesJar)
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@ artifacts {
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
|
||||
Reference in New Issue
Block a user