Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded gradle wrapper to 4.10.2 and fatjar to 0.3 #459

Closed
wants to merge 2 commits into from

Conversation

RohanTalip
Copy link
Contributor

@RohanTalip RohanTalip commented Sep 10, 2018

Checklist

  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them.
  • I updated my branch with the master branch.
  • I have added tests that prove my fix is effective or that my feature works
    • N/A.
  • I have added necessary documentation about the functionality in the appropriate .md file
    • N/A.
  • I have added in line documentation to the code I modified

Short description of what this PR does:

Upgrading to a recent gradle version allows for a gradle composite build.

The gradle wrapper was upgraded by running this command (a few times while issues were being worked out) :
./gradlew wrapper --gradle-version=4.10 --distribution-type=bin

With fatjar still at 0.1.2, this error was showing up:

Failed to apply plugin [id 'fatjar']
Could not find method add() for arguments [fatJarPrepareFiles, class eu.appsatori.gradle.fatjar.tasks.PrepareFiles] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.

Upgrading to fatjar 0.3 fixed this issue.

This pull request is similar to pull request #436, with a newer version of gradle, but is slightly smaller and also doesn't change the build.gradle file away from using the unmaintained Gradle FatJar plugin to the Gradle Shadow plugin yet (but instead upgrades it from 0.1.2 to 0.3).

…e composite build and upgraded fatjar to 0.3.

The gradle wrapper was upgraded by running this command (a few times while issues were being worked out) :
./gradlew wrapper --gradle-version=4.10 --distribution-type=bin

With fatjar still at 0.1.2, this error was showing up:

> Failed to apply plugin [id 'fatjar']
   > Could not find method add() for arguments [fatJarPrepareFiles, class eu.appsatori.gradle.fatjar.tasks.PrepareFiles] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Sep 10, 2018
@SendGridDX
Copy link
Collaborator

SendGridDX commented Sep 10, 2018

CLA assistant check
All committers have signed the CLA.

@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap difficulty: medium fix is medium in difficulty labels Sep 15, 2018
@thinkingserious
Copy link
Contributor

Thanks @RohanTalip!

This has been added to our backlog for a code review.

With Best Regards,

Elmer

@RohanTalip
Copy link
Contributor Author

RohanTalip commented Sep 15, 2018

@thinkingserious, thanks but I see you said the same thing on #436 in May and that one still hasn't been reviewed from what I can tell.

Roughly how long should I/we expect to wait for a code review?

Is this open source project still a priority for SendGrid? I'm not trying to be snarky, just expressing genuine interest, as I don't see that many recent commits and there are quite a few old open pull requests that I would expect to either be merged or closed as infeasible or not meeting the direction of the product, within N days of being opened (where N is some reasonable number like 7 or 30).

I see that you added the difficulty:medium tag to this pull request. If you or someone else at SendGrid would like to replicate what I've done, you can start with running "./gradlew wrapper --gradle-version=4.10 --distribution-type=bin" and then upgrading the fatjar dependency (or alternatively migrating to https://github.com/johnrengelman/shadow ).

I have no attachment to being the author for such a change (i.e. feel free to make this change yourselves), it would just be nice to have a recent version of Gradle embedded in the sendgrid-java project.

Regards,

Rohan

@RohanTalip
Copy link
Contributor Author

Actually, I see that Gradle 4.10.1 has been released now, so if you were going to make this change yourself, I would upgrade to that instead of 4.10: https://github.com/gradle/gradle/releases/tag/v4.10.1

@thinkingserious
Copy link
Contributor

Hi @RohanTalip,

Your PR is actually coming up soon for a review. This Java SDK (just finished Python, Node.js, PHP and C#) is next on our list to get the dynamic template helpers added and we hope to merge in many of these open PRs that have been sitting for a very long time as part of that release.

If you would be so kind to update this PR with the updated 4.10.1 version or maybe 4.10.*, that would be awesome.

With Best Regards,

Elmer

(Running "./gradlew wrapper --gradle-version=4.10.2 --distribution-type=bin" once updated the gradle/wrapper/gradle-wrapper.properties file; running it again downloaded the updated gradle/wrapper/gradle-wrapper.jar file -- not sure why it doesn't update the first time.)
@RohanTalip
Copy link
Contributor Author

RohanTalip commented Oct 2, 2018

Hi @thinkingserious, sorry, I had missed your update until now. I just updated the gradle version from 4.10 to 4.10.2.

(Personally, if I was maintaining an open source project, I would be very cautious about accepting binary changes, such as .jar files, partly for the changes being opaque and partly for security issues.
I would try and replicate the change and compare the binary files generated etc.)

@thinkingserious
Copy link
Contributor

That makes sense @RohanTalip, thanks!

@thinkingserious thinkingserious added status: waiting for feedback waiting for feedback from the submitter and removed status: code review request requesting a community code review or review from Twilio labels Oct 3, 2018
@thinkingserious
Copy link
Contributor

HI @marshallpierce,

Do you mind giving this a quick look in comparison to your PR?

Whoever's PR gets accepted in the end, both of you will be getting swag if you have not already :)

With Best Regards,

Elmer

@marshallpierce
Copy link

They're pretty similar; I tackled the fatjar -> shadow conversion mentioned here. As mentioned in the comments on mine, it's not clear what the original intent was for the fatjar, so maybe the conversion to use the shadow plugin needs additional config? It's pretty unusual for projects to generate a fat jar and put it in the project root 🤷‍♂️

@RohanTalip RohanTalip changed the title Upgraded gradle wrapper to 4.10 and fatjar to 0.3 Upgraded gradle wrapper to 4.10.2 and fatjar to 0.3 Oct 4, 2018
@RohanTalip
Copy link
Contributor Author

I see that @marshallpierce also updated his PR #436 to use 4.10.2. I cloned his repository locally and switched to his build-on-recent-java branch:

$ mkdir marshallpierce
$ cd marshallpierce
$ git clone https://github.com/marshallpierce/sendgrid-java
$ cd sendgrid-java
$ git checkout build-on-recent-java

Comparing the 2 binary gradle-wrapper.jar files (my change was on the master branch of sendgrid-java, with my fork on GitHub as the default remote repository) :
$ cd ../..
$ shasum -a 256 sendgrid/sendgrid-java/gradle/wrapper/gradle-wrapper.jar marshallpierce/sendgrid-java/gradle/wrapper/gradle-wrapper.jar
ad63ba21fb91e490e0f6fd0ca7d4049241f0f68a454b0b3075c041c4554e611c sendgrid/sendgrid-java/gradle/wrapper/gradle-wrapper.jar
ad63ba21fb91e490e0f6fd0ca7d4049241f0f68a454b0b3075c041c4554e611c marshallpierce/sendgrid-java/gradle/wrapper/gradle-wrapper.jar

Double checking:
$ diff -s sendgrid/sendgrid-java/gradle/wrapper/gradle-wrapper.jar marshallpierce/sendgrid-java/gradle/wrapper/gradle-wrapper.jar
Files sendgrid/sendgrid-java/gradle/wrapper/gradle-wrapper.jar and marshallpierce/sendgrid-java/gradle/wrapper/gradle-wrapper.jar are identical

Checking the scripts:

$ shasum -a 256 sendgrid/sendgrid-java/gradlew* marshallpierce/sendgrid-java/gradlew*
8c4c04dd98db1f00d49456dd162418a39312c5cb13d6865d783deb483bd1ed22 sendgrid/sendgrid-java/gradlew
0008d785920c9ff5cab17403e0270ccc7ceee8e169b6d67a82d96a5475fec5c9 sendgrid/sendgrid-java/gradlew.bat
8c4c04dd98db1f00d49456dd162418a39312c5cb13d6865d783deb483bd1ed22 marshallpierce/sendgrid-java/gradlew
0008d785920c9ff5cab17403e0270ccc7ceee8e169b6d67a82d96a5475fec5c9 marshallpierce/sendgrid-java/gradlew.bat

$ diff -s sendgrid/sendgrid-java/gradlew marshallpierce/sendgrid-java/gradlew
Files sendgrid/sendgrid-java/gradlew and marshallpierce/sendgrid-java/gradlew are identical

$ diff -s sendgrid/sendgrid-java/gradlew.bat marshallpierce/sendgrid-java/gradlew.bat
Files sendgrid/sendgrid-java/gradlew.bat and marshallpierce/sendgrid-java/gradlew.bat are identical

The build.gradle file is obviously going to be different between our 2 PRs.

@marshallpierce or you @thinkingserious could reproduce these checks ...

@thinkingserious
Copy link
Contributor

Thanks for the responses @marshallpierce and @RohanTalip!

One of the goals is to produce a fat jar that folks can download and add to their project directly in case they don't want to use a package manager. In the end I move that fatJar out and publish for direct download.

@marshallpierce
Copy link

That's fine, but you don't have to do the janky "host a jar on GitHub" system. You can publish a fat jar with different coordinates via bintray, etc...

@thinkingserious
Copy link
Contributor

Hi @marshallpierce,

I'm definitely open to that idea, could you please elaborate on the steps or update your PR to help us migrate to a more sensible solution? Thanks!

@marshallpierce
Copy link

I don't have the time to implement the build changes at the moment, but here's the idea: currently, this library is published at the coordinates com.sendgrid:sendgrid-java with the usual jar, pom, etc. You can see all the stuff for, say, 4.2.1 here. It's feasible to do the same thing, but with different coordinates (say, com.sendgrid:sendgrid-java-nodeps). So, one release would now generate 2 jars (one fat, one normal), and all the associated pom, etc, for each one.

That said, instead of tinkering with that, you might be better off helping customers use a build tool, like with a sample project that has Gradle set up already and is designed for customers to use as a starting point, or something like that... Projects without build automation are sad projects.

@thinkingserious
Copy link
Contributor

That's awesome feedback @marshallpierce,

Would you open to helping craft a new issue to that end?

@thinkingserious
Copy link
Contributor

Hello @RohanTalip,

Thanks again for the PR!

It's HACKTOBERFEST! We want to show our appreciation by sending you some special Hacktoberfest swag. If you have not already, could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

@thinkingserious
Copy link
Contributor

Hello @RohanTalip,

Thanks again for the PR!

We noticed that you have earned 3 out of the 5 points needed to receive glorious SendGrid Hacktoberfest swag.

Please take a moment to checkout this link to find more issues to get you past the required threshold.

Also, please be sure that you have officially registered here.

Thank you and Happy Hacktobering!

Team SendGrid DX

@thinkingserious
Copy link
Contributor

Hello @RohanTalip,

Thanks again for the PR!

You have earned 3 out of the 5 points needed to receive glorious SendGrid Hacktoberfest swag.

Please take a moment to checkout this link to find more issues to get you past the required threshold or to simply continue the celebration.

Also, please be sure you have officially registered with us here by November 1, 2018 to qualify.

If you have any questions you can email us at dx+hacktoberfest2018@sendgrid.com.

Thank you and Happy Hacktobering!

Team SendGrid

@thinkingserious thinkingserious added status: code review request requesting a community code review or review from Twilio and removed status: waiting for feedback waiting for feedback from the submitter labels May 10, 2019
@RohanTalip
Copy link
Contributor Author

RohanTalip commented Feb 4, 2020

This pull request is really old now and it looks like this project is now going to be using Maven rather than Gradle (see PR #599), so I'm going to close this PR.

@RohanTalip RohanTalip closed this Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: code review request requesting a community code review or review from Twilio type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants