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

Simplify Gson setup #6833

Merged
merged 1 commit into from
Nov 17, 2021
Merged

Simplify Gson setup #6833

merged 1 commit into from
Nov 17, 2021

Conversation

Marcono1234
Copy link
Contributor

Tries to simplify the Gson setup as described in #6742 (comment).

I cannot easily verify that this works because I am using Windows, therefore I have marked this pull request as draft.

$MVN --batch-mode --update-snapshots verify ${MAVEN_ARGS}
MAVEN_ARGS="-DskipTests -Dmaven.compiler.release=8 -X"
# Only build 'gson' Maven module
cd gson
Copy link
Contributor Author

@Marcono1234 Marcono1234 Nov 16, 2021

Choose a reason for hiding this comment

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

Could also alternatively run Maven for the parent project and only build the gson module as described in https://stackoverflow.com/a/3899772, though this approach here works as well.
Do you prefer one solution over the other?

@DavidKorczynski
Copy link
Collaborator

From the CI:

/src/gson/gson/src/test/java/com/google/gson/internal/LinkedTreeMapTest.java:[164,20] Invalid java.lang.SafeVarargs annotation. Instance method <T>assertIterationOrder(java.lang.Iterable<T>,T...) is not final.

It looks like you're running into the same issue as I described here #6742 (comment)

@Marcono1234
Copy link
Contributor Author

You are right sorry. Should be fixed now. Can you please run the CI workflows again?

@Marcono1234
Copy link
Contributor Author

The build is now failing because for execution of ProGuard (which is part of the tests) the jmods/java.base.jmod file is needed. However, to reduce the size of the Docker image the jmods directory is removed here:

rm -rf $JAVA_HOME/jmods $JAVA_HOME/lib/src.zip

I have disabled ProGuard execution now as well and at least locally when manually invoking Maven this configuration seems to work.

Copy link
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

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

Wonderful, thanks for simplifying this!

@DavidKorczynski DavidKorczynski marked this pull request as ready for review November 17, 2021 23:16
@DavidKorczynski DavidKorczynski merged commit 753ab21 into google:master Nov 17, 2021
@Marcono1234 Marcono1234 deleted the simplify-gson-setup branch November 17, 2021 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants