Part 2: Initial work on Variant
API
#57
Merged
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.
Proposed Changes
Branched off from #45 to reduce total diff. This contains the new Variant API as described in the other PR that help categorize variants and their configurations accounting for flavors and build types.
VariantBuilder
will help construct set ofVariant
which can be used by rest of the code to infer and start migrationNo changes in the generated code yet, will follow up with part 3.
Variant
is a new abstraction to represent both Android and Jvm variants and currently abstractsConfiguration
parsing and supports largely moving away fromConfigurationDataSource
implementation earlier. The newVariant
APIs currently answers the following questions:project
?VariantBuilder
helps to answer this information by returning set ofVaraint<*>
debugImplementation('com.x:y-debug)
will map todebug_maven@//com_x
with alias toy-debug
.In a later stage, we can extend
Variant<T>
to further represent source set and other information needed for migration. Earlier non flavored migration assumption made #30 difficult, this new structure should largely simplify extending Grazel going forward by making it variant first. Eventually a single Gradleproject
instance will be migrated as follows. The new structure also makes it bit easier to write unit tests on each stage (added in this PR).Testing
Add tests for new classes.