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

chore: prep the repo for automated release #599

Merged
merged 16 commits into from
Jan 31, 2020
Merged

chore: prep the repo for automated release #599

merged 16 commits into from
Jan 31, 2020

Conversation

eshanholtz
Copy link
Contributor

No description provided.

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Jan 29, 2020
@eshanholtz
Copy link
Contributor Author

So as far as I can still, this is still going to require manually going into Sonatype to promote the deployment from Staging to Release to get it to Maven Central. I haven't quite figured out why the twilio-java repo doesn't have this manual step, even though we also upload to Sonatype. I'd like some feedback on whether we should try to pivot off of Gradle and set up the repo to be more in line with twilio-java before I propagate similar changes to the other SG java repos.

@thinkingserious
Copy link
Contributor

thinkingserious commented Jan 30, 2020

I'm in favor of pivoting from gradle to mvn. However, I have not been able to get it to function properly.

Here are the steps I took:

  1. Made these modifications
  2. Created an Example.java file with the following contents:
import com.sendgrid.*;
import java.io.IOException;

public class Example {
  public static void main(String[] args) throws IOException {
    Email from = new Email("[email protected]");
    String subject = "Hello World from the Twilio SendGrid Java Library!";
    Email to = new Email("[email protected]");
    Content content = new Content("text/html", "<bold>Test Invalid Emails");
    Mail mail = new Mail(from, subject, to, content);

    SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
    Request request = new Request();
    try {
      request.setMethod(Method.POST);
      request.setEndpoint("mail/send");
      request.setBody(mail.build());
      System.out.println(mail.build());
      Response response = sg.api(request);
      System.out.println(response.getStatusCode());
      System.out.println(response.getBody());
      System.out.println(response.getHeaders());
    } catch (IOException ex) {
      throw ex;
    }
  }
}
  1. Tried to compile with:

javac -cp ~/Workspace/twilio-sendgrid/sendgrid-java/target/sendgrid-java-4.4.1-jar-with-dependencies.jar:. ./Example.java

  1. Received these errors:
Example.java
./Example.java:6: error: cannot find symbol
    Email from = new Email("[email protected]");
    ^
  symbol:   class Email
  location: class Example
./Example.java:6: error: cannot find symbol
    Email from = new Email("[email protected]");
                     ^
  symbol:   class Email
  location: class Example
./Example.java:8: error: cannot find symbol
    Email to = new Email("[email protected]");
    ^
  symbol:   class Email
  location: class Example
./Example.java:8: error: cannot find symbol
    Email to = new Email("[email protected]");
                   ^
  symbol:   class Email
  location: class Example
./Example.java:9: error: cannot find symbol
    Content content = new Content("text/html", "<bold>Test Invalid Emails");
    ^
  symbol:   class Content
  location: class Example
./Example.java:9: error: cannot find symbol
    Content content = new Content("text/html", "<bold>Test Invalid Emails");
                          ^
  symbol:   class Content
  location: class Example
./Example.java:10: error: cannot find symbol
    Mail mail = new Mail(from, subject, to, content);
    ^
  symbol:   class Mail
  location: class Example
./Example.java:10: error: cannot find symbol
    Mail mail = new Mail(from, subject, to, content);
                    ^
  symbol:   class Mail
  location: class Example
8 errors

Note that if I download the .jar from here: https://github.com/sendgrid/sendgrid-java/releases/download/v4.4.1/sendgrid-java.jar and run javac -cp ~/Downloads/sendgrid-java.jar:. ./Example.java, compilation is successful.

Also, if I run jar tf ~/Workspace/twilio-sendgrid/sendgrid-java/target/sendgrid-java-4.4.1-jar-with-dependencies.jar, it does seem that the classes are there (note I filtered out all dependencies except sendgrid):

META-INF/MANIFEST.MF
META-INF/
com/
com/sendgrid/
com/sendgrid/helpers/
com/sendgrid/helpers/mail/
com/sendgrid/helpers/mail/objects/
META-INF/maven/com.sendgrid/
META-INF/maven/com.sendgrid/sendgrid-java/
com/sendgrid/Client$1.class
com/sendgrid/Client.class
com/sendgrid/HttpDeleteWithBody.class
com/sendgrid/Method.class
com/sendgrid/Request.class
com/sendgrid/Response.class
com/sendgrid/SendGridResponseHandler.class
com/sendgrid/SendGridAPI.class
com/sendgrid/SendGrid$1.class
com/sendgrid/APICallback.class
com/sendgrid/SendGrid$2.class
com/sendgrid/SendGrid.class
com/sendgrid/helpers/mail/objects/SpamCheckSetting.class
com/sendgrid/helpers/mail/objects/Attachments$Builder.class
com/sendgrid/helpers/mail/objects/OpenTrackingSetting.class
com/sendgrid/helpers/mail/objects/Setting.class
com/sendgrid/helpers/mail/objects/GoogleAnalyticsSetting.class
com/sendgrid/helpers/mail/objects/ASM.class
com/sendgrid/helpers/mail/objects/FooterSetting.class
com/sendgrid/helpers/mail/objects/Personalization.class
com/sendgrid/helpers/mail/objects/Email.class
com/sendgrid/helpers/mail/objects/MailSettings.class
com/sendgrid/helpers/mail/objects/BccSettings.class
com/sendgrid/helpers/mail/objects/Content.class
com/sendgrid/helpers/mail/objects/TrackingSettings.class
com/sendgrid/helpers/mail/objects/ClickTrackingSetting.class
com/sendgrid/helpers/mail/objects/Attachments.class
com/sendgrid/helpers/mail/objects/ContentVerifier.class
com/sendgrid/helpers/mail/objects/SubscriptionTrackingSetting.class
com/sendgrid/helpers/mail/Mail.class
com/sendgrid/RateLimitException.class
META-INF/maven/com.sendgrid/sendgrid-java/pom.xml
META-INF/maven/com.sendgrid/sendgrid-java/pom.properties

Running the above command on the downloaded jar, reveals:

META-INF/
META-INF/MANIFEST.MF
com/sendgrid/
com/sendgrid/SendGridAPI.class
com/sendgrid/SpamCheckSetting.class
com/sendgrid/Attachments$Builder.class
com/sendgrid/OpenTrackingSetting.class
com/sendgrid/SendGridResponseHandler.class
com/sendgrid/Setting.class
com/sendgrid/GoogleAnalyticsSetting.class
com/sendgrid/ASM.class
com/sendgrid/FooterSetting.class
com/sendgrid/Personalization.class
com/sendgrid/Client$1.class
com/sendgrid/Method.class
com/sendgrid/Response.class
com/sendgrid/Email.class
com/sendgrid/Client.class
com/sendgrid/SendGrid$1.class
com/sendgrid/MailSettings.class
com/sendgrid/BccSettings.class
com/sendgrid/Request.class
com/sendgrid/Content.class
com/sendgrid/APICallback.class
com/sendgrid/TrackingSettings.class
com/sendgrid/Mail.class
com/sendgrid/SendGrid$2.class
com/sendgrid/ClickTrackingSetting.class
com/sendgrid/SendGrid.class
com/sendgrid/Attachments.class
com/sendgrid/ContentVerifier.class
com/sendgrid/SubscriptionTrackingSetting.class
com/sendgrid/HttpDeleteWithBody.class
com/sendgrid/RateLimitException.class
com/sendgrid/helpers/
com/sendgrid/helpers/mail/
com/sendgrid/helpers/mail/Mail.class
com/sendgrid/helpers/mail/objects/
com/sendgrid/helpers/mail/objects/SpamCheckSetting.class
com/sendgrid/helpers/mail/objects/Attachments$Builder.class
com/sendgrid/helpers/mail/objects/OpenTrackingSetting.class
com/sendgrid/helpers/mail/objects/Setting.class
com/sendgrid/helpers/mail/objects/GoogleAnalyticsSetting.class
com/sendgrid/helpers/mail/objects/ASM.class
com/sendgrid/helpers/mail/objects/FooterSetting.class
com/sendgrid/helpers/mail/objects/Personalization.class
com/sendgrid/helpers/mail/objects/Email.class
com/sendgrid/helpers/mail/objects/MailSettings.class
com/sendgrid/helpers/mail/objects/BccSettings.class
com/sendgrid/helpers/mail/objects/Content.class
com/sendgrid/helpers/mail/objects/TrackingSettings.class
com/sendgrid/helpers/mail/objects/ClickTrackingSetting.class
com/sendgrid/helpers/mail/objects/Attachments.class
com/sendgrid/helpers/mail/objects/ContentVerifier.class
com/sendgrid/helpers/mail/objects/SubscriptionTrackingSetting.class

I'm currently investigating the differences between the twilio-java pom.xml and the sendgrid-java pom.xml for ideas on what could be missing.

@thinkingserious
Copy link
Contributor

If I add these two imports, it works:

import com.sendgrid.helpers.mail.objects.*;
import com.sendgrid.helpers.mail.*;

Copy link
Contributor

@thinkingserious thinkingserious left a comment

Choose a reason for hiding this comment

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

Sam wrote some code to upload the packaged file to the release on GitHub for PHP. I believe we want to do the same with the generated jar so that it shows up here: https://github.com/sendgrid/sendgrid-java/releases/tag/v4.4.1

.travis.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@childish-sambino childish-sambino left a comment

Choose a reason for hiding this comment

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

test

@eshanholtz eshanholtz merged commit 6a5d049 into master Jan 31, 2020
@eshanholtz eshanholtz deleted the librarian branch January 31, 2020 19:13
@thinkingserious
Copy link
Contributor

Hello @eshanholtz,

Thanks again for the PR!

We appreciate your contribution and look forward to continued collaboration. Thanks!

Team SendGrid DX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants