Skip to content

Commit d4f85cd

Browse files
authored
Java: Support for osx-aarch_64 architecture (#569)
Update the build system to generate artifacts for MacOS on ARM64 to support Apple Silicon / M1 machines. Signed-off-by: Eric Butler <[email protected]>
1 parent 0f87cc3 commit d4f85cd

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
environment:
1919
MAVEN_OPTS: -Xms512m -Xmx1024m # Customize the JVM maximum heap limit
2020
GO111MODULE: "on"
21-
CI_GO_VERSION: 1.14.7
21+
CI_GO_VERSION: 1.17.6
2222
steps:
2323
- checkout:
2424
path: ~/.go_workspace/src/github.com/envoyproxy/protoc-gen-validate

java/pgv-artifacts/pom.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,26 @@
3939
</environmentVariables>
4040
</configuration>
4141
</execution>
42+
<execution>
43+
<id>osx-aarch_64</id>
44+
<goals>
45+
<goal>exec</goal>
46+
</goals>
47+
<phase>compile</phase>
48+
<configuration>
49+
<executable>go</executable>
50+
<arguments>
51+
<argument>build</argument>
52+
<argument>-o</argument>
53+
<argument>${project.build.directory}/protoc-gen-validate-${project.version}-osx-aarch_64.exe</argument>
54+
<argument>../..</argument>
55+
</arguments>
56+
<environmentVariables>
57+
<GOOS>darwin</GOOS>
58+
<GOARCH>arm64</GOARCH>
59+
</environmentVariables>
60+
</configuration>
61+
</execution>
4262
<execution>
4363
<id>linux_x86_32</id>
4464
<goals>
@@ -142,6 +162,21 @@
142162
</artifacts>
143163
</configuration>
144164
</execution>
165+
<execution>
166+
<id>osx-aarch_64</id>
167+
<goals>
168+
<goal>attach-artifact</goal>
169+
</goals>
170+
<configuration>
171+
<artifacts>
172+
<artifact>
173+
<file>${project.build.directory}/protoc-gen-validate-${project.version}-osx-aarch_64.exe</file>
174+
<type>exe</type>
175+
<classifier>osx-aarch_64</classifier>
176+
</artifact>
177+
</artifacts>
178+
</configuration>
179+
</execution>
145180
<execution>
146181
<id>linux_x86_32</id>
147182
<goals>

java/pgv-java-stub/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
~ Protobuf guarantees API stability for all 3.x version.
7777
~ https://github.com/protocolbuffers/protobuf/blob/17cc42a45aeab0f78a137fa6be6c36095db32e58/CHANGES.txt#L107-L122
7878
-->
79-
<protocArtifact>com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}</protocArtifact>
79+
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
8080
</configuration>
8181
<executions>
8282
<execution>

java/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<properties>
4343
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4444

45-
<protoc.version>3.19.1</protoc.version>
46-
<google.protobuf.version>3.19.1</google.protobuf.version>
45+
<protoc.version>3.19.4</protoc.version>
46+
<google.protobuf.version>3.19.4</google.protobuf.version>
4747
<protobuf.maven.plugin.version>0.6.1</protobuf.maven.plugin.version>
4848

4949
<re2j.version>1.5</re2j.version>

0 commit comments

Comments
 (0)