Convert codegen, metrics and proto to Maven submodules (#2008)
* Convert codegen, metrics and proto to Maven submodules * Fix import order
This commit is contained in:
parent
a92bbf849c
commit
cc505e1b9f
172
codegen/pom.xml
172
codegen/pom.xml
|
@ -1,170 +1,76 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<parent>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson-parent</artifactId>
|
||||||
|
<version>2.9.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<artifactId>gson-codegen</artifactId>
|
<artifactId>gson-codegen</artifactId>
|
||||||
<packaging>jar</packaging>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<inceptionYear>2008</inceptionYear>
|
<inceptionYear>2008</inceptionYear>
|
||||||
<name>Gson Code Gen</name>
|
<name>Gson Code Gen</name>
|
||||||
<parent>
|
|
||||||
<groupId>org.sonatype.oss</groupId>
|
|
||||||
<artifactId>oss-parent</artifactId>
|
|
||||||
<version>7</version>
|
|
||||||
</parent>
|
|
||||||
<url>http://code.google.com/p/google-gson/</url>
|
|
||||||
<description>Google Gson grab bag of utilities, type adapters, etc.</description>
|
<description>Google Gson grab bag of utilities, type adapters, etc.</description>
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>The Apache Software License, Version 2.0</name>
|
<name>Apache-2.0</name>
|
||||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||||
<distribution>repo</distribution>
|
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
<scm>
|
|
||||||
<connection>scm:svn:http://google-gson.googlecode.com/svn/trunk/extras</connection>
|
|
||||||
<developerConnection>scm:svn:https://google-gson.googlecode.com/svn/trunk/extras</developerConnection>
|
|
||||||
<url>http://google-gson.codegoogle.com/svn/trunk/extras</url>
|
|
||||||
</scm>
|
|
||||||
<issueManagement>
|
|
||||||
<system>Google Code Issue Tracking</system>
|
|
||||||
<url>http://code.google.com/p/google-gson/issues/list</url>
|
|
||||||
</issueManagement>
|
|
||||||
<organization>
|
<organization>
|
||||||
<name>Google, Inc.</name>
|
<name>Google, Inc.</name>
|
||||||
<url>http://www.google.com</url>
|
<url>https://www.google.com</url>
|
||||||
</organization>
|
</organization>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.13.1</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<profiles>
|
|
||||||
<!-- Activate PGP signing only when performing a release -->
|
|
||||||
<profile>
|
|
||||||
<id>release-sign-artifacts</id>
|
|
||||||
<activation>
|
|
||||||
<property>
|
|
||||||
<name>performRelease</name>
|
|
||||||
<value>true</value>
|
|
||||||
</property>
|
|
||||||
</activation>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>1.4</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>package</defaultGoal>
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.5.1</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.6</source>
|
|
||||||
<target>1.6</target>
|
|
||||||
<compilerArgument>-proc:none</compilerArgument>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>2.4</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
|
<!-- First compile without without annotation processing, then
|
||||||
|
compile again, see https://stackoverflow.com/a/36250332 -->
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<id>default-compile</id>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgument>-proc:none</compilerArgument>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>compile-project</id>
|
||||||
|
<phase>compile</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar</goal>
|
<goal>compile</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
|
||||||
<archive>
|
|
||||||
<addMavenDescriptor>false</addMavenDescriptor>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>2.1.2</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>2.8.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<links>
|
|
||||||
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
|
|
||||||
</links>
|
|
||||||
<version>true</version>
|
|
||||||
<show>public</show>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-eclipse-plugin</artifactId>
|
|
||||||
<version>2.9</version>
|
|
||||||
<configuration>
|
|
||||||
<downloadSources>true</downloadSources>
|
|
||||||
<downloadJavadocs>true</downloadJavadocs>
|
|
||||||
<workspace>
|
|
||||||
../eclipse-ws/
|
|
||||||
</workspace>
|
|
||||||
<workspaceCodeStylesURL>
|
|
||||||
file:///${basedir}/../lib/gson-formatting-styles.xml
|
|
||||||
</workspaceCodeStylesURL>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
|
||||||
<!-- version>2.3.2</version -->
|
|
||||||
<configuration>
|
|
||||||
<arguments>-DenableCiProfile=true</arguments>
|
|
||||||
<tagBase>https://google-gson.googlecode.com/svn/tags/</tagBase>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>3.0.0-M1</version>
|
||||||
|
<configuration>
|
||||||
|
<!-- Not deployed -->
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
<name>Inderjeet Singh</name>
|
<name>Inderjeet Singh</name>
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>gson-extras</artifactId>
|
<artifactId>gson-extras</artifactId>
|
||||||
<packaging>jar</packaging>
|
|
||||||
<version>2.9.0-SNAPSHOT</version>
|
|
||||||
<inceptionYear>2008</inceptionYear>
|
<inceptionYear>2008</inceptionYear>
|
||||||
<name>Gson Extras</name>
|
<name>Gson Extras</name>
|
||||||
<description>Google Gson grab bag of utilities, type adapters, etc.</description>
|
<description>Google Gson grab bag of utilities, type adapters, etc.</description>
|
||||||
|
|
33
gson/pom.xml
33
gson/pom.xml
|
@ -31,6 +31,39 @@
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default-compile</id>
|
||||||
|
<configuration>
|
||||||
|
<jdkToolchain>
|
||||||
|
<version>9</version>
|
||||||
|
</jdkToolchain>
|
||||||
|
<release>9</release>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>base-compile</id>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>module-info.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<jdkToolchain>
|
||||||
|
<version>[1.5,9)</version>
|
||||||
|
</jdkToolchain>
|
||||||
|
<source>1.6</source>
|
||||||
|
<target>1.6</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
|
139
metrics/pom.xml
139
metrics/pom.xml
|
@ -1,129 +1,64 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<parent>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson-parent</artifactId>
|
||||||
|
<version>2.9.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<artifactId>gson-metrics</artifactId>
|
<artifactId>gson-metrics</artifactId>
|
||||||
<packaging>jar</packaging>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<inceptionYear>2011</inceptionYear>
|
<inceptionYear>2011</inceptionYear>
|
||||||
<name>Gson Metrics</name>
|
<name>Gson Metrics</name>
|
||||||
<parent>
|
|
||||||
<groupId>org.sonatype.oss</groupId>
|
|
||||||
<artifactId>oss-parent</artifactId>
|
|
||||||
<version>5</version>
|
|
||||||
</parent>
|
|
||||||
<url>http://code.google.com/p/google-gson/</url>
|
|
||||||
<description>Performance Metrics for Google Gson library</description>
|
<description>Performance Metrics for Google Gson library</description>
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>The Apache Software License, Version 2.0</name>
|
<name>Apache-2.0</name>
|
||||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||||
<distribution>repo</distribution>
|
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
<scm>
|
|
||||||
<connection>scm:svn:http://google-gson.googlecode.com/svn/trunk/metrics</connection>
|
|
||||||
<developerConnection>scm:svn:https://google-gson.googlecode.com/svn/trunk/metrics</developerConnection>
|
|
||||||
<url>http://google-gson.codegoogle.com/svn/trunk/metrics</url>
|
|
||||||
</scm>
|
|
||||||
<issueManagement>
|
|
||||||
<system>Google Code Issue Tracking</system>
|
|
||||||
<url>http://code.google.com/p/google-gson/issues/list</url>
|
|
||||||
</issueManagement>
|
|
||||||
<organization>
|
<organization>
|
||||||
<name>Google, Inc.</name>
|
<name>Google, Inc.</name>
|
||||||
<url>http://www.google.com</url>
|
<url>https://www.google.com</url>
|
||||||
</organization>
|
</organization>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>1.7.2-SNAPSHOT</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.caliper</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>2.13.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.caliper</groupId>
|
||||||
<artifactId>caliper</artifactId>
|
<artifactId>caliper</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>0.5-rc1</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.13.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>package</defaultGoal>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
<version>2.3.2</version>
|
<version>3.0.0-M1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.6</source>
|
<!-- Not deployed -->
|
||||||
<target>1.6</target>
|
<skip>true</skip>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
</plugins>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
</pluginManagement>
|
||||||
<artifactId>maven-eclipse-plugin</artifactId>
|
|
||||||
<version>2.8</version>
|
|
||||||
<configuration>
|
|
||||||
<downloadSources>true</downloadSources>
|
|
||||||
<downloadJavadocs>true</downloadJavadocs>
|
|
||||||
<workspace>../eclipse-ws/</workspace>
|
|
||||||
<workspaceCodeStylesURL>
|
|
||||||
file:///${basedir}/../lib/gson-formatting-styles.xml
|
|
||||||
</workspaceCodeStylesURL>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
<configuration>
|
|
||||||
<arguments>-DenableCiProfile=true</arguments>
|
|
||||||
<tagBase>https://google-gson.googlecode.com/svn/tags/</tagBase>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>2.1.2</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>2.7</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<links>
|
|
||||||
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
|
|
||||||
</links>
|
|
||||||
<version>true</version>
|
|
||||||
<show>public</show>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
<name>Inderjeet Singh</name>
|
<name>Inderjeet Singh</name>
|
||||||
|
|
|
@ -16,6 +16,14 @@
|
||||||
|
|
||||||
package com.google.gson.metrics;
|
package com.google.gson.metrics;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.core.JsonFactory;
|
||||||
|
import com.fasterxml.jackson.core.JsonFactoryBuilder;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.MapperFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.json.JsonMapper;
|
||||||
import com.google.caliper.Param;
|
import com.google.caliper.Param;
|
||||||
import com.google.caliper.Runner;
|
import com.google.caliper.Runner;
|
||||||
import com.google.caliper.SimpleBenchmark;
|
import com.google.caliper.SimpleBenchmark;
|
||||||
|
@ -34,11 +42,6 @@ import java.lang.reflect.Type;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.codehaus.jackson.JsonFactory;
|
|
||||||
import org.codehaus.jackson.annotate.JsonProperty;
|
|
||||||
import org.codehaus.jackson.map.DeserializationConfig;
|
|
||||||
import org.codehaus.jackson.map.ObjectMapper;
|
|
||||||
import org.codehaus.jackson.type.TypeReference;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Measure Gson and Jackson parsing and binding performance.
|
* Measure Gson and Jackson parsing and binding performance.
|
||||||
|
@ -139,6 +142,7 @@ public final class ParseBenchmark extends SimpleBenchmark {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class GsonStreamParser implements Parser {
|
private static class GsonStreamParser implements Parser {
|
||||||
|
@Override
|
||||||
public void parse(char[] data, Document document) throws Exception {
|
public void parse(char[] data, Document document) throws Exception {
|
||||||
com.google.gson.stream.JsonReader jsonReader
|
com.google.gson.stream.JsonReader jsonReader
|
||||||
= new com.google.gson.stream.JsonReader(new CharArrayReader(data));
|
= new com.google.gson.stream.JsonReader(new CharArrayReader(data));
|
||||||
|
@ -186,6 +190,7 @@ public final class ParseBenchmark extends SimpleBenchmark {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class GsonSkipParser implements Parser {
|
private static class GsonSkipParser implements Parser {
|
||||||
|
@Override
|
||||||
public void parse(char[] data, Document document) throws Exception {
|
public void parse(char[] data, Document document) throws Exception {
|
||||||
com.google.gson.stream.JsonReader jsonReader
|
com.google.gson.stream.JsonReader jsonReader
|
||||||
= new com.google.gson.stream.JsonReader(new CharArrayReader(data));
|
= new com.google.gson.stream.JsonReader(new CharArrayReader(data));
|
||||||
|
@ -195,10 +200,10 @@ public final class ParseBenchmark extends SimpleBenchmark {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class JacksonStreamParser implements Parser {
|
private static class JacksonStreamParser implements Parser {
|
||||||
|
@Override
|
||||||
public void parse(char[] data, Document document) throws Exception {
|
public void parse(char[] data, Document document) throws Exception {
|
||||||
JsonFactory jsonFactory = new JsonFactory();
|
JsonFactory jsonFactory = new JsonFactoryBuilder().configure(JsonFactory.Feature.CANONICALIZE_FIELD_NAMES, false).build();
|
||||||
org.codehaus.jackson.JsonParser jp = jsonFactory.createJsonParser(new CharArrayReader(data));
|
com.fasterxml.jackson.core.JsonParser jp = jsonFactory.createParser(new CharArrayReader(data));
|
||||||
jp.configure(org.codehaus.jackson.JsonParser.Feature.CANONICALIZE_FIELD_NAMES, false);
|
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
do {
|
do {
|
||||||
switch (jp.nextToken()) {
|
switch (jp.nextToken()) {
|
||||||
|
@ -227,8 +232,9 @@ public final class ParseBenchmark extends SimpleBenchmark {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class GsonDomParser implements Parser {
|
private static class GsonDomParser implements Parser {
|
||||||
|
@Override
|
||||||
public void parse(char[] data, Document document) throws Exception {
|
public void parse(char[] data, Document document) throws Exception {
|
||||||
new JsonParser().parse(new CharArrayReader(data));
|
JsonParser.parseReader(new CharArrayReader(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,20 +243,24 @@ public final class ParseBenchmark extends SimpleBenchmark {
|
||||||
.setDateFormat("EEE MMM dd HH:mm:ss Z yyyy")
|
.setDateFormat("EEE MMM dd HH:mm:ss Z yyyy")
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
|
@Override
|
||||||
public void parse(char[] data, Document document) throws Exception {
|
public void parse(char[] data, Document document) throws Exception {
|
||||||
gson.fromJson(new CharArrayReader(data), document.gsonType);
|
gson.fromJson(new CharArrayReader(data), document.gsonType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class JacksonBindParser implements Parser {
|
private static class JacksonBindParser implements Parser {
|
||||||
private static ObjectMapper mapper = new ObjectMapper();
|
private static final ObjectMapper mapper;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
mapper = JsonMapper.builder()
|
||||||
mapper.configure(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||||
|
.configure(MapperFeature.AUTO_DETECT_FIELDS, true)
|
||||||
|
.build();
|
||||||
mapper.setDateFormat(new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy"));
|
mapper.setDateFormat(new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void parse(char[] data, Document document) throws Exception {
|
public void parse(char[] data, Document document) throws Exception {
|
||||||
mapper.readValue(new CharArrayReader(data), document.jacksonType);
|
mapper.readValue(new CharArrayReader(data), document.jacksonType);
|
||||||
}
|
}
|
||||||
|
|
32
pom.xml
32
pom.xml
|
@ -21,6 +21,9 @@
|
||||||
<modules>
|
<modules>
|
||||||
<module>gson</module>
|
<module>gson</module>
|
||||||
<module>extras</module>
|
<module>extras</module>
|
||||||
|
<module>codegen</module>
|
||||||
|
<module>metrics</module>
|
||||||
|
<module>proto</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -65,35 +68,6 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.8.1</version>
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>default-compile</id>
|
|
||||||
<configuration>
|
|
||||||
<jdkToolchain>
|
|
||||||
<version>9</version>
|
|
||||||
</jdkToolchain>
|
|
||||||
<release>9</release>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>base-compile</id>
|
|
||||||
<goals>
|
|
||||||
<goal>compile</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<excludes>
|
|
||||||
<exclude>module-info.java</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<jdkToolchain>
|
|
||||||
<version>[1.5,9)</version>
|
|
||||||
</jdkToolchain>
|
|
||||||
<source>1.6</source>
|
|
||||||
<target>1.6</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
194
proto/pom.xml
194
proto/pom.xml
|
@ -4,79 +4,45 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<parent>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson-parent</artifactId>
|
||||||
|
<version>2.9.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<artifactId>proto</artifactId>
|
<artifactId>proto</artifactId>
|
||||||
<packaging>jar</packaging>
|
|
||||||
<version>0.6-SNAPSHOT</version>
|
|
||||||
<name>Gson Protobuf Support</name>
|
<name>Gson Protobuf Support</name>
|
||||||
<description>Gson support for Protobufs</description>
|
<description>Gson support for Protobufs</description>
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<distributionManagement>
|
|
||||||
<repository>
|
|
||||||
<id>local.repo</id>
|
|
||||||
<name>file repository to svn</name>
|
|
||||||
<url>file://${basedir}/../../mavenrepo</url>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>gson</id>
|
|
||||||
<url>http://google-gson.googlecode.com/svn/mavenrepo</url>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</snapshots>
|
|
||||||
<releases>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</releases>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>The Apache Software License, Version 2.0</name>
|
<name>Apache-2.0</name>
|
||||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||||
<distribution>repo</distribution>
|
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
<scm>
|
|
||||||
<connection>scm:svn:http://google-gson.googlecode.com/svn/trunk/proto</connection>
|
|
||||||
<developerConnection>scm:svn:https://google-gson.googlecode.com/svn/trunk/proto</developerConnection>
|
|
||||||
<url>http://google-gson.codegoogle.com/svn/trunk/proto</url>
|
|
||||||
</scm>
|
|
||||||
<issueManagement>
|
|
||||||
<system>Google Code Issue Tracking</system>
|
|
||||||
<url>http://code.google.com/p/google-gson/issues/list</url>
|
|
||||||
</issueManagement>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- Gson: Java to Json conversion -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.8.9</version>
|
<version>${project.parent.version}</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.protobuf</groupId>
|
<groupId>com.google.protobuf</groupId>
|
||||||
<artifactId>protobuf-java</artifactId>
|
<artifactId>protobuf-java</artifactId>
|
||||||
<version>4.0.0-rc-2</version>
|
<version>4.0.0-rc-2</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>30.1.1-jre</version>
|
<version>30.1.1-jre</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.13.2</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -90,125 +56,49 @@
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>gson-proto</finalName>
|
<finalName>gson-proto</finalName>
|
||||||
|
<!-- Setup based on https://quarkus.io/guides/grpc-getting-started#generating-java-files-from-proto-with-protobuf-maven-plugin -->
|
||||||
|
<extensions>
|
||||||
|
<extension>
|
||||||
|
<groupId>kr.motd.maven</groupId>
|
||||||
|
<artifactId>os-maven-plugin</artifactId>
|
||||||
|
<version>1.7.0</version>
|
||||||
|
</extension>
|
||||||
|
</extensions>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-antrun-plugin</artifactId>
|
<groupId>org.xolstice.maven.plugins</groupId>
|
||||||
<version>1.8</version>
|
<artifactId>protobuf-maven-plugin</artifactId>
|
||||||
|
<version>0.6.1</version>
|
||||||
|
<configuration>
|
||||||
|
<protocArtifact>com.google.protobuf:protoc:3.17.3:exe:${os.detected.classifier}</protocArtifact>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>compile-protoc</id>
|
|
||||||
<phase>generate-sources</phase>
|
|
||||||
<configuration>
|
|
||||||
<tasks>
|
|
||||||
<mkdir dir="target/generated" />
|
|
||||||
<path id="proto.path">
|
|
||||||
<fileset dir="src/main/protobuf">
|
|
||||||
<include name="**/*.proto" />
|
|
||||||
</fileset>
|
|
||||||
</path>
|
|
||||||
<pathconvert pathsep=" " property="proto.files" refid="proto.path" />
|
|
||||||
<exec executable="protoc" failonerror="true">
|
|
||||||
<arg value="--java_out=src/main/java" />
|
|
||||||
<arg value="--proto_path=/usr/include" />
|
|
||||||
<arg value="-I${project.basedir}/src/main/protobuf" />
|
|
||||||
<arg line="${proto.files}" />
|
|
||||||
</exec>
|
|
||||||
</tasks>
|
|
||||||
</configuration>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>run</goal>
|
<goal>compile</goal>
|
||||||
|
<goal>test-compile</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>2.3.2</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.6</source>
|
|
||||||
<target>1.6</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-eclipse-plugin</artifactId>
|
|
||||||
<version>2.8</version>
|
|
||||||
<configuration>
|
|
||||||
<downloadSources>true</downloadSources>
|
|
||||||
<downloadJavadocs>true</downloadJavadocs>
|
|
||||||
<workspace>../eclipse-ws</workspace>
|
|
||||||
<workspaceCodeStylesURL>file:///${basedir}/../lib/gson-formatting-styles.xml</workspaceCodeStylesURL>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
|
||||||
<version>2.5.2</version>
|
|
||||||
<!-- configuration>
|
|
||||||
<updateReleaseInfo>true</updateReleaseInfo>
|
|
||||||
<createChecksum>true</createChecksum>
|
|
||||||
<groupId>${groupId}</groupId>
|
|
||||||
<artifactId>${artifactId}</artifactId>
|
|
||||||
<version>${version}</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
<classifier>sources</classifier>
|
|
||||||
<file>target/proto-sources.jar</file>
|
|
||||||
</configuration -->
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
<configuration>
|
|
||||||
<arguments>-DenableCiProfile=true</arguments>
|
|
||||||
<tagBase>https://google-gson.googlecode.com/svn/tags/</tagBase>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>2.1.2</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>2.7</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<links>
|
|
||||||
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
|
|
||||||
</links>
|
|
||||||
<version>true</version>
|
|
||||||
<show>public</show>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<descriptor>src/main/resources/assembly-descriptor.xml</descriptor>
|
|
||||||
<finalName>proto-${project.version}</finalName>
|
|
||||||
<outputDirectory>target/dist</outputDirectory>
|
|
||||||
<workDirectory>target/assembly/work</workDirectory>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>3.0.0-M1</version>
|
||||||
|
<configuration>
|
||||||
|
<!-- Not deployed -->
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
<name>Inderjeet Singh</name>
|
<name>Inderjeet Singh</name>
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
package google.gson.protobuf.generated;
|
package google.gson.protobuf.generated;
|
||||||
option java_package = "com.google.gson.protobuf.generated";
|
option java_package = "com.google.gson.protobuf.generated";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user