Gradle plugin prototype that uses the project model 2.0
This commit is contained in:
@@ -17,13 +17,12 @@ interface KotlinModuleFragment {
|
||||
// TODO: scopes
|
||||
val declaredModuleDependencies: Iterable<KotlinModuleDependency>
|
||||
|
||||
// TODO: should this be source roots or source files?
|
||||
val kotlinSourceRoots: Iterable<File>
|
||||
}
|
||||
|
||||
interface KotlinModuleVariant : KotlinModuleFragment {
|
||||
val variantAttributes: Map<KotlinAttributeKey, String>
|
||||
|
||||
var isExported: Boolean
|
||||
}
|
||||
|
||||
val KotlinModuleFragment.fragmentAttributeSets: Map<KotlinAttributeKey, Set<String>>
|
||||
@@ -65,7 +64,6 @@ class BasicKotlinModuleVariant(
|
||||
containingModule,
|
||||
fragmentName
|
||||
), KotlinModuleVariant {
|
||||
override var isExported: Boolean = true
|
||||
override val variantAttributes: MutableMap<KotlinAttributeKey, String> = mutableMapOf()
|
||||
override fun toString(): String = "variant $fragmentName"
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ class MatchVariantsByExactAttributes : ModuleVariantResolver {
|
||||
override fun getChosenVariant(requestingVariant: KotlinModuleVariant, dependencyModule: KotlinModule): VariantResolution {
|
||||
val candidates = dependencyModule.variants
|
||||
return candidates.filter { candidate ->
|
||||
candidate.isExported && candidate.variantAttributes.all { (attributeKey, candidateValue) ->
|
||||
candidate.variantAttributes.all { (attributeKey, candidateValue) ->
|
||||
attributeKey !in requestingVariant.variantAttributes.keys ||
|
||||
candidateValue == requestingVariant.variantAttributes.getValue(attributeKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user