Repackage Wear projects that use protobufs into multiple JARs
We extract out the repackaged Google Protobuf dependency into a separate
project. We also repackage classes with any references to Google Protobuf
updated to refer to the new package
After this change, the protolayout-proto library's pom file will have a
new dependeny adde to it: protolayout-external-protobuf
BUG: 296864329
TESTED: bumped up version of tiles and protolayout and then published
locally. I bumped the version so that I guarantee Gradle always fetches
the local version. Then, I created a new Android project with a pointer
to the local Maven repo.
In the app buil file, I added
implementation("androidx.wear.tiles:tiles-proto:1.4.0-alpha02")
as a dependency and synced. I saw the tiles-proto get downloaded, as
well as protolayout-proto and protolayout-external-protobuf. Confimed as
well by running ./gradlew :app:dependencies , which showed all these
artifacts being brought in, as well as the dependency constraint between
tiles-proto and protolayout-proto.
In the app MainActivity.kt, I then added a simple print statement:
println(Tile.newBuilder().build())
compiled and ran the app on the phone and it succeeded.
Change-Id: Ie7618afa685e23332a1d64a67f73a93519247e8d
diff --git a/settings.gradle b/settings.gradle
index bdcf375..430d1d1 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -971,6 +971,7 @@
includeProject(":wear:protolayout:protolayout", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:protolayout:protolayout-expression", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:protolayout:protolayout-expression-pipeline", [BuildType.MAIN, BuildType.WEAR])
+includeProject(":wear:protolayout:protolayout-external-protobuf", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:protolayout:protolayout-material", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:protolayout:protolayout-material-core", [BuildType.MAIN, BuildType.WEAR])
includeProject(":wear:protolayout:protolayout-proto", [BuildType.MAIN, BuildType.WEAR])