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
89db7ce0
Commit
89db7ce0
authored
Sep 28, 2016
by
Bo Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add script to build Google.Protobuf.Tools for csharp.
parent
f2eeaf71
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
build_tools.sh
csharp/build_tools.sh
+52
-0
No files found.
csharp/build_tools.sh
0 → 100755
View file @
89db7ce0
#!/bin/bash
if
[
$#
-ne
1
]
;
then
cat
<<
EOF
Usage:
$0
<VERSION_NUMBER>
Example:
$ $0
3.0.0
This script will download pre-built protoc binaries from maven repository and
create the Google.Protobuf.Tools package. Well-known type .proto files will also
be included.
EOF
exit
1
fi
VERSION_NUMBER
=
$1
# <directory name> <binary file name> pairs.
declare
-a
FILE_NAMES
=(
\
windows_x86 windows-x86_32.exe
\
windows_x64 windows-x86_64.exe
\
macosx_x86 osx-x86_32.exe
\
macosx_x64 osx-x86_64.exe
\
linux_x86 linux-x86_32.exe
\
linux_x64 linux-x86_64.exe
\
)
set
-e
mkdir
-p
protoc
# Create a zip file for each binary.
for
((
i
=
0
;
i<
${#
FILE_NAMES
[@]
}
;
i+
=
2
))
;
do
DIR_NAME
=
${
FILE_NAMES
[
$i
]
}
mkdir
-p
protoc/
$DIR_NAME
if
[
${
DIR_NAME
:0:3
}
=
"win"
]
;
then
TARGET_BINARY
=
"protoc.exe"
else
TARGET_BINARY
=
"protoc"
fi
BINARY_NAME
=
${
FILE_NAMES
[
$((
$i
+
1
))
]
}
BINARY_URL
=
http://repo1.maven.org/maven2/com/google/protobuf/protoc/
${
VERSION_NUMBER
}
/protoc-
${
VERSION_NUMBER
}
-
${
BINARY_NAME
}
if
!
wget
${
BINARY_URL
}
-O
protoc/
$DIR_NAME
/
$TARGET_BINARY
&> /dev/null
;
then
echo
"[ERROR] Failed to download
${
BINARY_URL
}
"
>
&2
echo
"[ERROR] Skipped
$protoc
-
${
VERSION_NAME
}
-
${
DIR_NAME
}
"
>
&2
continue
fi
done
nuget pack Google.Protobuf.Tools.nuspec
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