Skip to content
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

Part 3: Per variant maven classpath support #45

Closed
wants to merge 189 commits into from

Conversation

arunkumar9t2
Copy link
Contributor

@arunkumar9t2 arunkumar9t2 commented Nov 22, 2022

Succeeded by #89

Proposed Changes

Continuing from #44 this change further implements generating multiple maven_installs in WORKSPACE by introducing new Variant<T> suite of classes. Done in #57

Variant is a new abstraction to represent both Android and Jvm variants and currently abstracts Configuration parsing and supports largely moving away from ConfigurationDataSource implementation earlier. The new Variant APIs currently answers the following questions:

  • What variants should we migrate in a given Gradle project? VariantBuilder helps to answer this information by returning set of Varaint<*>
  • From there, we currently use these instances to find configurations and dependencies.
    • Because of this we are able to ensure a particular version of dependency used by a Gradle variant matches in Bazel. For example, debugImplementation('com.x:y-debug) will map to debug_maven@//com_x with alias to y-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 Gradle project 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).

graph LR
    A[Project] --> B[Variants]
    B-->C[Targets]
    C-->D[BUILD.bazel]
Loading

Caveats

Ignore mkdocks from git

See merge request mobile/grazel!79
Update website link in README

See merge request mobile/grazel!80
Update documentation

See merge request mobile/grazel!90
Release 0.1.0

See merge request mobile/grazel!93
Update docs

See merge request mobile/grazel!94
Setup maven central publish configuration

See merge request mobile/grazel!92
Update documentation

See merge request mobile/grazel!96
Ignore release badge

See merge request mobile/grazel!97
It should be PTE LTD instead of PTE LTE
Setup codeowners

See merge request mobile/grazel!98
Fix licenses

See merge request mobile/grazel!99
Add unit tests for sample-lib-flavor 1 and 2

See merge request mobile/grazel!102
Implement variant specific res value support
…ndroid_library` resources target (#67)

Cleanup hybrid build
Update contraint layout override
* Ensure manifest values `applicationId` is variant specific

* Refactor inferring package name for targets

* Bump bazel common and buildifier to latest

---------

Co-authored-by: Lim Min Kuan <[email protected]>
* Convert version catalog into libs.versions.toml

* Fix dependency-catalog.gradle removal from settings.gradle
…zel-common (#73)

* Support unified `android_library` and `android_binary` macros from bazel-common

Context grab/grab-bazel-common#87

As result of bazel-common's macro handling more specific implementation cases the complexity of grazel managing multiple intermediate targets for kotlin, res value and build config has been reduced/removed.

This PR also introduces proper type for representing bazel targets and intermediate extraction data classes `AndroidData`

* Fix instrumentation build

* Ignore invalid tests
…imports (#74)

Make inbuilt repository names no configurable and use constants for imports.
* Remove dead code and refactor DI

* Fix inspection suggestions
…f the file strategy for load statements (#77)

* Remove dead code and refactor DI

* Fix inspection suggestions

* Remove duplicate `load` statements and support either inline or top of the file strategy for load statements
Switch GoogleServiesJsonExtractor to using sourceset's manifestFile instead of javaDirectories to truely support variants
* Ensure generated targets are sorted

* Add sample for resource merging

* Add sample for overridable resources

* Update bazel scripts

* Fix typo

* Add support for multiple flavored resource dirs
… default. Support `viewbinding`. (#84)

Since `bazel-common` is by default used for all targets, remove databinding from migration criteria check.

Signed-off-by: arun.sampathkumar <[email protected]>
* Add compose support via unified android macros

* Update bazel common
minkuan88 and others added 2 commits June 19, 2023 14:06
…#87)

* Add config flag to exclude credentials for maven install repositories

* Change config flag for credentials to a more descriptive name (includeCredentials)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.