Skip to content

Commit 1b30d89

Browse files
author
Fabian Morgan
committed
updates from PR comment
1 parent 9c1788f commit 1b30d89

File tree

1 file changed

+67
-17
lines changed

1 file changed

+67
-17
lines changed

docs/08-developer-guide/01-build/01-maven.md

Lines changed: 67 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,51 +41,100 @@ Choose one of the following methods to get the source code:
4141
</TabItem>
4242
</Tabs>
4343

44-
## ARM-based Apple Silicon (Apple M1 ... etc)
44+
## Build the Project
45+
46+
Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs.
47+
48+
### Additional Steps Required For ARM-based Apple Silicon Macs (M1, etc)
49+
50+
If you are running on an ARM-based Apple Silicon Mac, please perform the additional steps in this section.
51+
52+
#### Prerequisites
53+
54+
- [Gradle](https://gradle.org/) - Gradle 7.0 or higher
55+
- [Compatible JVM for gRPC Java v1.71.0](https://github.com/grpc/grpc-java/blob/v1.71.0/README.md) - Compatible JVM for gRPC and Gradle
56+
57+
#### Compile Protobuf version 3.7.1 for ARM-based Mac
58+
59+
Execute the following commands to compile Protobuf version 3.7.1:
4560

4661
```bash
4762
PROTOBUF_VERSION="3.7.1"
4863
curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz | tar zx
4964
cd protobuf-${PROTOBUF_VERSION}
5065
./configure --disable-shared
5166
make -j
52-
# install protoc to the local Maven repository
67+
```
68+
69+
Execute the following command to install `protoc` version 3.7.1 to the local Maven repository:
70+
71+
```bash
5372
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc
54-
# workaround for Maven 3.9.x. Not needed for 3.8.x or earlier
73+
```
74+
75+
If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier:
76+
77+
```bash
5578
cp $HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64 $HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64.exe
79+
```
5680

81+
#### Compile and Patch Protobuf version 2.5.0 for ARM-based Mac
82+
83+
Execute the following commands to compile and patch Protobuf version 2.5.0:
84+
85+
```bash
5786
cd ..
58-
# Download protobuf 2.5.0 tarball
5987
PROTOBUF_VERSION="2.5.0"
6088
curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz | tar zx
6189
cd protobuf-${PROTOBUF_VERSION}
62-
63-
# patch protobuf 2.5.0
6490
curl -L -O https://gist.githubusercontent.com/liusheng/64aee1b27de037f8b9ccf1873b82c413/raw/118c2fce733a9a62a03281753572a45b6efb8639/protobuf-2.5.0-arm64.patch
6591
patch -p1 < protobuf-2.5.0-arm64.patch
66-
# build protobuf
6792
./configure --disable-shared
6893
make
69-
# install protoc to the local Maven repository
94+
```
95+
96+
Execute the following command to install `protoc` version 2.5.0 to the local Maven repository:
97+
98+
```bash
7099
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc
71-
# workaround for Maven 3.9.x. Not needed for 3.8.x or earlier
100+
```
101+
102+
If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier:
103+
104+
```bash
72105
cp $HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64 $HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64.exe
106+
```
73107

108+
#### Compile Protobuf version 3.19.6 for ARM-based Mac
109+
110+
Execute the following commands to compile and patch Protobuf version 2.5.0:
111+
112+
```bash
74113
cd ..
75-
# Patch protobuf 3.19.6
76114
PROTOBUF_VERSION="3.19.6"
77115
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz
78116
tar xzf protobuf-all-${PROTOBUF_VERSION}.tar.gz
79117
cd protobuf-${PROTOBUF_VERSION}
80118
./configure --disable-shared
81119
make -j
120+
```
121+
122+
Execute the following command to install `protoc` version 3.19.6 to the local Maven repository:
123+
124+
```bash
82125
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc
83-
# workaround for Maven 3.9.x. Not needed for 3.8.x or earlier
126+
```
127+
128+
If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier:
129+
130+
```bash
84131
cp $HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64 $HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64.exe
132+
```
133+
134+
#### Compile gRPC version 1.71.0 for ARM-based Mac
85135

136+
```bash
86137
cd ..
87-
# Compile grpc
88-
# Pre-req: Manually install Gradle (version 7.0 or higher) and a compatible JVM (JDK 8 or higher) as required by gRPC Java v1.71.0. See https://github.com/grpc/grpc-java/blob/v1.71.0/README.md for details.
89138
git clone https://github.com/grpc/grpc-java.git
90139
cd grpc-java
91140
git checkout v1.71.0
@@ -97,13 +146,14 @@ export LDFLAGS="-L${PROTOBUF_ROOT}/src/.libs"
97146
./gradlew :grpc-compiler:java_pluginExecutable -PskipAndroid=true
98147
PLUGIN="protoc-gen-grpc-java-1.71.0-osx-aarch_64.exe"
99148
cp compiler/build/exe/java_plugin/protoc-gen-grpc-java $PLUGIN
100-
mvn install:install-file -DgroupId=io.grpc -DartifactId=protoc-gen-grpc-java -Dversion=1.71.0 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=$PLUGIN
101-
cd ..
102149
```
103150

104-
## Build the Project
151+
Execute the following commands to install `protoc-gen-grpc-java` version 1.71.0 to the local Maven repository:
105152

106-
Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs.
153+
```bash
154+
mvn install:install-file -DgroupId=io.grpc -DartifactId=protoc-gen-grpc-java -Dversion=1.71.0 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=$PLUGIN
155+
cd ..
156+
```
107157

108158
### Build Options
109159

0 commit comments

Comments
 (0)