Skip to content

Conversation

@shauvik
Copy link
Contributor

@shauvik shauvik commented Jan 27, 2017

To build fatJar, apply this PR patch and simply call ./gradlew shadowJar

Change list

  • Adding support for the new gradle plugins block
  • Using the shadow plugin to create a fatJar for appium java client.

Types of changes

What types of changes are you proposing/introducing to Java client?
Put an x in the boxes that apply

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

  • Usage of plugins block makes buildscript terse
  • Allowing building fatJars helps makes life easy for cmd line usage.

* Adding support for the new gradle plugins block
* Using the shadow plugin to create a fatJar for appium java client.
@jsf-clabot
Copy link

jsf-clabot commented Jan 27, 2017

CLA assistant check
All committers have signed the CLA.

build.gradle Outdated
@@ -1,3 +1,8 @@
plugins {
id "org.owasp.dependencycheck" version "1.4.5"
id "com.github.johnrengelman.shadow" version "1.2.4"
Copy link
Member

@SrinivasanTarget SrinivasanTarget Jan 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see shadow by default uses jfrog repo but we are publishing only to maven repo. Where are we specifying class path for owasp dependency check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifying it using the plugins block makes it download the dependencies from plugins.gradle.org... Specifically here: https://plugins.gradle.org/plugin/org.owasp.dependencycheck

There is also an option of the longer buildscript{} if you wanted to get dependencies the old way..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it but does it set the classpath as well? Also as i said before we need to explicitly set the repository as maven repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I did some digging. Seems like gradle plugins block uses http://plugins.gradle.com/m2 which simply redirects all requests to jcenter.

~ curl -I https://plugins.gradle.org/m2/junit/junit/4.12/junit-4.12.pom
HTTP/1.1 303 See Other
Date: Fri, 27 Jan 2017 10:32:44 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: __cfduid=dfb3ae2221aa16499509023673d8240ee1485513164; expires=Sat, 27-Jan-18 10:32:44 GMT; path=/; domain=.gradle.org; HttpOnly
Location: https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom
Via: 1.1 vegur
Server: cloudflare-nginx
CF-RAY: 327b8adfa92f0a00-ATL

Also, it seems that the gradle plugins website keeps the classpath mapping, as documented in their submission and reclaiming of groupIds docs.
https://plugins.gradle.org/docs/submit
https://plugins.gradle.org/docs/reclaiming

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then as per your findings, we cannot accept this change since our main source of repository is maven central not jcenter. :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also may i know where does shadow benefits users? What is your usecase behind it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shauvik Can you make necessary changes to point the repo back to maven central?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Had to add a jcenter dependency to buildscript, since shadow is only available there.

@shauvik
Copy link
Contributor Author

shauvik commented Jan 27, 2017 via email

@SrinivasanTarget
Copy link
Member

@shauvik Ok Thanks

shadow is only on jcenter. So, need to add it to buildscript for satisfying dependency.
Copy link
Member

@SrinivasanTarget SrinivasanTarget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SrinivasanTarget SrinivasanTarget merged commit 6f4d1e0 into appium:master Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants