[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help With Gradle-plugin-protobuf Update



Hi Markus,

Thank you so much for these clear details!

I will proceed with these steps you outlined.

Regards,

Sonnie

On 7/9/22 11:42, Markus Koschany wrote:
Hi Sonnie,

Am Freitag, dem 08.07.2022 um 20:35 +0100 schrieb Nkwuda Sunday Cletus:
Hi there.

I am a GSOC intern currently working with Debian Android-tools-team to
package and update Android sdk tools in Debian.

Currently I am attempting to package bundletool (
https://github.com/google/bundletool ;), but I am stuck because it
depends on a much more recent version of gradle-plugin-protobuf. I
attempted to update gradle-plugin-protobuf but couldn't. Please your
help will be very appreciated.

Find the details of my attempt and findings here:
https://salsa.debian.org/android-tools-team/admin/-/issues/51
I am currently working on a full Gradle update which includes some of the
artifacts like the kotlin-dsl-plugin and should enable us to package a newer
version of gradle-plugin-protobuf in the near future. However one of my
findings is that we should try hard to avoid pulling in even more Gradle
plugins or Gradle related dependencies. I don't think Gradle will ever be a
build system that fits into the Debian ecosystem and the more we make other
packages dependent on it the more problems we will face in the future.

Hence why I suggest you take a different path. A few months ago I have packaged
a new version of libthrift-java which you could use as a template for your own
project. [1]

libthrift-java usually requires Gradle as well. I simplified the packaging by
using our Debian standard tools javahelper and maven-repo-helper.

This should work for bundletool too. Looking at

https://github.com/google/bundletool/blob/master/build.gradle

we should have all the dependencies in Debian already, except of maybe
com.android:zipflinger and com.google.dagger.

Ignore all tests and test dependencies. Just use the src/main directory as your
upstream sources (and additionally archive/com/google/android/archive if this
is required for your project) and try to compile the Java code with jh_build
first. Add all the required dependencies to your CLASSPATH and you should get a
preliminary jar file.

For the code in src/main/proto you will need the protobuf-compiler package
(already in Debian) and possibly libprotobuf2-java (also in Debian but an older
version). gradle-plugin-protobuf is just a wrapper around these tools. It
should be possible to do all this by hand in debian/rules when you call the
protoc command from protobuf-compiler. If you succeed you would get rid of
Gradle completely and dramatically simplify the packaging process for future
contributors.

If you have more questions, please feel free to ask on this list.

Regards,

Markus


[1] https://tracker.debian.org/pkg/libthrift-java

Attachment: OpenPGP_0x64C708814523D373.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: