Releases: grab/grazel
0.4.0
Full Changelog: 0.3.2...0.4.0
What's Changed
- Fix Workflow error by @rifqimfahmi in #13
- Use rules_kotlin >= 1.5.0 format changes by @minkuan88 in #14
- Ignore google-java-format plugin metadata from git by @arunkumar9t2 in #15
- Add editor config and format all related files by @arunkumar9t2 in #16
- Refactor tag generation for transitive classpath reduction by @arunkumar9t2 in #17
- Add rules for grab_bazel_common toolchain by @minkuan88 in #20
- Fix
buildifier
formatting failure on CI by @arunkumar9t2 in #21 - Add a task to generate databinding metadata in bazelrc compatible format by @arunkumar9t2 in #24
- Add support to version_conflict_policy for maven_install by @minkuan88 in #26
- Add support to detect source set dirs for tests by @minkuan88 in #27
- Flavors support by @mohamadk in #30
- Add flavor and build types fallback logic by @mohamadk in #31
- add kotlin_extension configurations by @mohamadk in #33
- Change test targets names by @mohamadk in #34
- Bump bazel dependencies to support bazel 6.0.0-pre.20220818.1 by @minkuan88 in #36
- Migrate dependency versions into dependency catalog by @minkuan88 in #28
- Add android instrumentation test migration by @minkuan88 in #37
- Update rules jvm external by @arunkumar9t2 in #38
- Update bazel common android tools refactor by @minkuan88 in #35
- Refactor CI by @arunkumar9t2 in #23
- Update Copyright headers by @arunkumar9t2 in #40
- Bump version to 0.4.0 by @minkuan88 in #41
New Contributors
- @rifqimfahmi made their first contribution in #13
- @mohamadk made their first contribution in #30
Full Changelog: 0.3.2...0.4.0
0.3.2
Issues Fixed
- Partial support for dynamic features: Grazel will generate
android_binary
rule for modules applying dynamic features plugin. - Fixed case where pure Kotlin/Java module with android jar dependency in Gradle did not have android dependency generated in Bazel.
Full Changelog: 0.3.1...0.3.2
0.3.1
Issues fixed
- Fix case where
grab_kt_jvm_test
was generated instead ofgrab_android_local_test
even though module had android jar in its classpath.
Full Changelog: 0.3.0...0.3.1
0.3.0 - Artifact pinning and override targets
Grazel now supports rules_jvm_external
's artifact pinning and ability to generate override targets in WORKSPACE
's maven_install
rule.
Docs:
- https://grab.github.io/Grazel/grazel_extension/#override-targets
- https://grab.github.io/Grazel/grazel_extension/#artifact-pinning
Changes
- Maven artifact pinning and override targets by @arunkumar9t2 in #10
Full Changelog: 0.2.0...0.3.0
0.2.0 - Unit tests and artifact exclusions
Changelog
Features
-
Grazel now automatically infers dependency exclude rules declared in Gradle and maps it to
rules_jvm_external
equivalent. For example,implementation("androidx.constraintlayout:constraintlayout:2.1.1") { exclude group: "androidx.appcompat", module: "appcompat" }
will generate the following in
WORKSPACE
filemaven_install( artifacts = [ ... maven.artifact( group = "androidx.constraintlayout", artifact = "constraintlayout", version = "2.1.1", exclusions = [ "androidx.appcompat:appcompat", ], ), )
-
Grazel can generate unit test rules from bazel-common. Only Kotlin is supported at the moment. Please read readme for more details.
For example,load("@grab_bazel_common//tools/test:test.bzl", "grab_kt_jvm_test") grab_kt_jvm_test( name = "sample-kotlin-lib-test", srcs = glob([ "src/test/java/**/*.kt", ]), associates = [ "//sample-kotlin-lib", ], visibility = [ "//visibility:public", ], deps = [ "@maven//:junit_junit", ], )
For android local unit tests,
grab_android_local_test
will be generated that ports AGP's returnDefaultValues feature to Bazel.load("@grab_bazel_common//tools/test:test.bzl", "grab_android_local_test") grab_android_local_test( name = "grab_android_local_test", srcs = glob([ "src/test/java/**/*.kt", ]), associates = [ ":grab_android_local_test_lib_kt", ], deps = [ "@maven//:junit_junit", ], )
Both of the macros assumes the test files are in Kotlin, ends with
*Test
and file name matches the class name. Robolectric is currently not supported.Unit test generation is controlled by
grazel.rules.test.enableTestMigration
flag.
Contributors
- Gradle 7.1.1 compatibility, thanks @msfjarvis.
Initial release - 0.1.0
Grazel
Grazel stands for Gradle to Bazel. It is a Gradle plugin that enables you to migrate Android projects to Bazel build system in an incremental and automated fashion.
Usage
Grazel is available on Maven central.
In root build.gradle
file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.grab.grazel:grazel-gradle-plugin:0.1.0"
}
}
apply plugin: "com.grab.grazel"
// Grazel configuration
grazel {
// DSL
}
See configuration for more details.
Run ./gradlew migrateToBazel
to generate Bazel scripts on supported modules in the project.
Reading
Talks
- Grab's migration journey from Gradle to Bazel - Build Meetup 2021. Watch here.