64f8b87b66
- rename plugin into 'kotlin-atomicfu-compiler-plugin' - add 'kotlin-atomicfu-compiler-plugin-embeddable' to be used with 'kotlin-comiler-embeddable' ^KT-52811 In Progress
128 lines
4.3 KiB
Kotlin
128 lines
4.3 KiB
Kotlin
import org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
|
|
|
|
description = "Atomicfu Compiler Plugin"
|
|
|
|
plugins {
|
|
kotlin("jvm")
|
|
id("jps-compatible")
|
|
}
|
|
|
|
val antLauncherJar by configurations.creating
|
|
val testJsRuntime by configurations.creating {
|
|
attributes {
|
|
attribute(Usage.USAGE_ATTRIBUTE, objects.named(KotlinUsages.KOTLIN_RUNTIME))
|
|
attribute(KotlinPlatformType.attribute, KotlinPlatformType.js)
|
|
}
|
|
}
|
|
|
|
val atomicfuJsClasspath by configurations.creating {
|
|
attributes {
|
|
attribute(KotlinPlatformType.attribute, KotlinPlatformType.js)
|
|
attribute(KotlinJsCompilerAttribute.jsCompilerAttribute, KotlinJsCompilerAttribute.ir)
|
|
}
|
|
}
|
|
|
|
val atomicfuJvmClasspath by configurations.creating
|
|
|
|
val atomicfuJsIrRuntimeForTests by configurations.creating {
|
|
attributes {
|
|
attribute(KotlinPlatformType.attribute, KotlinPlatformType.js)
|
|
attribute(KotlinJsCompilerAttribute.jsCompilerAttribute, KotlinJsCompilerAttribute.ir)
|
|
attribute(Usage.USAGE_ATTRIBUTE, objects.named(KotlinUsages.KOTLIN_RUNTIME))
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly(intellijCore())
|
|
compileOnly(commonDependency("org.jetbrains.intellij.deps:asm-all"))
|
|
|
|
compileOnly(project(":compiler:plugin-api"))
|
|
compileOnly(project(":compiler:cli-common"))
|
|
compileOnly(project(":compiler:frontend"))
|
|
compileOnly(project(":compiler:backend"))
|
|
compileOnly(project(":compiler:ir.backend.common"))
|
|
|
|
compileOnly(project(":js:js.frontend"))
|
|
compileOnly(project(":js:js.translator"))
|
|
compileOnly(project(":compiler:backend.js"))
|
|
|
|
compileOnly(project(":compiler:backend.jvm"))
|
|
compileOnly(project(":compiler:ir.tree"))
|
|
|
|
compileOnly(kotlinStdlib())
|
|
|
|
testApi(projectTests(":compiler:tests-common"))
|
|
testApi(projectTests(":compiler:test-infrastructure"))
|
|
testApi(projectTests(":compiler:test-infrastructure-utils"))
|
|
testApi(projectTests(":compiler:tests-compiler-utils"))
|
|
testApi(projectTests(":compiler:tests-common-new"))
|
|
testImplementation(projectTests(":generators:test-generator"))
|
|
|
|
testImplementation(projectTests(":js:js.tests"))
|
|
testApi(commonDependency("junit:junit"))
|
|
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
|
|
|
testRuntimeOnly(kotlinStdlib())
|
|
testRuntimeOnly(project(":kotlin-preloader")) // it's required for ant tests
|
|
testRuntimeOnly(project(":compiler:backend-common"))
|
|
testRuntimeOnly(commonDependency("org.fusesource.jansi", "jansi"))
|
|
|
|
atomicfuJsClasspath("org.jetbrains.kotlinx:atomicfu-js:0.17.1") { isTransitive = false }
|
|
atomicfuJvmClasspath("org.jetbrains.kotlinx:atomicfu:0.17.1") { isTransitive = false }
|
|
atomicfuJsIrRuntimeForTests(project(":kotlinx-atomicfu-runtime")) { isTransitive = false }
|
|
|
|
embedded(project(":kotlinx-atomicfu-runtime")) {
|
|
attributes {
|
|
attribute(KotlinPlatformType.attribute, KotlinPlatformType.js)
|
|
attribute(KotlinJsCompilerAttribute.jsCompilerAttribute, KotlinJsCompilerAttribute.ir)
|
|
attribute(Usage.USAGE_ATTRIBUTE, objects.named(KotlinUsages.KOTLIN_RUNTIME))
|
|
}
|
|
isTransitive = false
|
|
}
|
|
|
|
testImplementation("org.jetbrains.kotlinx:atomicfu:0.17.1")
|
|
|
|
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.1")
|
|
}
|
|
|
|
optInToExperimentalCompilerApi()
|
|
|
|
sourceSets {
|
|
"main" { projectDefault() }
|
|
"test" { projectDefault() }
|
|
}
|
|
|
|
optInToExperimentalCompilerApi()
|
|
|
|
testsJar()
|
|
useD8Plugin()
|
|
|
|
projectTest(jUnitMode = JUnitMode.JUnit5) {
|
|
useJUnitPlatform()
|
|
useJsIrBoxTests(version = version, buildDir = "$buildDir/")
|
|
|
|
workingDir = rootDir
|
|
|
|
dependsOn(":dist")
|
|
dependsOn(atomicfuJsIrRuntimeForTests)
|
|
|
|
val localAtomicfuJsIrRuntimeForTests: FileCollection = atomicfuJsIrRuntimeForTests
|
|
val localAtomicfuJsClasspath: FileCollection = atomicfuJsClasspath
|
|
val localAtomicfuJvmClasspath: FileCollection = atomicfuJvmClasspath
|
|
|
|
doFirst {
|
|
systemProperty("atomicfuJsIrRuntimeForTests.classpath", localAtomicfuJsIrRuntimeForTests.asPath)
|
|
systemProperty("atomicfuJs.classpath", localAtomicfuJsClasspath.asPath)
|
|
systemProperty("atomicfuJvm.classpath", localAtomicfuJvmClasspath.asPath)
|
|
}
|
|
}
|
|
|
|
publish()
|
|
standardPublicJars()
|