Skip to content

Commit 98b7457

Browse files
author
Lessley Dennington
committed
.NET tool: split packaging script
Split pack-tool.sh into two scripts (layout.sh and pack.sh) to allow for payload and package signing.
1 parent 7baac73 commit 98b7457

File tree

2 files changed

+52
-25
lines changed

2 files changed

+52
-25
lines changed

src/shared/DotnetTool/pack-tool.sh renamed to src/shared/DotnetTool/layout.sh

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/bin/bash
2-
die () {
3-
echo "$*" >&2
4-
exit 1
5-
}
6-
72
make_absolute () {
83
case "$1" in
94
/*)
@@ -26,20 +21,12 @@ case "$i" in
2621
CONFIGURATION="${i#*=}"
2722
shift # past argument=value
2823
;;
29-
--version=*)
30-
VERSION="${i#*=}"
31-
shift # past argument=value
32-
;;
3324
*)
3425
# unknown option
3526
;;
3627
esac
3728
done
3829

39-
if [ -z "$VERSION" ]; then
40-
die "--version was not set"
41-
fi
42-
4330
# Directories
4431
THISDIR="$( cd "$(dirname "$0")" ; pwd -P )"
4532
ROOT="$( cd "$THISDIR"/../../.. ; pwd -P )"
@@ -126,15 +113,3 @@ echo "Copying images..."
126113
cp "$SRC/$DOTNET_TOOL/icon.png" "$IMGOUT" || exit 1
127114

128115
echo "Build complete."
129-
130-
#####################################################################
131-
# Pack dotnet tool
132-
#####################################################################
133-
echo "Creating dotnet tool package..."
134-
135-
dotnet pack "$SRC/$DOTNET_TOOL/DotnetTool.csproj" \
136-
/p:Configuration="$CONFIGURATION" \
137-
/p:PackageVersion="$VERSION" \
138-
/p:PublishDir="$OUTDIR/"
139-
140-
echo "Dotnet tool pack complete."

src/shared/DotnetTool/pack.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
die () {
3+
echo "$*" >&2
4+
exit 1
5+
}
6+
7+
# Parse script arguments
8+
for i in "$@"
9+
do
10+
case "$i" in
11+
--configuration=*)
12+
CONFIGURATION="${i#*=}"
13+
shift # past argument=value
14+
;;
15+
--version=*)
16+
VERSION="${i#*=}"
17+
shift # past argument=value
18+
;;
19+
--publish-dir=*)
20+
PUBLISH_DIR="${i#*=}"
21+
shift # past argument=value
22+
;;
23+
*)
24+
# unknown option
25+
;;
26+
esac
27+
done
28+
29+
CONFIGURATION="${CONFIGURATION:=Debug}"
30+
if [ -z "$VERSION" ]; then
31+
die "--version was not set"
32+
fi
33+
34+
# Directories
35+
THISDIR="$( cd "$(dirname "$0")" ; pwd -P )"
36+
ROOT="$( cd "$THISDIR"/../../.. ; pwd -P )"
37+
SRC="$ROOT/src"
38+
OUT="$ROOT/out"
39+
DOTNET_TOOL="shared/DotnetTool"
40+
41+
if [ -z "$PUBLISH_DIR" ]; then
42+
PUBLISH_DIR="$OUT/$DOTNET_TOOL/nupkg/$CONFIGURATION"
43+
fi
44+
45+
echo "Creating dotnet tool package..."
46+
47+
dotnet pack "$SRC/$DOTNET_TOOL/DotnetTool.csproj" \
48+
/p:Configuration="$CONFIGURATION" \
49+
/p:PackageVersion="$VERSION" \
50+
/p:PublishDir="$PUBLISH_DIR/"
51+
52+
echo "Dotnet tool pack complete."

0 commit comments

Comments
 (0)