JBirdVegas / external_jbirdvegas_mGerrit

mGerrit is a Gerrit instance viewer
19 stars 8 forks source link

Build with rest library from jitpack #57

Closed est31 closed 8 years ago

est31 commented 8 years ago

See my comment in #49. Using the jitpack build is required by f-droid as f-droid doesn't allow binaries. jitpack enforces f-droid's source only policy so using it is okay. Its also good for your project as it keeps the repo size small when you want to update the rest client.

Also its more transparent as the source commit is known.

Updating the version is very easy: just change the commit hash to the hash of the commit you want to update to.

p4r4n01d commented 8 years ago

Where can I find the source of this build on jitpack as I want to compare it against the jar it is to replace. I build the jar from here: https://github.com/p4r4n01d/gerrit-rest-java-client/tree/httpclient-android

est31 commented 8 years ago

The source matches the source of the repo on github, see also the docs on jitpack. You have multiple options to specify the version, but I suggest against using -SNAPSHOT based versions as they can't be updated easily (-SNAPSHOT once build doesn't update if the branch updates). The best way is to directly use git commit hashes.

So in the particuar case of this PR, its commit https://github.com/uwolfer/gerrit-rest-java-client/commit/0916433cc2d the jar is built with. I think you want it to point to the latest commit of your linked branch? I'll update it to point to commit https://github.com/p4r4n01d/gerrit-rest-java-client/commit/21e71c1242212e92de6cacebc5b8d216013056e3

If you later on want to update the library, just change the commit hash.

est31 commented 8 years ago

Updated

p4r4n01d commented 8 years ago

Having some trouble compiling with this: If I try either compile('com.github.p4r4n01d:gerrit-rest-java-client:21e71c12422') { exclude module: 'httpclient' } or compile('com.github.uwolfer:gerrit-rest-java-client:35856ab8bd9') { exclude module: 'httpclient' } The build fails with a "failed to resolve ..." error. Is there anything else I have to do here?

I have pretty much ceased development on my fork of the Gerrit REST API library & Urs is keeping the android branch up-to-date which is really nice. I forgot to submit a PR for my last change to fix the delete request not working on the Android branch. So you might want to do another release to fix that (especially if you used the master branch of the library which is completely broken in Android - simply swapping out the dependencies is not enough).

est31 commented 8 years ago

Have you added the jitpack repo as dependency like I did in the PR?

p4r4n01d commented 8 years ago

Yes I did that and had a look at Jitpack website to see if I was missing anything

est31 commented 8 years ago

Can you paste the full error somewhere?

est31 commented 8 years ago

And paste the build.gradle (or the diff to master) if you are not using the build.gradle from this PR.

p4r4n01d commented 8 years ago

Didn't test it properly, I put the dependency on the wrong line. All good now :+1: