[Build] Setup useFirForLibraries flag
This commit is contained in:
committed by
teamcityserver
parent
0bfc88fad0
commit
0923d39215
@@ -46,6 +46,9 @@ org.gradle.vfs.watch=true
|
||||
# Enable compilation of project using FIR compiler
|
||||
#kotlin.build.useFir=true
|
||||
|
||||
# Enable FIR compiler for kotlin-stdlib, kotlin-reflect, kotlin-test.
|
||||
#kotlin.build.useFirForLibraries=true
|
||||
|
||||
# Enable overriding JDK 6 and JDK 7 with JDK 8 in java toolchains
|
||||
# This flag is required if you don't have JDK 6 or JDK 7 manually installed
|
||||
#kotlin.build.isObsoleteJdkOverrideEnabled=true
|
||||
|
||||
@@ -64,6 +64,16 @@ ext.configurePluginMarkers = { Project project, withEmptyJars = true ->
|
||||
PluginMarkersKt.publishPluginMarkers(project, withEmptyJars)
|
||||
}
|
||||
|
||||
ext.configureFrontendIr = { Project project ->
|
||||
project.tasks.withType(KotlinCompile.class) { task ->
|
||||
task.kotlinOptions {
|
||||
if (project.kotlinBuildProperties.useFirForLibraries) {
|
||||
freeCompilerArgs += "-Xuse-fir"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
allprojects { project ->
|
||||
project.ext.configureSourcesJar = { lambda = {} ->
|
||||
ArtifactsKt.sourcesJar(project) { task ->
|
||||
|
||||
@@ -44,6 +44,8 @@ compileTestKotlin {
|
||||
]
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
if (includeJava9) {
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.junit')
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ compileTestKotlin {
|
||||
]
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
if (includeJava9) {
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.junit5')
|
||||
}
|
||||
|
||||
@@ -57,6 +57,8 @@ compileTestKotlin {
|
||||
]
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
if (includeJava9) {
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test')
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ compileTestKotlin {
|
||||
]
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
if (includeJava9) {
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.testng')
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ compileKotlin {
|
||||
}
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
jar {
|
||||
manifestAttributes(manifest, project, "internal")
|
||||
}
|
||||
|
||||
@@ -90,6 +90,8 @@ compileTestKotlin {
|
||||
]
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk7')
|
||||
|
||||
task testJdk6Tests(type: Test) {
|
||||
|
||||
@@ -75,6 +75,8 @@ compileTestKotlin {
|
||||
]
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk8')
|
||||
|
||||
task testJdk6Tests(type: Test) { thisTask ->
|
||||
|
||||
@@ -143,6 +143,8 @@ compileLongRunningTestKotlin {
|
||||
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.ExperimentalStdlibApi"
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
task longRunningTest(type: Test, dependsOn: longRunningTestClasses) {
|
||||
group = "verification"
|
||||
testClassesDirs = sourceSets.longRunningTest.output.classesDirs
|
||||
|
||||
@@ -27,3 +27,5 @@ compileKotlin {
|
||||
]
|
||||
kotlinOptions.moduleName = project.name
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
@@ -40,3 +40,5 @@ compileKotlin {
|
||||
]
|
||||
kotlinOptions.moduleName = project.name
|
||||
}
|
||||
|
||||
configureFrontendIr(project)
|
||||
|
||||
Reference in New Issue
Block a user