[Gradle, Test] separate lib publication and app assemble to different builds

To prevent build failures due to race conditions
with publication and consumption
This commit is contained in:
Anton Lakotka
2023-02-14 11:59:52 +01:00
committed by Space Team
parent 96ba03a708
commit 515a401b23
@@ -209,8 +209,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
fun testRelocationNative(gradleVersion: GradleVersion) { fun testRelocationNative(gradleVersion: GradleVersion) {
val (firstProject, secondProject) = prepareTestProjects( val (firstProject, secondProject) = prepareTestProjects(
"native-build-cache", "native-build-cache",
gradleVersion, gradleVersion
defaultBuildOptions.copy(parallel = false) // disabled to be able to consume published library before app compilation
) { ) {
val localRepoUri = it.projectPath.resolve("repo").toUri() val localRepoUri = it.projectPath.resolve("repo").toUri()
it.subProject("build-cache-app").buildGradleKts.append( it.subProject("build-cache-app").buildGradleKts.append(
@@ -228,9 +227,17 @@ class BuildCacheRelocationIT : KGPBaseTest() {
checkBuildCacheRelocation( checkBuildCacheRelocation(
firstProject, firstProject,
secondProject, secondProject,
listOf(":build-cache-lib:publish", ":build-cache-app:assemble"), listOf(":build-cache-lib:publish"),
listOf( listOf(
":build-cache-lib:compileKotlinHost", ":build-cache-lib:compileKotlinHost",
)
)
checkBuildCacheRelocation(
firstProject,
secondProject,
listOf(":build-cache-app:assemble"),
listOf(
":build-cache-app:compileKotlinHost", ":build-cache-app:compileKotlinHost",
":build-cache-app:lib-module:compileKotlinHost", ":build-cache-app:lib-module:compileKotlinHost",
":build-cache-app:linkDebugStaticHost", ":build-cache-app:linkDebugStaticHost",