Skip to content

Commit 31134bd

Browse files
committed
imp - Rolled out updated build scripts
--- The build scripts have been updated. --- Type: imp Breaking: False Doc Required: False Backport Required: False Part: 1/1
1 parent a84a9ca commit 31134bd

File tree

4 files changed

+94
-52
lines changed

4 files changed

+94
-52
lines changed

tools/build.sh

+15-16
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1919

20+
# Convenience functions
21+
checkerror() {
22+
if [ $1 != 0 ]
23+
then
24+
printf "$2 - Error $1\n" >&2
25+
exit $1
26+
fi
27+
}
28+
2029
# This script builds. Use when you have dotnet installed.
2130
releaseconf=$1
2231
if [ -z $releaseconf ]; then
@@ -25,27 +34,17 @@ fi
2534

2635
# Check for dependencies
2736
dotnetpath=`which dotnet`
28-
if [ ! $? == 0 ]; then
29-
echo dotnet is not found.
30-
exit 1
31-
fi
37+
checkerror $? "dotnet is not found"
3238

3339
# Download packages
3440
echo Downloading packages...
35-
"$dotnetpath" restore "../BassBoom.sln" -p:Configuration=$releaseconf
36-
if [ ! $? == 0 ]; then
37-
echo Download failed.
38-
exit 1
39-
fi
41+
"$dotnetpath" restore "../BassBoom.sln" -p:Configuration=$releaseconf ${@:2}
42+
checkerror $? "Failed to download packages"
4043

4144
# Build
42-
echo Building BassBoom...
43-
"$dotnetpath" build "../BassBoom.sln" -p:Configuration=$releaseconf
44-
if [ ! $? == 0 ]; then
45-
echo Build failed.
46-
exit 1
47-
fi
45+
echo Building...
46+
"$dotnetpath" build "../BassBoom.sln" -p:Configuration=$releaseconf ${@:2}
47+
checkerror $? "Failed to build BassBoom"
4848

4949
# Inform success
5050
echo Build successful.
51-
exit 0

tools/docgen-pack.sh

+33-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,52 @@
11
#!/bin/bash
22

3+
# BassBoom Copyright (C) 2023 Aptivi
4+
#
5+
# This file is part of BassBoom
6+
#
7+
# BassBoom is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# BassBoom is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
20+
# Convenience functions
21+
checkerror() {
22+
if [ $1 != 0 ]
23+
then
24+
printf "$2 - Error $1\n" >&2
25+
exit $1
26+
fi
27+
}
28+
329
# This script builds KS and packs the artifacts. Use when you have MSBuild installed.
430
ksversion=$(grep "<Version>" ../Directory.Build.props | cut -d "<" -f 2 | cut -d ">" -f 2)
31+
checkerror $? "Failed to get version. Check to make sure that the version is specified correctly in D.B.props"
532

633
# Check for dependencies
734
zippath=`which zip`
8-
if [ ! $? == 0 ]; then
9-
echo zip is not found.
10-
exit 1
11-
fi
35+
checkerror $? "zip is not found"
1236

1337
# Pack documentation
1438
echo Packing documentation...
1539
cd "../docs/" && "$zippath" -r /tmp/$ksversion-doc.zip . && cd -
16-
if [ ! $? == 0 ]; then
17-
echo Packing failed.
18-
exit 1
19-
fi
40+
checkerror $? "Failed to pack"
2041

2142
# Inform success
2243
rm -rf "../DocGen/api"
44+
checkerror $? "Failed to remove api folder"
2345
rm -rf "../DocGen/obj"
46+
checkerror $? "Failed to remove obj folder"
2447
rm -rf "../docs"
48+
checkerror $? "Failed to remove docs folder"
2549
mv /tmp/$ksversion-doc.zip .
50+
checkerror $? "Failed to move archive from temporary folder"
2651
echo Pack successful.
2752
exit 0

tools/pack.sh

+17-14
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,34 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1919

20-
# This script builds and packs the artifacts. Use when you have MSBuild installed.
21-
version=$(grep "<Version>" ../Directory.Build.props | cut -d "<" -f 2 | cut -d ">" -f 2)
22-
releaseconf=$1
23-
if [ -z $releaseconf ]; then
24-
releaseconf=Release
25-
fi
20+
# Convenience functions
21+
checkerror() {
22+
if [ $1 != 0 ]
23+
then
24+
printf "$2 - Error $1\n" >&2
25+
exit $1
26+
fi
27+
}
28+
29+
# This script builds KS and packs the artifacts. Use when you have MSBuild installed.
30+
ksversion=$(grep "<Version>" ../Directory.Build.props | cut -d "<" -f 2 | cut -d ">" -f 2)
31+
checkerror $? "Failed to get version. Check to make sure that the version is specified correctly in D.B.props"
2632

2733
# Check for dependencies
2834
zippath=`which zip`
29-
if [ ! $? == 0 ]; then
30-
echo zip is not found.
31-
exit 1
32-
fi
35+
checkerror $? "zip is not found"
3336

3437
# Pack binary
3538
echo Packing binary...
3639
cd "../BassBoom.Cli/bin/$releaseconf/net8.0/" && "$zippath" -r /tmp/$version-cli.zip . && cd -
40+
checkerror $? "Failed to pack"
3741
cd "../BassBoom.Cli/bin/$releaseconf/net48/" && "$zippath" -r /tmp/$version-cli-48.zip . && cd -
38-
if [ ! $? == 0 ]; then
39-
echo Packing using zip failed.
40-
exit 1
41-
fi
42+
checkerror $? "Failed to pack"
4243

4344
# Inform success
4445
mv /tmp/$version-cli.zip .
46+
checkerror $? "Failed to move archive from temporary folder"
4547
mv /tmp/$version-cli-48.zip .
48+
checkerror $? "Failed to move archive from temporary folder"
4649
echo Build and pack successful.
4750
exit 0

tools/push.sh

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
11
#!/bin/bash
2-
# This script pushes. Use when you have dotnet installed.
3-
releaseconf=$1
4-
if [ -z $releaseconf ]; then
5-
releaseconf=Release
6-
fi
72

8-
# Check for dependencies
3+
# BassBoom Copyright (C) 2023 Aptivi
4+
#
5+
# This file is part of BassBoom
6+
#
7+
# BassBoom is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# BassBoom is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
20+
# Convenience functions
21+
checkerror() {
22+
if [ $1 != 0 ]
23+
then
24+
printf "$2 - Error $1\n" >&2
25+
exit $1
26+
fi
27+
}
28+
29+
# This script pushes. Use when you have dotnet installed.
930
dotnetpath=`which dotnet`
10-
if [ ! $? == 0 ]; then
11-
echo dotnet is not found.
12-
exit 1
13-
fi
31+
checkerror $? "dotnet is not found"
1432

1533
# Push packages
1634
echo Pushing packages...
1735
find .. -type f -path "*/bin/$releaseconf/*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "nuget.org" \;
18-
if [ ! $? == 0 ]; then
19-
echo Push failed.
20-
exit 1
21-
fi
36+
checkerror $? "Failed to push"
2237

2338
# Inform success
2439
echo Push successful.

0 commit comments

Comments
 (0)