Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
b1aac0b4
Commit
b1aac0b4
authored
Jul 26, 2016
by
Jisi Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make protoc-artifacts able to build plugin.
parent
032fb914
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
build-protoc.sh
protoc-artifacts/build-protoc.sh
+21
-8
pom.xml
protoc-artifacts/pom.xml
+1
-0
No files found.
protoc-artifacts/build-protoc.sh
View file @
b1aac0b4
#!/bin/bash
# Builds protoc executable into target/protoc.exe
# Builds protoc executable into target/protoc.exe; optionally build protoc
# plugins into target/protoc-gen-*.exe
# To be run from Maven.
# Usage: build-protoc.sh <OS> <ARCH>
# Usage: build-protoc.sh <OS> <ARCH>
[target]
# <OS> and <ARCH> are ${os.detected.name} and ${os.detected.arch} from os-maven-plugin
# target can be "protoc" (by default) or protoc-gen-javalite
OS
=
$1
ARCH
=
$2
MAKE_TARGET
=
$3
if
[[
$#
<
2
]]
;
then
if
[[
$#
<
3
]]
;
then
echo
"No arguments provided. This script is intended to be run from Maven."
exit
1
fi
case
$MAKE_TARGET
in
protoc-gen-javalite
)
;;
protoc
)
;;
*
)
echo
"Target ""
$TARGET
"" invalid."
exit
1
esac
# Under Cygwin, bash doesn't have these in PATH when called from Maven which
# runs in Windows version of Java.
export
PATH
=
"/bin:/usr/bin:
$PATH
"
...
...
@@ -126,7 +139,7 @@ checkDependencies ()
}
############################################################################
echo
"Building protoc, OS=
$OS
ARCH=
$ARCH
"
echo
"Building protoc, OS=
$OS
ARCH=
$ARCH
TARGET=
$TARGET
"
# Nested double quotes are unintuitive, but it works.
cd
"
$(
dirname
"
$0
"
)
"
...
...
@@ -134,7 +147,6 @@ cd "$(dirname "$0")"
WORKING_DIR
=
$(
pwd
)
CONFIGURE_ARGS
=
"--disable-shared"
MAKE_TARGET
=
"protoc"
if
[[
"
$OS
"
==
windows
]]
;
then
MAKE_TARGET
=
"
${
MAKE_TARGET
}
.exe"
fi
...
...
@@ -209,12 +221,13 @@ fi
export
CXXFLAGS LDFLAGS
TARGET_FILE
=
target/
protoc
.exe
TARGET_FILE
=
target/
$MAKE_TARGET
.exe
cd
"
$WORKING_DIR
"
/..
&&
./configure
$CONFIGURE_ARGS
&&
cd
src
&&
make clean
&&
make
$MAKE_TARGET
&&
cd
src
&&
make clean
&&
make
$MAKE_TARGET
-j4
&&
cd
"
$WORKING_DIR
"
&&
mkdir
-p
target
&&
(
cp
../src/protoc
$TARGET_FILE
||
cp
../src/protoc.exe
$TARGET_FILE
)
||
(
cp
../src/
$MAKE_TARGET
$TARGET_FILE
||
cp
../src/
$MAKE_TARGET
.exe
$TARGET_FILE
)
||
exit
1
if
[[
"
$OS
"
==
osx
]]
;
then
...
...
protoc-artifacts/pom.xml
View file @
b1aac0b4
...
...
@@ -59,6 +59,7 @@
<argument>
build-protoc.sh
</argument>
<argument>
${os.detected.name}
</argument>
<argument>
${os.detected.arch}
</argument>
<argument>
protoc
</argument>
</arguments>
</configuration>
</plugin>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment