Replace assertContains with assertTasksExecuted/assertTasksUpToDate
This commit is contained in:
+15
-8
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.kotlin.gradle
|
||||
|
||||
import org.gradle.api.logging.LogLevel
|
||||
import org.jetbrains.kotlin.gradle.util.getFileByName
|
||||
import org.jetbrains.kotlin.gradle.util.getFilesByNames
|
||||
import org.jetbrains.kotlin.gradle.util.isLegacyAndroidGradleVersion
|
||||
@@ -46,7 +47,7 @@ abstract class KotlinAndroid3GradleIT(
|
||||
|
||||
project.build(":Lib:assemble") {
|
||||
assertSuccessful()
|
||||
assertContains(*kotlinTaskNames.toTypedArray())
|
||||
assertTasksExecuted(*kotlinTaskNames.toTypedArray())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,15 +113,21 @@ abstract class AbstractKotlinAndroidGradleTests(
|
||||
|
||||
@Test
|
||||
fun testAssembleAndroidTestFirst() {
|
||||
val project = Project("AndroidProject", gradleVersion)
|
||||
val project = Project("AndroidProject", gradleVersion, minLogLevel = LogLevel.INFO)
|
||||
|
||||
// Execute 'assembleAndroidTest' first, without 'build' side effects
|
||||
project.build("assembleAndroidTest") {
|
||||
assertSuccessful()
|
||||
if (isLegacyAndroidGradleVersion(androidGradlePluginVersion)) {
|
||||
val tasks = ArrayList<String>().apply {
|
||||
for (subProject in listOf("Android", "Lib")) {
|
||||
for (flavor in listOf("Flavor1", "Flavor2")) {
|
||||
add(":$subProject:copy${flavor}DebugKotlinClasses")
|
||||
}
|
||||
}
|
||||
}
|
||||
// with the new AGP we don't need copy classes tasks
|
||||
assertContains(":copyFlavor1DebugKotlinClasses")
|
||||
assertContains(":copyFlavor2DebugKotlinClasses")
|
||||
assertTasksExecuted(tasks)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,19 +160,19 @@ fun getSomething() = 10
|
||||
@Test
|
||||
fun testIncrementalBuildWithNoChanges() {
|
||||
val project = Project("AndroidIncrementalSingleModuleProject", gradleVersion)
|
||||
val tasksToExecute = arrayOf(
|
||||
val tasksToExecute = listOf(
|
||||
":app:compileDebugKotlin",
|
||||
":app:compileDebugJavaWithJavac"
|
||||
)
|
||||
|
||||
project.build("assembleDebug") {
|
||||
assertSuccessful()
|
||||
assertContains(*tasksToExecute)
|
||||
assertTasksExecuted(tasksToExecute)
|
||||
}
|
||||
|
||||
project.build("assembleDebug") {
|
||||
assertSuccessful()
|
||||
assertContains(*tasksToExecute.map { it + " UP-TO-DATE" }.toTypedArray())
|
||||
assertTasksUpToDate(tasksToExecute)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +294,7 @@ fun getSomething() = 10
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(
|
||||
assertTasksExecuted(
|
||||
":lib:compileKotlinCommon",
|
||||
":lib:compileTestKotlinCommon",
|
||||
":libJvm:compileKotlin",
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ class ClassFileIsRemovedIT : BaseGradleIT() {
|
||||
// check that class removal does not trigger rebuild
|
||||
project.build("build", options = buildOptions) {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin UP-TO-DATE", ":compileJava UP-TO-DATE")
|
||||
assertTasksUpToDate(":compileKotlin", ":compileJava")
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -47,8 +47,7 @@ open class Kapt3AndroidIT : Kapt3BaseIT() {
|
||||
|
||||
project.build("build", options = options) {
|
||||
assertSuccessful()
|
||||
assertContains(":compileReleaseKotlin UP-TO-DATE")
|
||||
assertContains(":compileReleaseJavaWithJavac UP-TO-DATE")
|
||||
assertTasksUpToDate(":compileReleaseKotlin", ":compileReleaseJavaWithJavac")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-18
@@ -42,8 +42,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertKaptSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassGenerated.java")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
assertFileExists(javaClassesDir() + "example/TestClassGenerated.class")
|
||||
@@ -57,8 +56,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertKaptSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassGenerated.java")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
val javaClassesDir = javaClassesDir()
|
||||
@@ -74,8 +72,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin UP-TO-DATE")
|
||||
assertContains(":compileJava UP-TO-DATE")
|
||||
assertTasksUpToDate(":compileKotlin", ":compileJava")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +85,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
project.build("clean", "build", options = options) {
|
||||
assertSuccessful()
|
||||
assertKaptSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertClassFilesNotContain(javaClassesDir, "ExampleSourceAnnotation")
|
||||
}
|
||||
|
||||
@@ -97,8 +93,9 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
project.build("build", options = options) {
|
||||
assertSuccessful()
|
||||
assertKaptSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin")
|
||||
// there are no actual changes in Java sources, generated sources, Kotlin classes
|
||||
assertTasksUpToDate(":compileJava")
|
||||
assertClassFilesNotContain(javaClassesDir, "ExampleSourceAnnotation")
|
||||
}
|
||||
|
||||
@@ -106,9 +103,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
javaClassesDir.deleteRecursively()
|
||||
project.build("build", options = options) {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin UP-TO-DATE")
|
||||
assertContains(":kaptGenerateStubsKotlin UP-TO-DATE")
|
||||
assertContains(":kaptKotlin UP-TO-DATE")
|
||||
assertTasksUpToDate(":kaptGenerateStubsKotlin", ":kaptKotlin", ":compileKotlin")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
assertClassFilesNotContain(javaClassesDir, "ExampleSourceAnnotation")
|
||||
}
|
||||
@@ -119,7 +114,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
val project = Project("simple", directoryPrefix = "kapt2")
|
||||
project.build("build", options = defaultBuildOptions().copy(incremental = false)) {
|
||||
assertSuccessful()
|
||||
assertContains(":kaptGenerateStubsKotlin")
|
||||
assertTasksExecuted(":kaptGenerateStubsKotlin")
|
||||
assertNotContains(USING_INCREMENTAL_COMPILATION_MESSAGE)
|
||||
}
|
||||
}
|
||||
@@ -161,8 +156,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertKaptSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassGenerated.java")
|
||||
@@ -181,8 +175,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassGenerated.java")
|
||||
|
||||
+13
-22
@@ -16,8 +16,7 @@ class KaptIT : BaseGradleIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("kapt: Class file stubs are not used")
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists("build/tmp/kapt/main/wrappers/annotations.main.txt")
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassGenerated.java")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
@@ -45,8 +44,7 @@ class KaptIT : BaseGradleIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists("build/tmp/kapt/main/wrappers/annotations.main.txt")
|
||||
}
|
||||
|
||||
@@ -63,8 +61,7 @@ class KaptIT : BaseGradleIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("kapt: Using class file stubs")
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists("build/tmp/kapt/main/wrappers/annotations.main.txt")
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassGenerated.java")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
@@ -90,8 +87,7 @@ class KaptIT : BaseGradleIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("kapt: Using class file stubs")
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
assertFileExists(javaClassesDir() + "example/TestClassGenerated.class")
|
||||
}
|
||||
@@ -99,16 +95,15 @@ class KaptIT : BaseGradleIT() {
|
||||
|
||||
@Test
|
||||
fun testSimpleIncrementalBuild() {
|
||||
doTestIncrementalBuild("kaptSimple", arrayOf(":compileKotlin", ":compileJava"))
|
||||
doTestIncrementalBuild("kaptSimple", listOf(":compileKotlin", ":compileJava"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testStubsIncrementalBuild() {
|
||||
doTestIncrementalBuild("kaptStubs", arrayOf(":compileKotlin", ":compileJava", ":compileKotlinAfterJava"))
|
||||
doTestIncrementalBuild("kaptStubs", listOf(":compileKotlin", ":compileJava", ":compileKotlinAfterJava"))
|
||||
}
|
||||
|
||||
private fun doTestIncrementalBuild(projectName: String, compileTasks: Array<String>) {
|
||||
val compileTasksUpToDate = compileTasks.map { it + " UP-TO-DATE" }.toTypedArray()
|
||||
private fun doTestIncrementalBuild(projectName: String, compileTasks: List<String>) {
|
||||
val project = Project(projectName, GradleVersionRequired.Exact("3.5"))
|
||||
project.allowOriginalKapt()
|
||||
|
||||
@@ -119,27 +114,25 @@ class KaptIT : BaseGradleIT() {
|
||||
project.projectDir.getFileByName("test.kt").appendText(" ")
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(*compileTasks)
|
||||
assertNotContains(*compileTasksUpToDate)
|
||||
assertTasksExecuted(compileTasks)
|
||||
}
|
||||
|
||||
repeat(2) {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(*compileTasksUpToDate)
|
||||
assertTasksUpToDate(compileTasks)
|
||||
}
|
||||
}
|
||||
|
||||
project.build("clean", "build") {
|
||||
assertSuccessful()
|
||||
assertContains(*compileTasks)
|
||||
assertNotContains(*compileTasksUpToDate)
|
||||
assertTasksExecuted(compileTasks)
|
||||
}
|
||||
|
||||
repeat(2) {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(*compileTasksUpToDate)
|
||||
assertTasksUpToDate(compileTasks)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,8 +145,7 @@ class KaptIT : BaseGradleIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("kapt: Using class file stubs")
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists("build/tmp/kapt/main/wrappers/annotations.main.txt")
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassCustomized.java")
|
||||
assertFileExists(kotlinClassesDir() + "example/TestClass.class")
|
||||
@@ -183,8 +175,7 @@ class KaptIT : BaseGradleIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("kapt: Using class file stubs")
|
||||
assertContains(":compileKotlin")
|
||||
assertContains(":compileJava")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
assertFileExists("build/tmp/kapt/main/wrappers/annotations.main.txt")
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassCustomized.java")
|
||||
assertFileExists("build/tmp/kapt/main/kotlinGenerated/TestClass.kt")
|
||||
|
||||
+9
-9
@@ -65,20 +65,20 @@ abstract class KaptIncrementalBaseIT(val shouldUseStubs: Boolean, val useKapt3:
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(
|
||||
":compileKotlin UP-TO-DATE",
|
||||
":compileJava UP-TO-DATE"
|
||||
assertTasksUpToDate(
|
||||
":compileKotlin",
|
||||
":compileJava"
|
||||
)
|
||||
|
||||
if (useKapt3) {
|
||||
assertContains(
|
||||
":kaptKotlin UP-TO-DATE",
|
||||
":kaptGenerateStubsKotlin UP-TO-DATE"
|
||||
assertTasksUpToDate(
|
||||
":kaptKotlin",
|
||||
":kaptGenerateStubsKotlin"
|
||||
)
|
||||
}
|
||||
|
||||
if (shouldUseStubs) {
|
||||
assertContains(":compileKotlinAfterJava UP-TO-DATE")
|
||||
assertTasksUpToDate(":compileKotlinAfterJava")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,8 +106,8 @@ abstract class KaptIncrementalBaseIT(val shouldUseStubs: Boolean, val useKapt3:
|
||||
checkStubUsage()
|
||||
|
||||
if (useKapt3) {
|
||||
assertNotContains(":kaptGenerateStubsKotlin UP-TO-DATE")
|
||||
assertContains(":kaptKotlin UP-TO-DATE")
|
||||
assertTasksExecuted(":kaptGenerateStubsKotlin")
|
||||
assertTasksUpToDate(":kaptKotlin")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -19,7 +19,7 @@ class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
|
||||
assertContains(
|
||||
assertTasksExecuted(
|
||||
":libraryProject:jarSources",
|
||||
":mainProject:compileKotlin2Js",
|
||||
":libraryProject:compileKotlin2Js"
|
||||
@@ -35,7 +35,7 @@ class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":mainProject:compileKotlin2Js UP-TO-DATE")
|
||||
assertTasksUpToDate(":mainProject:compileKotlin2Js")
|
||||
assertContainsRegex(":libraryProject:compileTestKotlin2Js (UP-TO-DATE|NO-SOURCE)".toRegex())
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
project.build("jar") {
|
||||
assertSuccessful()
|
||||
|
||||
assertContains(":compileKotlin2Js")
|
||||
assertTasksExecuted(":compileKotlin2Js")
|
||||
val jarPath = "build/libs/kotlin2JsNoOutputFileProject.jar"
|
||||
assertFileExists(jarPath)
|
||||
val jar = ZipFile(fileInWorkingDir(jarPath))
|
||||
@@ -82,7 +82,7 @@ class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
project.build(":jar") {
|
||||
assertSuccessful()
|
||||
|
||||
assertContains(":compileKotlin2Js")
|
||||
assertTasksExecuted(":compileKotlin2Js")
|
||||
val jarPath = "build/libs/kotlin2JsModuleKind.jar"
|
||||
assertFileExists(jarPath)
|
||||
val jar = ZipFile(fileInWorkingDir(jarPath))
|
||||
@@ -120,7 +120,7 @@ class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
|
||||
assertContains(
|
||||
assertTasksExecuted(
|
||||
":compileKotlin2Js",
|
||||
":compileTestKotlin2Js"
|
||||
)
|
||||
@@ -146,7 +146,7 @@ class Kotlin2JsGradlePluginIT : BaseGradleIT() {
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
|
||||
assertContains(
|
||||
assertTasksExecuted(
|
||||
":compileKotlin2Js",
|
||||
":compileIntegrationTestKotlin2Js"
|
||||
)
|
||||
|
||||
+17
-27
@@ -37,16 +37,16 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
project.build("compileDeployKotlin", "build") {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
assertContains(":compileKotlin", ":compileTestKotlin", ":compileDeployKotlin")
|
||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin", ":compileDeployKotlin")
|
||||
}
|
||||
|
||||
project.build("compileDeployKotlin", "build") {
|
||||
assertSuccessful()
|
||||
assertContains(
|
||||
":compileKotlin UP-TO-DATE",
|
||||
":compileTestKotlin UP-TO-DATE",
|
||||
":compileDeployKotlin UP-TO-DATE",
|
||||
":compileJava UP-TO-DATE"
|
||||
assertTasksUpToDate(
|
||||
":compileKotlin",
|
||||
":compileTestKotlin",
|
||||
":compileDeployKotlin",
|
||||
":compileJava"
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -82,13 +82,13 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
assertSuccessful()
|
||||
assertFileExists(kotlinClassesDir() + "META-INF/kotlinProject.kotlin_module")
|
||||
assertReportExists()
|
||||
assertContains(":compileKotlin", ":compileTestKotlin")
|
||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin")
|
||||
assertNotContains("Forcing System.gc")
|
||||
}
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin UP-TO-DATE", ":compileTestKotlin UP-TO-DATE")
|
||||
assertTasksUpToDate(":compileKotlin", ":compileTestKotlin")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
Project("classpathTest").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
assertContains(":compileKotlin", ":compileTestKotlin")
|
||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
Project("multiprojectClassPathTest").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists("subproject")
|
||||
assertContains(":subproject:compileKotlin", ":subproject:compileTestKotlin")
|
||||
assertTasksExecuted(":subproject:compileKotlin", ":subproject:compileTestKotlin")
|
||||
checkKotlinGradleBuildServices()
|
||||
}
|
||||
}
|
||||
@@ -210,23 +210,15 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
|
||||
@Test
|
||||
fun testSimpleMultiprojectIncremental() {
|
||||
fun Project.modify(body: Project.() -> Unit): Project {
|
||||
this.body()
|
||||
return this
|
||||
}
|
||||
|
||||
val incremental = defaultBuildOptions().copy(incremental = true)
|
||||
|
||||
Project("multiprojectWithDependency").build("assemble", options = incremental) {
|
||||
assertSuccessful()
|
||||
assertReportExists("projA")
|
||||
assertContains(":projA:compileKotlin")
|
||||
assertNotContains("projA:compileKotlin UP-TO-DATE")
|
||||
assertReportExists("projB")
|
||||
assertContains(":projB:compileKotlin")
|
||||
assertNotContains("projB:compileKotlin UP-TO-DATE")
|
||||
assertTasksExecuted(":projA:compileKotlin", ":projB:compileKotlin")
|
||||
}
|
||||
Project("multiprojectWithDependency").modify {
|
||||
Project("multiprojectWithDependency").apply {
|
||||
val oldSrc = File(this.projectDir, "projA/src/main/kotlin/a.kt")
|
||||
val newSrc = File(this.projectDir, "projA/src/main/kotlin/a.kt.new")
|
||||
assertTrue { oldSrc.exists() }
|
||||
@@ -235,11 +227,8 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
}.build("assemble", options = incremental) {
|
||||
assertSuccessful()
|
||||
assertReportExists("projA")
|
||||
assertContains(":projA:compileKotlin")
|
||||
assertNotContains("projA:compileKotlin UP-TO-DATE")
|
||||
assertReportExists("projB")
|
||||
assertContains(":projB:compileKotlin")
|
||||
assertNotContains("projB:compileKotlin UP-TO-DATE")
|
||||
assertTasksExecuted(":projA:compileKotlin", ":projB:compileKotlin")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +237,8 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
Project("kotlinInJavaRoot").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
assertContains(":compileKotlin", ":compileTestKotlin")
|
||||
assertTasksExecuted(":compileKotlin")
|
||||
assertContains(":compileTestKotlin NO-SOURCE")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +309,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin UP-TO-DATE")
|
||||
assertTasksUpToDate(":compileKotlin")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +460,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
|
||||
project.build("build", "install") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin", ":compileTestKotlin")
|
||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin")
|
||||
val pomLines = File(project.projectDir, "build/poms/pom-default.xml").readLines()
|
||||
val stdlibVersionLineNumber = pomLines.indexOfFirst { "<artifactId>kotlin-stdlib</artifactId>" in it } + 1
|
||||
val versionLine = pomLines[stdlibVersionLineNumber]
|
||||
|
||||
+2
-4
@@ -15,7 +15,6 @@ class KotlinGradlePluginMultiVersionIT : BaseMultiGradleVersionIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains()
|
||||
assertContainsRegex("""-processorpath \S*.build.tmp.kapt.main.wrappers""".toRegex())
|
||||
assertFileExists("build/generated/source/kapt/main/example/TestClassGenerated.java")
|
||||
assertClassFilesNotContain(File(project.projectDir, "build/classes"), "ExampleSourceAnnotation")
|
||||
@@ -104,8 +103,7 @@ class KotlinGradlePluginMultiVersionIT : BaseMultiGradleVersionIT() {
|
||||
}
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertNotContains(":compileJava UP-TO-DATE")
|
||||
assertTasksExecuted(":compileKotlin", ":compileJava")
|
||||
if (expectIncrementalCompilation)
|
||||
assertNotContains("not incremental") else
|
||||
assertContains("not incremental")
|
||||
@@ -128,7 +126,7 @@ class KotlinGradlePluginMultiVersionIT : BaseMultiGradleVersionIT() {
|
||||
Project("internalTest", gradleVersion).build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
assertContains(":compileKotlin", ":compileTestKotlin")
|
||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class MultiplatformGradleIT : BaseGradleIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(
|
||||
assertTasksExecuted(
|
||||
":lib:compileKotlinCommon",
|
||||
":lib:compileTestKotlinCommon",
|
||||
":libJvm:compileKotlin",
|
||||
|
||||
+9
-9
@@ -19,16 +19,16 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
fileInWorkingDir("build/reports/tests/classes/demo.TestSource.html").exists() ||
|
||||
fileInWorkingDir("build/reports/tests/test/classes/demo.TestSource.html").exists()
|
||||
}
|
||||
assertContains(":compileKotlin", ":compileTestKotlin", ":compileDeployKotlin")
|
||||
assertTasksExecuted(":compileKotlin", ":compileTestKotlin", ":compileDeployKotlin")
|
||||
}
|
||||
|
||||
project.build("compileDeployKotlin", "build") {
|
||||
assertSuccessful()
|
||||
assertContains(
|
||||
":compileKotlin UP-TO-DATE",
|
||||
":compileTestKotlin UP-TO-DATE",
|
||||
":compileDeployKotlin UP-TO-DATE",
|
||||
":compileJava UP-TO-DATE"
|
||||
assertTasksUpToDate(
|
||||
":compileKotlin",
|
||||
":compileTestKotlin",
|
||||
":compileDeployKotlin",
|
||||
":compileJava"
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":compileKotlin")
|
||||
assertTasksExecuted(":compileKotlin")
|
||||
assertNotContains("""w: [^\r\n]*?\.kt""".toRegex())
|
||||
}
|
||||
}
|
||||
@@ -91,14 +91,14 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
assertSuccessful()
|
||||
assertContains("ExampleSubplugin loaded")
|
||||
assertContains("Project component registration: exampleValue")
|
||||
assertContains(":compileKotlin")
|
||||
assertTasksExecuted(":compileKotlin")
|
||||
}
|
||||
|
||||
project.build("compileKotlin", "build") {
|
||||
assertSuccessful()
|
||||
assertContains("ExampleSubplugin loaded")
|
||||
assertNotContains("Project component registration: exampleValue")
|
||||
assertContains(":compileKotlin UP-TO-DATE")
|
||||
assertTasksUpToDate(":compileKotlin")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user