Skip to content

Commit

Permalink
[runningcode#299] Don't check dependOnAssemble on root project
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanalvarado committed Mar 7, 2023
1 parent 9068696 commit 6dd5817
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
5 changes: 2 additions & 3 deletions fladle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java).conf
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class FladlePluginDelegate {
environment(mapOf("GOOGLE_APPLICATION_CREDENTIALS" to config.serviceAccountCredentials.get()))
}
dependsOn(writeConfigProps)
if (config.dependOnAssemble.isPresent && config.dependOnAssemble.get()) {
if (project.name != project.rootProject.name && config.dependOnAssemble.isPresent && config.dependOnAssemble.get()) {
val testedExtension = requireNotNull(project.extensions.findByType(TestedExtension::class.java)) { "Could not find TestedExtension in ${project.name}" }
testedExtension.testVariants.configureEach {
if (testedVariant.isExpectedVariant(config)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,31 @@ class FulladlePlugin : Plugin<Project> {
}

fun configureModule(project: Project, flankGradleExtension: FlankGradleExtension) = project.run {
val configs = flankGradleExtension.configs
val fulladleModuleExtension = extensions.findByType(FulladleModuleExtension::class.java) ?: return
if (!hasAndroidTest) {
return
}

// configs.forEach { config ->
// if (config.dependOnAssemble.isPresent && config.dependOnAssemble.get()) {
// val testedExtension = project.extensions.findByType(TestedExtension::class.java)
// testedExtension?.testVariants?.configureEach {
// if (testedVariant.isExpectedVariant(config)) {
// if (testedVariant.assembleProvider.isPresent) {
// project.tasks.apply {
// dependsOn(testedVariant.assembleProvider)
// }
// }
// if (assembleProvider.isPresent) {
// dependsOn(assembleProvider)
// }
// }
// } ?: println("Could not find TestedExtension in ${project.name}")
// }
// }


val testedExtension = extensions.findByType(TestedExtension::class.java) ?: return
// Only configure the first test variant per module.
// Does anyone test more than one variant per module?
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ androidx-test-rules = "1.2.0"
junit-version = "4.13.2"

kotlin = "1.6.21"
agp-version = "4.2.2"
agp-version = "7.4.1"
flank-version = "22.10.0"

[libraries]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 6dd5817

Please sign in to comment.