-
Notifications
You must be signed in to change notification settings - Fork 64
Migrate amazon & debugview modules to KTS #2327
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
Open
skydoves
wants to merge
8
commits into
main
Choose a base branch
from
kts/migration-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
724560b
Migrate amazon gradle to KTS format
skydoves b6e9fbe
Migrate ui:debugview Gradle module to KTS
skydoves 3d067ff
Bump Kover to 0.7.2 and remove the afterEvaluate tasks
skydoves df89de8
Merge branch 'main' into kts/migration-1
skydoves 8d2b902
Merge branch 'main' into kts/migration-1
skydoves 7cbc799
Merge branch 'main' into kts/migration-1
skydoves 946310f
Merge branch 'main' into kts/migration-1
skydoves 964fb04
Adds a matchingFallback to the "defaults" flavor in api-tester's "cus…
JayShortway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ android { | |
} | ||
customEntitlementComputation { | ||
dimension "apis" | ||
matchingFallbacks = ["defaults"] | ||
} | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
plugins { | ||
alias(libs.plugins.android.library) | ||
alias(libs.plugins.kotlin.android) | ||
} | ||
|
||
if (!(project.properties["ANDROID_VARIANT_TO_PUBLISH"] as String).contains("customEntitlementComputation")) { | ||
apply(plugin = "com.vanniktech.maven.publish") | ||
} | ||
|
||
apply(from = "${rootProject.projectDir}/library.gradle") | ||
|
||
android { | ||
namespace = "com.revenuecat.purchases.amazon" | ||
|
||
flavorDimensions += "apis" | ||
|
||
productFlavors { | ||
create("defaults") { | ||
dimension = "apis" | ||
isDefault = true | ||
} | ||
} | ||
|
||
defaultConfig { | ||
missingDimensionStrategy("apis", "defaults") | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":purchases")) | ||
|
||
implementation(libs.amazon.appstore.sdk) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,6 @@ android { | |
} | ||
} | ||
|
||
project.afterEvaluate { | ||
// Remove afterEvaluate | ||
// after https://github.com/Kotlin/kotlinx-kover/issues/362 is fixed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙌 |
||
project.pluginManager.apply("org.jetbrains.kotlinx.kover") | ||
} | ||
|
||
def obtainMinSdkVersion() { | ||
def result = minVersion | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
plugins { | ||
alias(libs.plugins.android.library) | ||
alias(libs.plugins.kotlin.android) | ||
alias(libs.plugins.paparazzi) | ||
} | ||
|
||
if (!(project.properties["ANDROID_VARIANT_TO_PUBLISH"] as String).contains("customEntitlementComputation")) { | ||
apply(plugin = "com.vanniktech.maven.publish") | ||
} | ||
|
||
apply(from = "${rootProject.projectDir}/library.gradle") | ||
|
||
android { | ||
namespace = "com.revenuecat.purchases.ui.debugview" | ||
|
||
flavorDimensions += "apis" | ||
productFlavors { | ||
create("defaults") { | ||
dimension = "apis" | ||
isDefault = true | ||
} | ||
} | ||
|
||
defaultConfig { | ||
minSdk = 21 | ||
} | ||
|
||
buildFeatures { | ||
compose = true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.4.8" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":purchases")) | ||
|
||
implementation(libs.androidx.core) | ||
implementation(libs.androidx.lifecycle.runtime.ktx) | ||
implementation(libs.androidx.lifecycle.viewmodel) | ||
implementation(libs.androidx.lifecycle.viewmodel.compose) | ||
|
||
implementation(platform(libs.compose.bom)) | ||
implementation(libs.compose.ui) | ||
implementation(libs.compose.ui.graphics) | ||
implementation(libs.compose.ui.tooling.preview) | ||
implementation(libs.compose.material) | ||
implementation(libs.compose.material3) | ||
|
||
debugImplementation(libs.compose.ui.tooling) | ||
debugImplementation(libs.androidx.test.compose.manifest) | ||
|
||
testImplementation(libs.androidx.appcompat) | ||
testImplementation(libs.androidx.lifecycle.runtime.ktx) | ||
testImplementation(libs.androidx.test.espresso.core) | ||
testImplementation(libs.androidx.test.runner) | ||
testImplementation(libs.androidx.test.rules) | ||
testImplementation(libs.androidx.test.junit) | ||
|
||
testImplementation(platform(libs.compose.bom)) | ||
testImplementation(libs.androidx.test.compose) | ||
|
||
testImplementation(libs.assertJ) | ||
testImplementation(libs.mockk.android) | ||
testImplementation(libs.mockk.agent) | ||
|
||
testImplementation(libs.androidx.legacy.core.ui) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skydoves This fixes it locally for me. 🤞 The way I understand the error is that
:feature:amazon
,:ui:revenuecatui
and:ui:debugview
don't declare thecustomEntitlementsComputation
flavor, and soapi-tester
'scustomEntitlementsComputation
flavor cannot find the appropriate flavor of those dependencies.This
matchingFallbacks
option tells it to fall back to thedefaults
flavor of the dependency if it doesn't have acustomEntitlementsComputation
flavor. (cc @tonidero)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Thanks so much for jumping in and fixing it directly, @JayShortway! 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice! So we do use this in these modules:
But seems this is not picking that up... In any case, I think this is fine 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right! Should
"apis"
be included inmatchingFallbacks
you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm well I think
apis
is the "dimension", vsdefaults/customEntitlementComputation
which are the possible values of that dimension. I thinkmatchingFallbacks
requires the value of the dimension, if I understand correctly? So I think it should be enough as it is... Might be worth confirming it would still fail API tests for the custom entitlement computation flavor though, just in case