From 35241fc7b271f52ddf9524aea8b620806cc61396 Mon Sep 17 00:00:00 2001 From: JFronny Date: Thu, 12 May 2022 23:23:14 +0200 Subject: [PATCH] Add comment support --- .gitlab-ci.yml | 20 ++++++++++++++++++ README.md | 16 ++++++++++++++ ci_settings.xml | 16 ++++++++++++++ extras/pom.xml | 4 ++-- gson/pom.xml | 6 +++++- .../com/google/gson/stream/JsonWriter.java | 20 +++++++++++++++++- .../ReflectionAccessFilterTest.java | 6 +++--- metrics/pom.xml | 4 ++-- pom.xml | 21 +++++++++++++++++-- proto/pom.xml | 4 ++-- 10 files changed, 104 insertions(+), 13 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 ci_settings.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..6a209246 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +variables: + MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" + MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" + +image: maven:3-openjdk-11 + +cache: + paths: + - .m2/repository + +deploy:jdk8: + stage: deploy + script: + - if [ ! -f ci_settings.xml ]; + then echo "CI settings missing\! If deploying to GitLab Maven Repository, please see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html#create-maven-packages-with-gitlab-cicd for instructions."; + fi + - 'mvn $MAVEN_CLI_OPTS deploy -s ci_settings.xml' + only: + variables: + - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH diff --git a/README.md b/README.md index b3c5b550..bf3f486b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ +# About this fork + +This fork of Gson adds support for writing comments in JsonWriter. +To do this, JsonWriter and CommentsTest were adjusted. +Please be aware that I also increased the minimum java version to 11 +To use this, add the following: +```groovy +maven { + url = 'https://gitlab.com/api/v4/projects/35030495/packages/maven' +} + +dependencies { + implementation('io.gitlab.jfronny:gson:+') +} +``` + # Gson Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. diff --git a/ci_settings.xml b/ci_settings.xml new file mode 100644 index 00000000..da49fc0f --- /dev/null +++ b/ci_settings.xml @@ -0,0 +1,16 @@ + + + + gitlab-maven + + + + Job-Token + ${CI_JOB_TOKEN} + + + + + + \ No newline at end of file diff --git a/extras/pom.xml b/extras/pom.xml index 7690f813..7b28d442 100644 --- a/extras/pom.xml +++ b/extras/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - com.google.code.gson + io.gitlab.jfronny gson-parent 2.9.1-SNAPSHOT @@ -25,7 +25,7 @@ - com.google.code.gson + io.gitlab.jfronny gson ${project.parent.version} diff --git a/gson/pom.xml b/gson/pom.xml index ab1b779c..ebe52220 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - com.google.code.gson + io.gitlab.jfronny gson-parent 2.9.1-SNAPSHOT @@ -41,6 +41,10 @@ + + 11 + 11 +