@@ -18,7 +18,6 @@ make_absolute () {
18
18
# ####################################################################
19
19
# Lay out
20
20
# ####################################################################
21
- echo " Laying out files for dotnet tool..."
22
21
# Parse script arguments
23
22
for i in " $@ "
24
23
do
38
37
done
39
38
40
39
if [ -z " $VERSION " ]; then
41
- VERSION= " $GitBuildVersionSimple "
40
+ die " --version was not set "
42
41
fi
43
42
44
43
# Directories
@@ -47,42 +46,32 @@ ROOT="$( cd "$THISDIR"/../../.. ; pwd -P )"
47
46
SRC=" $ROOT /src"
48
47
OUT=" $ROOT /out"
49
48
GCM_SRC=" $SRC /shared/Git-Credential-Manager"
49
+ GCM_UI_SRC=" $SRC /shared/Git-Credential-Manager.UI.Avalonia"
50
50
BITBUCKET_UI_SRC=" $SRC /shared/Atlassian.Bitbucket.UI.Avalonia"
51
51
GITHUB_UI_SRC=" $SRC /shared/GitHub.UI.Avalonia"
52
52
GITLAB_UI_SRC=" $SRC /shared/GitLab.UI.Avalonia"
53
53
DOTNET_TOOL=" shared/DotnetTool"
54
54
PROJ_OUT=" $OUT /$DOTNET_TOOL "
55
55
56
- PACKAGE=" $ROOT /nuget"
57
- CONFIGURATION=" ${CONFIGURATION:= Release} "
56
+ CONFIGURATION=" ${CONFIGURATION:= Debug} "
58
57
59
58
# Build parameters
60
59
FRAMEWORK=net6.0
61
60
62
61
# Outputs
63
- PAYLOAD=" $PROJ_OUT /payload/$CONFIGURATION "
64
- SYMBOLOUT=" $PROJ_OUT /payload.sym/$CONFIGURATION "
65
-
66
- # Cleanup payload directory
67
- if [ -d " $PAYLOAD " ]; then
68
- echo " Cleaning existing payload directory '$PAYLOAD '..."
69
- rm -rf " $PAYLOAD "
70
- fi
71
-
72
- # Cleanup symbol directory
73
- if [ -d " $SYMBOLOUT " ]; then
74
- echo " Cleaning existing symbols directory '$SYMBOLOUT '..."
75
- rm -rf " $SYMBOLOUT "
76
- fi
77
-
78
- # Cleanup package directory
79
- if [ -d " $PACKAGE " ]; then
80
- echo " Cleaning existing package directory '$PACKAGE '..."
81
- rm -rf " $PACKAGE "
62
+ OUTDIR=" $PROJ_OUT /nupkg/$CONFIGURATION "
63
+ IMGOUT=" $OUTDIR /images"
64
+ PAYLOAD=" $OUTDIR /payload"
65
+ SYMBOLOUT=" $OUTDIR /payload.sym"
66
+
67
+ # Cleanup output directory
68
+ if [ -d " $OUTDIR " ]; then
69
+ echo " Cleaning existing output directory '$OUTDIR '..."
70
+ rm -rf " $OUTDIR "
82
71
fi
83
72
84
- # Ensure directories exist
85
- mkdir -p " $PAYLOAD " " $SYMBOLOUT " " $PACKAGE "
73
+ # Ensure output directories exist
74
+ mkdir -p " $PAYLOAD " " $SYMBOLOUT " " $IMGOUT "
86
75
87
76
if [ -z " $DOTNET_ROOT " ]; then
88
77
DOTNET_ROOT=" $( dirname $( which dotnet) ) "
91
80
# Publish core application executables
92
81
echo " Publishing core application..."
93
82
$DOTNET_ROOT /dotnet publish " $GCM_SRC " \
94
- --configuration=" $CONFIGURATION " \
95
- --framework=" $FRAMEWORK " \
96
- --output=" $( make_absolute " $PAYLOAD " ) " \
83
+ --configuration=" $CONFIGURATION " \
84
+ --framework=" $FRAMEWORK " \
85
+ --output=" $( make_absolute " $PAYLOAD " ) " \
86
+ -p:UseAppHost=false || exit 1
87
+
88
+ echo " Publishing core UI helper..."
89
+ $DOTNET_ROOT /dotnet publish " $GCM_UI_SRC " \
90
+ --configuration=" $CONFIGURATION " \
91
+ --framework=" $FRAMEWORK " \
92
+ --output=" $( make_absolute " $PAYLOAD " ) " \
97
93
-p:UseAppHost=false || exit 1
98
94
99
95
echo " Publishing Bitbucket UI helper..."
100
96
$DOTNET_ROOT /dotnet publish " $BITBUCKET_UI_SRC " \
101
- --configuration=" $CONFIGURATION " \
102
- --framework=" $FRAMEWORK " \
103
- --output=" $( make_absolute " $PAYLOAD " ) " \
97
+ --configuration=" $CONFIGURATION " \
98
+ --framework=" $FRAMEWORK " \
99
+ --output=" $( make_absolute " $PAYLOAD " ) " \
104
100
-p:UseAppHost=false || exit 1
105
101
106
102
echo " Publishing GitHub UI helper..."
107
103
$DOTNET_ROOT /dotnet publish " $GITHUB_UI_SRC " \
108
- --configuration=" $CONFIGURATION " \
109
- --framework=" $FRAMEWORK " \
110
- --output=" $( make_absolute " $PAYLOAD " ) " \
104
+ --configuration=" $CONFIGURATION " \
105
+ --framework=" $FRAMEWORK " \
106
+ --output=" $( make_absolute " $PAYLOAD " ) " \
111
107
-p:UseAppHost=false || exit 1
112
108
113
109
echo " Publishing GitLab UI helper..."
114
110
$DOTNET_ROOT /dotnet publish " $GITLAB_UI_SRC " \
115
- --configuration=" $CONFIGURATION " \
116
- --framework=" $FRAMEWORK " \
117
- --output=" $( make_absolute " $PAYLOAD " ) " \
111
+ --configuration=" $CONFIGURATION " \
112
+ --framework=" $FRAMEWORK " \
113
+ --output=" $( make_absolute " $PAYLOAD " ) " \
118
114
-p:UseAppHost=false || exit 1
119
115
120
116
# Collect symbols
121
117
echo " Collecting managed symbols..."
122
118
mv " $PAYLOAD " /* .pdb " $SYMBOLOUT " || exit 1
123
119
120
+ # Copy DotnetToolSettings.xml file
121
+ echo " Copying out package configuration files..."
122
+ cp " $SRC /$DOTNET_TOOL /DotnetToolSettings.xml" " $PAYLOAD /"
123
+
124
+ # Copy package icon image
125
+ echo " Copying images..."
126
+ cp " $SRC /$DOTNET_TOOL /icon.png" " $IMGOUT " || exit 1
127
+
124
128
echo " Build complete."
125
129
126
130
# ####################################################################
127
131
# Pack dotnet tool
128
132
# ####################################################################
129
133
echo " Creating dotnet tool package..."
130
134
131
- mkdir -p " $PACKAGE " || exit 1
132
- echo " Laying out files..."
133
- cp -r " $SRC /$DOTNET_TOOL /DotnetToolSettings.xml" \
134
- " $PAYLOAD /." \
135
- " $PACKAGE /"
136
-
137
- dotnet pack " $SRC /$DOTNET_TOOL /DotnetTool.csproj" /p:PackageVersion=" $VERSION " /p:PublishDir=" $PACKAGE /"
135
+ dotnet pack " $SRC /$DOTNET_TOOL /DotnetTool.csproj" \
136
+ /p:Configuration=" $CONFIGURATION " \
137
+ /p:PackageVersion=" $VERSION " \
138
+ /p:PublishDir=" $OUTDIR /"
138
139
139
140
echo " Dotnet tool pack complete."
0 commit comments