Build: Don't disable incremental compilation for CI
Using different incremental setting for KotlinCompile makes impossible using caches built on CI since it is marked as @Input. Same property for JavaCompile marked as @Internal. We do clean checkout now so it shouldn't matter but we want to build incrementally in some cases for Dev builds on CI.
This commit is contained in:
+6
-12
@@ -1,6 +1,5 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import org.gradle.plugins.ide.idea.model.IdeaModel
|
import org.gradle.plugins.ide.idea.model.IdeaModel
|
||||||
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
import proguard.gradle.ProGuardTask
|
import proguard.gradle.ProGuardTask
|
||||||
|
|
||||||
@@ -448,17 +447,12 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gradle.taskGraph.whenReady {
|
gradle.taskGraph.whenReady {
|
||||||
if (isTeamcityBuild) {
|
fun Boolean.toOnOff(): String = if (this) "on" else "off"
|
||||||
logger.warn("CI build profile is active (IC is off, proguard is on). Use -Pteamcity=false to reproduce local build")
|
val profile = if (isTeamcityBuild) "CI" else "Local"
|
||||||
for (task in allTasks) {
|
|
||||||
when (task) {
|
logger.warn("$profile build profile is active (proguard is ${kotlinBuildProperties.proguard.toOnOff()}" +
|
||||||
is AbstractKotlinCompile<*> -> task.incremental = false
|
", jar compression is ${kotlinBuildProperties.jarCompression.toOnOff()})." +
|
||||||
is JavaCompile -> task.options.isIncremental = false
|
" Use -Pteamcity=<true|false> to reproduce CI/local build")
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
logger.warn("Local build profile is active (IC is on, proguard is off). Use -Pteamcity=true to reproduce TC build")
|
|
||||||
}
|
|
||||||
|
|
||||||
allTasks.filterIsInstance<org.gradle.jvm.tasks.Jar>().forEach { task ->
|
allTasks.filterIsInstance<org.gradle.jvm.tasks.Jar>().forEach { task ->
|
||||||
task.entryCompression = if (kotlinBuildProperties.jarCompression)
|
task.entryCompression = if (kotlinBuildProperties.jarCompression)
|
||||||
|
|||||||
Reference in New Issue
Block a user