Skip to content

Commit

Permalink
Feat: java record serialization/deserialization (#1842)
Browse files Browse the repository at this point in the history
  • Loading branch information
milaGGL authored Sep 25, 2024
1 parent 310d680 commit aff93bf
Show file tree
Hide file tree
Showing 21 changed files with 3,478 additions and 1,280 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- run: .kokoro/build.sh
env:
JOB_TYPE: test
JAVA_VERSION: ${{matrix.java}}
windows:
runs-on: windows-latest
steps:
Expand Down
7 changes: 6 additions & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ set +e
case ${JOB_TYPE} in
test)
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT}
if [[ "${JAVA_VERSION}" == "17" ]]; then
# Activate the runTestsWithJava17 profile inside google-cloud-firestore
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT} -DrunTestsWithJava17=true
else
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT}
fi
RETURN_CODE=$?
;;
lint)
Expand Down
49 changes: 49 additions & 0 deletions google-cloud-firestore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,54 @@
</dependency>
</dependencies>
</profile>
<profile>
<!-- JDK17 set up for tests in src/test-jdk17 -->
<id>java17-test</id>
<activation>
<!-- Activate the tests only on CI unit(17) tests using flag -->
<property>
<name>runTestsWithJava17</name>
<value>true</value>
</property>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-test-source</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test-jdk17/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<!-- Enable Java 17 for all sources so that Intellij picks the right language level -->
<source>17</source>
<release>17</release>
<compilerArgs>
<arg>-parameters</arg>
<arg>--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
<arg>--add-opens=java.base/java.util=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.api.gax.rpc.ApiException;
import com.google.api.gax.rpc.ApiExceptions;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.firestore.encoding.CustomClassMapper;
import com.google.cloud.firestore.spi.v1.FirestoreRpc;
import com.google.cloud.firestore.telemetry.TraceUtil;
import com.google.cloud.firestore.telemetry.TraceUtil.Scope;
Expand Down
Loading

0 comments on commit aff93bf

Please sign in to comment.