Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed finalizeDSL block preventing property changes #70

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions demo-project/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ plugins {
alias(libs.plugins.kotlin.android)
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(11))

android {
namespace = "com.example.myapplication"
compileSdk = libs.versions.android.sdk.get().toInt()
buildFeatures.viewBinding = true

compileSdk = libs.versions.android.compileSDK.get().toInt()
defaultConfig {
applicationId = "com.example.myapplication"
minSdk = 21
minSdk = libs.versions.android.minSDK.get().toInt()

versionCode = 1
versionName = "1.0"

Expand Down
2 changes: 2 additions & 0 deletions demo-project/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
jacoco
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(11))

dependencies {
testImplementation(libs.junit)
}
6 changes: 4 additions & 2 deletions demo-project/login/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ plugins {
alias(libs.plugins.kotlin.android)
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(11))

android {
namespace = "com.example.login"
compileSdk = libs.versions.android.sdk.get().toInt()
buildFeatures.viewBinding = true
testFixtures.enable = true

compileSdk = libs.versions.android.compileSDK.get().toInt()
defaultConfig {
minSdk = 21
minSdk = libs.versions.android.minSDK.get().toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
Expand Down
8 changes: 7 additions & 1 deletion demo-project/ui-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ plugins {
alias(libs.plugins.kotlin.android)
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(11))

android {
namespace = "com.example.app.test"
compileSdk = libs.versions.android.sdk.get().toInt()

compileSdk = libs.versions.android.compileSDK.get().toInt()
defaultConfig {
minSdk = libs.versions.android.minSDK.get().toInt()
}

targetProjectPath = projects.demoProject.app.dependencyProject.path

Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[versions]
kotlin = "1.9.10"
agp = "8.1.2"
android-sdk = "34"
android-minSDK = "21"
android-compileSDK = "34"
androidx-lifecycle = "2.6.2"
androidx-navigation = "2.7.4"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

package io.github.gmazzo.android.test.aggregation

import org.gradle.api.DomainObjectSet
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.kotlin.dsl.aggregateTestCoverage
import org.gradle.kotlin.dsl.apply
Expand All @@ -13,7 +13,7 @@ import org.gradle.kotlin.dsl.typeOf

internal abstract class AndroidTestBaseAggregationPlugin : Plugin<Project> {

internal abstract val extendedProperties: ListProperty<Property<*>>
abstract val extendedProperties: DomainObjectSet<Property<*>>

override fun apply(target: Project): Unit = with(target) {
apply(plugin = "com.android.base")
Expand All @@ -34,8 +34,7 @@ internal abstract class AndroidTestBaseAggregationPlugin : Plugin<Project> {
}

androidComponents.finalizeDsl {
extendedProperties.finalizeValue()
extendedProperties.get().forEach { it.finalizeValue() }
extendedProperties.all { finalizeValue() }
}
}

Expand Down