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

Re: Packaging issue on gradle's library dependency



Hi Roger,

Didn't know you have no experience in Java packaging, but I assume you
know how to use Gradle? Anyway, welcome to our world!

Judging from the dependency's groupId "co.tomlee.gradle.plugins",
seems like it is the third-party plugin described in your link, so yes
you are correct about that.

In the "repositories" closure, "flatDir" tells Gradle to search the
specified directories for the needed JARs but ignoring all metadata
like groupId and version. "maven" tells Gradle to use a specified
Maven repository, which is the local directory
"/usr/share/maven-repo". Maven repositories are JARs and POMs
organized according to their metadata, where the directory structure
shows the groupId, artifactId (JAR filename) and version. Because
"flatDir" ignores metadata and is discouraged to be used, we should
also move the "flatDir" line to the last position.

After taking a look at the build.gradle of smali, I found there is a
JAR that's not available in Debian yet, which is
"com.google.android.tools:dx:1.7". It's upstream is
<https://android.googlesource.com/platform/dalvik/+/master/dx> and it
is being packaged by the Android Tools team (See
<http://anonscm.debian.org/cgit/android-tools/android-platform-dalvik.git>.
Unfortunately, Android's packages are currently stuck due to
f2fs-tools maintainer lacks time to accept our patch.

Also, since smali is an Android tool, why don't you put it in Android
Tools team <android-tools-devel@lists.alioth.debian.org>? :) Feel free
to join us in IRC #debian-mobile.

Regards,
Kai-Chung Yan

2015-12-21 22:14 GMT+08:00 Roger Shimizu <rogershimizu@gmail.com>:
> On Sun, Dec 20, 2015 at 2:28 AM, 殷啟聰 <seamlikok@gmail.com> wrote:
>> I haven't dug too much about your package, but I think you are right
>> about Proguard missing the POM files. Currently "proguard" does not
>> generate maven-repo data which are POMs stored in
>> /usr/share/maven-repo. It will be great to submit a wishlist bug to
>> src:proguard, but if you want to get your package prepared soon you
>> can avoid using gradle-debian-helper (--buildsystem=gradle) by
>> directly invoking Gradle in your debian/rules. But you need to do some
>> extra work:
>
> Thanks for your reply in detail!
> For the lack of POMs for proguard, it seems fine since you introduced
> me the workaround.
>
>> # 1. Invoking Gradle
>>
>> See <http://anonscm.debian.org/cgit/pkg-java/bintray-client-java.git/tree/debian/rules?h=debian/0.8.1-1>.
>> The point is you need to add "--offline --gradle-user-home
>> .gradlehome" and after the invocation you need to remove .gradle and
>> .gradlehome.
>> # 2. Patch build scripts
>>
>> Replace all repository closures with:
>>
>> repositories {
>>   flatDir { dirs '/usr/share/java' }
>>   maven { url 'file:///usr/share/maven-repo' }
>> }
>
> I have no experienced in java related packaging, so I didn't get what
> you said at first.
> But I found a patch to migrate from the way you proposed to what I
> have been used:
> - http://lists.alioth.debian.org/pipermail/pkg-java-commits/2015-October/046387.html
>
> What I need is actually "reverse" version of above patch. (of course
> with a few changes)
> Now I have overcome the "proguard" library issue.
>
> However, I met new dependency issue, log as below.
> ==========================
> Evaluating project ':smali' using build file
> '/home/roger/smali/smali/build.gradle'.
> Compiling build file '/home/roger/smali/smali/build.gradle' using
> SubsetScriptTransformer.
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> A problem occurred configuring project ':smali'.
>> Could not resolve all dependencies for configuration ':smali:classpath'.
>    > Could not find co.tomlee.gradle.plugins:gradle-jflex-plugin:0.0.2.
>      Searched in the following locations:
>          file:/usr/share/java/gradle-jflex-plugin-0.0.2.jar
>          file:/usr/share/java/gradle-jflex-plugin.jar
>          file:/usr/share/maven-repo/co/tomlee/gradle/plugins/gradle-jflex-plugin/0.0.2/gradle-jflex-plugin-0.0.2.pom
>          file:/usr/share/maven-repo/co/tomlee/gradle/plugins/gradle-jflex-plugin/0.0.2/gradle-jflex-plugin-0.0.2.jar
> ==========================
>
> I find a few "grandle plugins" in pkg libgradle-plugins-java, which is
> produced by src:gradle.
> But gradle-jflex is not covered by libgradle-plugins-java, so I guess
> I need to package it myself.
> The upstream is:
> -  https://github.com/thomaslee/gradle-jflex-plugin
>
> I just want to confirm my understanding is correct. Thank you!
>
> Cheers,
> Roger



-- 
/*
* 殷啟聰 | Kai-Chung Yan
* 一生只向真理與妻子低頭
* Full-time student of National Taichung University of Education
* LinkedIn: <https://linkedin.com/in/seamlik>
* Blog: <seamlik.logdown.com>
*/


Reply to: