Skip to content

Commit d948caa

Browse files
committed
Remove AssemblyVersion definition accidentally left in Module.props. Refactor build scripts for consistency with other repo usages.
1 parent 4834a95 commit d948caa

File tree

14 files changed

+268
-177
lines changed

14 files changed

+268
-177
lines changed

.buildenv/BuildEnv.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@
204204
<Message Text="DocumentationMarkDownFile : '$(DocumentationMarkDownFile)'" Importance="High" />
205205
<Message Text="AppxPackageDir : '$(AppxPackageDir)'" Importance="High" />
206206
<Message Text="AssemblySearchPaths : '$(AssemblySearchPaths)'" Importance="High" />
207-
<Message Text="************************************************************" />
207+
<Message Text="************************************************************" Importance="High" />
208+
<Message Text=" " Importance="High" />
208209
</Target>
209210

210211
</Project>

.buildenv/Repo.props

Lines changed: 0 additions & 56 deletions
This file was deleted.

build-packages.cmd

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ setlocal enabledelayedexpansion
44
set EXIT_CODE=0
55
set SCRIPT_DIR=%~dp0
66
set SCRIPT_DIR=%SCRIPT_DIR:~0,-1%
7-
set BUILD_CONFIGURATION=Release
7+
set BUILD_CONFIGURATION=
88
set BUILD_VERSION=
99
set PACKAGE_SUFFIX=
1010
set SUFFIX_FOUND=
@@ -41,25 +41,26 @@ for %%a in (%*) do (
4141
)
4242
)
4343

44-
for %%a in (%*) do (
45-
46-
rem Build Configurations:
47-
rem 1) Release (Default)
48-
rem 2) Debug
49-
rem
50-
rem Pass in the --debug flag to use 'Debug' build configuration
51-
if /i "%%a" == "--debug" (
52-
set BUILD_CONFIGURATION=Debug
53-
)
54-
)
55-
5644
rem The default build version is defined in the repo VERSION file.
5745
set /p BUILD_VERSION=<%SCRIPT_DIR%\VERSION
5846

59-
rem The default build version can be overridden by the 'VCBUILD_VERSION'
47+
rem The default build version can be overridden by the 'VCBuildVersion'
6048
rem environment variable
61-
if defined VCBUILD_VERSION (
62-
set BUILD_VERSION=%VCBUILD_VERSION%
49+
if defined VCBuildVersion (
50+
echo:
51+
echo Using 'VCBuildVersion' = %VCBuildVersion%
52+
set BUILD_VERSION=%VCBuildVersion%
53+
)
54+
55+
rem The default build configuration is 'Release'.
56+
set BUILD_CONFIGURATION=Release
57+
58+
rem The default build configuration (e.g. Release) can be overridden
59+
rem by the 'VCBuildConfiguration' environment variable
60+
if defined VCBuildConfiguration (
61+
echo:
62+
echo Using 'VCBuildConfiguration' = %VCBuildConfiguration%
63+
set BUILD_CONFIGURATION=%VCBuildConfiguration%
6364
)
6465

6566
set PACKAGE_VERSION=%BUILD_VERSION%
@@ -84,48 +85,52 @@ call dotnet restore %PACKAGES_PROJECT% --force
8485
echo:
8586
echo [Create NuGet Package] VirtualClient.%PACKAGE_VERSION%
8687
echo ----------------------------------------------------------
87-
call dotnet pack %PACKAGES_PROJECT% --force --no-restore --no-build -c Release ^
88+
call dotnet pack %PACKAGES_PROJECT% --force --no-restore --no-build -c %BUILD_CONFIGURATION% ^
8889
-p:Version=%PACKAGE_VERSION% -p:NuspecFile=%PACKAGE_DIR%\nuspec\VirtualClient.nuspec && echo: || Goto :Error
8990

9091
echo:
9192
echo [Create NuGet Package] VirtualClient.Framework.%PACKAGE_VERSION%
9293
echo ----------------------------------------------------------
93-
call dotnet pack %PACKAGES_PROJECT% --force --no-restore --no-build -c Release ^
94+
call dotnet pack %PACKAGES_PROJECT% --force --no-restore --no-build -c %BUILD_CONFIGURATION% ^
9495
-p:Version=%PACKAGE_VERSION% -p:NuspecFile=%PACKAGE_DIR%\nuspec\VirtualClient.Framework.nuspec && echo: || Goto :Error
9596

9697
echo:
9798
echo [Create NuGet Package] VirtualClient.TestFramework.%PACKAGE_VERSION%
9899
echo ----------------------------------------------------------
99-
call dotnet pack %PACKAGES_PROJECT% --force --no-restore --no-build -c Release ^
100+
call dotnet pack %PACKAGES_PROJECT% --force --no-restore --no-build -c %BUILD_CONFIGURATION% ^
100101
-p:Version=%PACKAGE_VERSION% -p:NuspecFile=%PACKAGE_DIR%\nuspec\VirtualClient.TestFramework.nuspec && echo: || Goto :Error
101102

102103
Goto :End
103104

104105

105106
:Usage
106107
echo:
108+
echo:
107109
echo Creates packages from the build artifacts (e.g. NuGet).
108110
echo:
109111
echo Options:
110112
echo ---------------------
111-
echo --debug - Flag requests build configuration to be 'Debug' vs. the default 'Release'.
112-
echo --suffix - Flag requests a suffix be added to the packages produced (e.g. virtualclient.1.16.25-beta).
113-
echo Valid values include: alpha, beta.
113+
echo --suffix - Defines a suffix to place on the package names. Valid values include: alpha, beta.
114114
echo:
115115
echo Usage:
116116
echo ---------------------
117-
echo build-packages.cmd [--debug] [--suffix <alpha|beta>]
117+
echo build-packages.cmd [--suffix ^<alpha^|beta^>]
118118
echo:
119119
echo Examples:
120120
echo ---------------------
121+
echo # Use defaults
122+
echo %SCRIPT_DIR%^> build.cmd
121123
echo %SCRIPT_DIR%^> build-packages.cmd
122124
echo:
123-
echo %SCRIPT_DIR%^> build-packages.cmd --debug
124-
echo:
125+
echo # Set package suffix
126+
echo %SCRIPT_DIR%^> build.cmd
125127
echo %SCRIPT_DIR%^> build-packages.cmd --suffix beta
126128
echo:
129+
echo # Set specific version and configuration
127130
echo %SCRIPT_DIR%^> set VCBUILD_VERSION=1.16.25
128-
echo %SCRIPT_DIR%^> build.cmd --debug --suffix beta
131+
echo %SCRIPT_DIR%^> set VCBuildConfiguration=Debug
132+
echo %SCRIPT_DIR%^> build.cmd
133+
echo %SCRIPT_DIR%^> build-packages.cmd
129134
Goto :Finish
130135

131136

@@ -137,6 +142,8 @@ set EXIT_CODE=%ERRORLEVEL%
137142
REM Reset environment variables
138143
set BUILD_CONFIGURATION=
139144
set BUILD_VERSION=
145+
set PACKAGE_DIR=
146+
set PACKAGES_PROJECT=
140147
set PACKAGE_SUFFIX=
141148
set PACKAGE_VERSION=
142149
set SCRIPT_DIR=

build-packages.sh

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
EXIT_CODE=0
44
SCRIPT_DIR="$(dirname $(readlink -f "${BASH_SOURCE}"))"
5-
BUILD_CONFIGURATION="Release"
5+
BUILD_CONFIGURATION=""
66
BUILD_VERSION=""
77
PACKAGE_SUFFIX=""
88
SUFFIX_FOUND=""
@@ -13,22 +13,30 @@ Usage() {
1313
echo ""
1414
echo "Options:"
1515
echo "---------------------"
16-
echo "--debug - Flag requests build configuration to be 'Debug' vs. the default 'Release'."
16+
echo "--suffix - Defines a suffix to place on the package names. Valid values include: alpha, beta."
1717
echo ""
1818
echo "Usage:"
1919
echo "---------------------"
20-
echo "build-packages.sh [--debug]"
20+
echo "build-packages.sh [--suffix <alpha|beta>]"
2121
echo ""
2222
echo "Examples"
2323
echo "---------------------"
24+
echo "# Use defaults"
2425
echo "user@system:~/repo$ chmod +x *.sh"
26+
echo "user@system:~/repo$ ./build.sh"
2527
echo "user@system:~/repo$ ./build-packages.sh"
2628
echo ""
29+
echo "# Set package suffix"
2730
echo "user@system:~/repo$ chmod +x *.sh"
28-
echo "user@system:~/repo$ ./build-packages.sh --debug"
31+
echo "user@system:~/repo$ ./build.sh"
32+
echo "user@system:~/repo$ ./build-packages.sh --suffix beta"
2933
echo ""
34+
echo "# Set specific version and configuration"
3035
echo "user@system:~/repo$ export VCBuildVersion=\"1.16.25\""
31-
echo "user@system:~/repo$ ./build-packages.sh --debug"
36+
echo "user@system:~/repo$ export VCBuildConfiguration=\"Debug\""
37+
echo "user@system:~/repo$ chmod +x *.sh"
38+
echo "user@system:~/repo$ ./build.sh"
39+
echo "user@system:~/repo$ ./build-packages.sh"
3240
echo ""
3341
Finish
3442
}
@@ -59,32 +67,31 @@ done
5967

6068
for ((i=1; i<=$#; i++)); do
6169
arg="${!i}"
62-
63-
if [ "$SUFFIX_FOUND" != "" ]; then
64-
PACKAGE_SUFFIX=${arg##+(-)}
65-
SUFFIX_FOUND=""
66-
else
67-
# alpha or beta
68-
if [ "$arg" == "--debug" ]; then
69-
BUILD_CONFIGURATION="Debug"
70-
fi
71-
72-
# alpha or beta
73-
if [ "$arg" == "--suffix" ]; then
74-
SUFFIX_FOUND="true"
75-
fi
70+
71+
# alpha or beta
72+
if [ "$arg" != "--suffix" ]; then
73+
PACKAGE_SUFFIX=$(echo "$arg" | sed 's/^-*//')
7674
fi
7775
done
7876

7977
# The default build version is defined in the repo VERSION file.
80-
BUILD_VERSION=$(cat "$SCRIPT_DIR/VERSION") | 's/^[[:space:]]*//;s/[[:space:]]*$//'
78+
BUILD_VERSION=$(cat "$SCRIPT_DIR/VERSION")
8179

8280
# The default build version can be overridden by the 'VCBuildVersion'
8381
# environment variable
8482
if [[ -v "VCBuildVersion" && -n "$VCBuildVersion" ]]; then
8583
BUILD_VERSION="$VCBuildVersion"
8684
fi
8785

86+
# The default build configuration is 'Release'.
87+
BUILD_CONFIGURATION="Release"
88+
89+
# The default build configuration (e.g. Release) can be overridden
90+
# by the 'VCBuildConfiguration' environment variable
91+
if [[ -v "VCBuildConfiguration" && -n "$VCBuildConfiguration" ]]; then
92+
BUILD_CONFIGURATION=$VCBuildConfiguration
93+
fi
94+
8895
PACKAGE_VERSION=$BUILD_VERSION
8996
if [ "$PACKAGE_SUFFIX" != "" ]; then
9097
PACKAGE_VERSION="$BUILD_VERSION-$PACKAGE_SUFFIX"
@@ -98,7 +105,6 @@ echo "Configuration : $BUILD_CONFIGURATION"
98105
echo "Package Version : $PACKAGE_VERSION"
99106
echo "**********************************************************************"
100107
echo""
101-
End
102108

103109
PACKAGES_PROJECT_DIR="$SCRIPT_DIR/src/VirtualClient/VirtualClient.Packaging"
104110
PACKAGES_PROJECT="$SCRIPT_DIR/src/VirtualClient/VirtualClient.Packaging/VirtualClient.Packaging.csproj"
@@ -115,7 +121,7 @@ echo ""
115121
echo "[Create NuGet Package] VirtualClient.$PACKAGE_VERSION"
116122
echo "----------------------------------------------------------"
117123
dotnet pack "$PACKAGES_PROJECT" --force --no-restore --no-build -c $BUILD_CONFIGURATION \
118-
-p:Version=%PACKAGE_VERSION% -p:NuspecFile="$PACKAGES_PROJECT_DIR/nuspec/VirtualClient.nuspec"
124+
-p:Version=$PACKAGE_VERSION -p:NuspecFile="$PACKAGES_PROJECT_DIR/nuspec/VirtualClient.nuspec"
119125

120126
result=$?
121127
if [ $result -ne 0 ]; then
@@ -126,7 +132,7 @@ echo ""
126132
echo "[Create NuGet Package] VirtualClient.Framework.$PACKAGE_VERSION"
127133
echo "----------------------------------------------------------"
128134
dotnet pack "$PACKAGES_PROJECT" --force --no-restore --no-build -c $BUILD_CONFIGURATION \
129-
-p:Version=%PACKAGE_VERSION% -p:NuspecFile="$PACKAGES_PROJECT_DIR/nuspec/VirtualClient.Framework.nuspec"
135+
-p:Version=$PACKAGE_VERSION -p:NuspecFile="$PACKAGES_PROJECT_DIR/nuspec/VirtualClient.Framework.nuspec"
130136

131137
result=$?
132138
if [ $result -ne 0 ]; then
@@ -137,7 +143,7 @@ echo ""
137143
echo "[Create NuGet Package] VirtualClient.TestFramework.$PACKAGE_VERSION"
138144
echo "----------------------------------------------------------"
139145
dotnet pack "$PACKAGES_PROJECT" --force --no-restore --no-build -c $BUILD_CONFIGURATION \
140-
-p:Version=%PACKAGE_VERSION% -p:NuspecFile="$PACKAGES_PROJECT_DIR/nuspec/VirtualClient.TestFramework.nuspec"
146+
-p:Version=$PACKAGE_VERSION -p:NuspecFile="$PACKAGES_PROJECT_DIR/nuspec/VirtualClient.TestFramework.nuspec"
141147

142148
result=$?
143149
if [ $result -ne 0 ]; then

build-test.cmd

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
@echo Off
22

33
set EXIT_CODE=0
4-
set BUILD_CONFIGURATION=Release
4+
set BUILD_CONFIGURATION=
55
set SCRIPT_DIR=%~dp0
66
set SCRIPT_DIR=%SCRIPT_DIR:~0,-1%
77

88
if /i "%~1" == "/?" Goto :Usage
99
if /i "%~1" == "-?" Goto :Usage
1010
if /i "%~1" == "--help" Goto :Usage
1111

12-
for %%a in (%*) do (
12+
rem The default build configuration is 'Release'.
13+
set BUILD_CONFIGURATION=Release
1314

14-
rem Build Configurations:
15-
rem 1) Release (Default)
16-
rem 2) Debug
17-
rem
18-
rem Pass in the --debug flag to use 'Debug' build configuration
19-
if /i "%%a" == "--debug" set BUILD_CONFIGURATION=Debug
15+
rem The default build configuration (e.g. Release) can be overridden
16+
rem by the 'VCBuildConfiguration' environment variable
17+
if defined VCBuildConfiguration (
18+
echo:
19+
echo Using 'VCBuildConfiguration' = %VCBuildConfiguration%
20+
set BUILD_CONFIGURATION=%VCBuildConfiguration%
2021
)
2122

2223
echo ********************************************************************
23-
echo Build Version : %VCBuildVersion%
2424
echo Repo Root : %SCRIPT_DIR%
2525
echo Configuration : %BUILD_CONFIGURATION%
2626
echo Tests Directory : %SCRIPT_DIR%\out\bin\%BUILD_CONFIGURATION%
@@ -39,21 +39,24 @@ Goto :End
3939

4040
:Usage
4141
echo:
42-
echo Discovers and runs tests (unit + functional) defined in the build output/artifacts.
4342
echo:
44-
echo Options:
45-
echo ---------------------
46-
echo --debug - Flag requests tests for build configuration 'Debug' vs. the default 'Release'.
43+
echo Discovers and runs tests (unit + functional) defined in the build output/artifacts.
4744
echo:
4845
echo Usage:
4946
echo ---------------------
50-
echo build-test.cmd [--debug]
47+
echo build-test.cmd
5148
echo:
5249
echo Examples:
5350
echo ---------------------
51+
echo # Use defaults
52+
echo %SCRIPT_DIR%^> build.cmd
5453
echo %SCRIPT_DIR%^> build-test.cmd
5554
echo:
56-
echo %SCRIPT_DIR%^> build-test.cmd --debug
55+
echo # Set specific version and configuration
56+
echo %SCRIPT_DIR%^> set VCBuildVersion=1.16.25
57+
echo %SCRIPT_DIR%^> set VCBuildConfiguration=Debug
58+
echo %SCRIPT_DIR%^> build.cmd
59+
echo %SCRIPT_DIR%^> build-test.cmd
5760
Goto :Finish
5861

5962

0 commit comments

Comments
 (0)