Skip to content
Merged
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
21 changes: 17 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ allprojects {

// Dependency substitution: when building in android-complete, replace Maven artifacts
// with their local project equivalents to avoid duplicate class / resource errors.
// Note: Skip substitution for 'dist' flavor configurations — those are intended to
// resolve remote artifacts (e.g. distApi dependencies in test apps).
// Note: Skip substitution for 'dist' and 'external' flavor configurations — those are
// intended to resolve remote artifacts (e.g. distApi dependencies in test apps,
// externalImplementation in AzureSample).
configurations.configureEach {
// Skip dist flavor configurations so they resolve remote Maven artifacts
if (name.toLowerCase().contains('dist')) {
// Skip dist/external flavor configurations so they resolve remote Maven artifacts
if (name.toLowerCase().contains('dist') || name.toLowerCase().contains('external')) {
return
}
resolutionStrategy.dependencySubstitution {
Expand All @@ -309,6 +310,18 @@ allprojects {
configurations.configureEach {
exclude group: 'com.android.support', module: 'support-v4'
}

// For modules with an 'external' product flavor that resolve MSAL from Maven:
// the published artifact uses the 'dist' flavor, so 'external' needs a fallback.
afterEvaluate {
def android = extensions.findByName('android')
if (android != null) {
def externalFlavor = android.productFlavors.findByName('external')
if (externalFlavor != null && !externalFlavor.matchingFallbacks) {
externalFlavor.matchingFallbacks = ['dist']
}
}
}
}

// =============================================================================
Expand Down
Loading