Skip to content

fix: use Android flavors when appropriate. #1512

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

Merged
merged 3 commits into from
Aug 10, 2025
Merged

Conversation

autonomousapps
Copy link
Owner

@autonomousapps autonomousapps commented Aug 10, 2025

Resolves #1473

@JvmStatic val AGP_MAX = version("8.12.0")
@JvmStatic val AGP_MAX = version("8.13.0")
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, minimize annoying warning.

Comment on lines 458 to 463
return if (withFlavor) {
// debug + test => debugTest
"$name${kindName.capitalizeSafely()}"
} else {
kindName
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix.

@@ -101,6 +101,7 @@ public class AndroidManifest(public val content: String) {
@JvmField
public val DEFAULT_APP: AndroidManifest = app(null)

// TODO: stop using package
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up in separate PR.

@autonomousapps autonomousapps force-pushed the trobalik.advice-flavor branch from d6d4ee2 to f9f976f Compare August 10, 2025 04:00
Copy link

Job Summary for Gradle

Test :: gradle
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
build-logic buildHealth 8.14.3 Build Scan not published
build-logic check 8.14.3 Build Scan not published
dependency-analysis-gradle-pl…
buildHealth 8.14.3 Build Scan published
testkit buildHealth 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
check 8.14.3 Build Scan published
testkit check 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:functionalTest 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:functionalTest 8.14.3 Build Scan published

@@ -225,7 +225,7 @@ internal class StandardTransform(
advice += Advice.ofChange(
coordinates = declarationCoordinates(theDecl),
fromConfiguration = theDecl.configurationName,
toConfiguration = usage.toConfiguration()
toConfiguration = usage.toConfiguration(withFlavor = true)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this new parameter if test suite passes

@@ -440,20 +440,31 @@ internal class StandardTransform(
}

/** e.g., "debug" + "implementation" -> "debugImplementation" */
private fun Usage.toConfiguration(forcedKind: SourceKind? = null): String {
private fun Usage.toConfiguration(forcedKind: SourceKind? = null, withFlavor: Boolean = false): String {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this new parameter if test suite passes

check(bucket != Bucket.NONE) { "You cannot 'declare' an unused dependency" }

fun processor() = if (isKaptApplied) "kapt" else "annotationProcessor"

fun SourceKind.configurationNamePrefix(): String = when (kind) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup

Copy link

Job Summary for Gradle

Test :: gradle
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
build-logic buildHealth 8.14.3 Build Scan not published
build-logic check 8.14.3 Build Scan not published
dependency-analysis-gradle-pl…
buildHealth 8.14.3 Build Scan published
testkit buildHealth 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
check 8.14.3 Build Scan published
testkit check 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:functionalTest 8.14.3 Build Scan published

Copy link

Job Summary for Gradle

Test :: gradle
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
build-logic buildHealth 8.14.3 Build Scan not published
build-logic check 8.14.3 Build Scan not published
dependency-analysis-gradle-pl…
buildHealth 8.14.3 Build Scan published
testkit buildHealth 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
check 8.14.3 Build Scan published
testkit check 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:functionalTest 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:functionalTest 8.14.3 Build Scan published

Copy link

Job Summary for Gradle

Test :: gradle
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
build-logic buildHealth 8.14.3 Build Scan not published
build-logic check 8.14.3 Build Scan not published
dependency-analysis-gradle-pl…
buildHealth 8.14.3 Build Scan published
testkit buildHealth 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
check 8.14.3 Build Scan published
testkit check 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:functionalTest 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:functionalTest 8.14.3 Build Scan published
dependency-analysis-gradle-pl…
:checkApi 8.14.3 Build Scan published

@autonomousapps autonomousapps force-pushed the trobalik.advice-flavor branch 2 times, most recently from 407aa75 to 7d43077 Compare August 10, 2025 19:25
Comment on lines -166 to 173
// copied from StringsJVM.kt
/**
* TODO: Replace this with
* `String.replaceFirstChar(Char::uppercase)`
*
* copied from StringsJVM.kt
*/
@Deprecated("Replace with `String.replaceFirstChar(Char::uppercase)`")
internal fun String.capitalizeSafely(locale: Locale = Locale.ROOT): String {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup

@autonomousapps autonomousapps force-pushed the trobalik.advice-flavor branch from a40da43 to c0c54bf Compare August 10, 2025 21:21
@autonomousapps autonomousapps merged commit a64825b into main Aug 10, 2025
1 check passed
@autonomousapps autonomousapps deleted the trobalik.advice-flavor branch August 10, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change advice cannot be from and to the same configuration (testImplementation in this case)
1 participant