File tree Expand file tree Collapse file tree
dd-java-agent/instrumentation/protobuf-3.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,20 +14,39 @@ muzzle {
1414 }
1515}
1616
17+ def os = System . getProperty(" os.name" ). toLowerCase()
18+ def arch = System . getProperty(" os.arch" ). toLowerCase()
19+ def arm64 = arch. contains(" aarch64" ) || arch. contains(" arm64" )
20+ def skipLinuxArm64Tests = os. contains(" linux" ) && arm64
21+
1722protobuf {
1823 protoc {
19- def os = System . getProperty(" os.name" ). toLowerCase()
20- def arch = System . getProperty(" os.arch" ). toLowerCase()
21-
22- // There is no m1 support for protoc 3.0.0, so require Rosetta
23- if (os. contains(" mac" ) && arch. contains(" aarch64" )) {
24+ // There is no macOS arm64 support for protoc 3.0.0, so require Rosetta.
25+ if (os. contains(" mac" ) && arm64) {
2426 artifact = " com.google.protobuf:protoc:3.0.0:osx-x86_64"
2527 } else {
2628 artifact = " com.google.protobuf:protoc:3.0.0"
2729 }
2830 }
2931}
3032
33+ // TODO: protobuf supports arm64 linux since 3.12.0, but it is not source-compatible with 3.0.0
34+ if (skipLinuxArm64Tests) {
35+ tasks. matching {
36+ it. name in [
37+ " extractTestProto" ,
38+ " generateTestProto" ,
39+ " compileTestJava" ,
40+ " compileTestGroovy" ,
41+ " processTestResources" ,
42+ " testClasses" ,
43+ " test"
44+ ]
45+ }. configureEach {
46+ enabled = false
47+ }
48+ }
49+
3150
3251dependencies {
3352 compileOnly group : ' com.google.protobuf' , name : ' protobuf-java' , version : ' 3.0.0'
You can’t perform that action at this time.
0 commit comments