Skip to content

Commit

Permalink
imp - Rolled out updated build scripts
Browse files Browse the repository at this point in the history
---

The build scripts have been updated.

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 13, 2024
1 parent a84a9ca commit 31134bd
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 52 deletions.
31 changes: 15 additions & 16 deletions tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# Convenience functions
checkerror() {
if [ $1 != 0 ]
then
printf "$2 - Error $1\n" >&2
exit $1
fi
}

# This script builds. Use when you have dotnet installed.
releaseconf=$1
if [ -z $releaseconf ]; then
Expand All @@ -25,27 +34,17 @@ fi

# Check for dependencies
dotnetpath=`which dotnet`
if [ ! $? == 0 ]; then
echo dotnet is not found.
exit 1
fi
checkerror $? "dotnet is not found"

# Download packages
echo Downloading packages...
"$dotnetpath" restore "../BassBoom.sln" -p:Configuration=$releaseconf
if [ ! $? == 0 ]; then
echo Download failed.
exit 1
fi
"$dotnetpath" restore "../BassBoom.sln" -p:Configuration=$releaseconf ${@:2}
checkerror $? "Failed to download packages"

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

# Inform success
echo Build successful.
exit 0
41 changes: 33 additions & 8 deletions tools/docgen-pack.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
#!/bin/bash

# BassBoom Copyright (C) 2023 Aptivi
#
# This file is part of BassBoom
#
# BassBoom is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BassBoom is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# Convenience functions
checkerror() {
if [ $1 != 0 ]
then
printf "$2 - Error $1\n" >&2
exit $1
fi
}

# This script builds KS and packs the artifacts. Use when you have MSBuild installed.
ksversion=$(grep "<Version>" ../Directory.Build.props | cut -d "<" -f 2 | cut -d ">" -f 2)
checkerror $? "Failed to get version. Check to make sure that the version is specified correctly in D.B.props"

# Check for dependencies
zippath=`which zip`
if [ ! $? == 0 ]; then
echo zip is not found.
exit 1
fi
checkerror $? "zip is not found"

# Pack documentation
echo Packing documentation...
cd "../docs/" && "$zippath" -r /tmp/$ksversion-doc.zip . && cd -
if [ ! $? == 0 ]; then
echo Packing failed.
exit 1
fi
checkerror $? "Failed to pack"

# Inform success
rm -rf "../DocGen/api"
checkerror $? "Failed to remove api folder"
rm -rf "../DocGen/obj"
checkerror $? "Failed to remove obj folder"
rm -rf "../docs"
checkerror $? "Failed to remove docs folder"
mv /tmp/$ksversion-doc.zip .
checkerror $? "Failed to move archive from temporary folder"
echo Pack successful.
exit 0
31 changes: 17 additions & 14 deletions tools/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,34 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# This script builds and packs the artifacts. Use when you have MSBuild installed.
version=$(grep "<Version>" ../Directory.Build.props | cut -d "<" -f 2 | cut -d ">" -f 2)
releaseconf=$1
if [ -z $releaseconf ]; then
releaseconf=Release
fi
# Convenience functions
checkerror() {
if [ $1 != 0 ]
then
printf "$2 - Error $1\n" >&2
exit $1
fi
}

# This script builds KS and packs the artifacts. Use when you have MSBuild installed.
ksversion=$(grep "<Version>" ../Directory.Build.props | cut -d "<" -f 2 | cut -d ">" -f 2)
checkerror $? "Failed to get version. Check to make sure that the version is specified correctly in D.B.props"

# Check for dependencies
zippath=`which zip`
if [ ! $? == 0 ]; then
echo zip is not found.
exit 1
fi
checkerror $? "zip is not found"

# Pack binary
echo Packing binary...
cd "../BassBoom.Cli/bin/$releaseconf/net8.0/" && "$zippath" -r /tmp/$version-cli.zip . && cd -
checkerror $? "Failed to pack"
cd "../BassBoom.Cli/bin/$releaseconf/net48/" && "$zippath" -r /tmp/$version-cli-48.zip . && cd -
if [ ! $? == 0 ]; then
echo Packing using zip failed.
exit 1
fi
checkerror $? "Failed to pack"

# Inform success
mv /tmp/$version-cli.zip .
checkerror $? "Failed to move archive from temporary folder"
mv /tmp/$version-cli-48.zip .
checkerror $? "Failed to move archive from temporary folder"
echo Build and pack successful.
exit 0
43 changes: 29 additions & 14 deletions tools/push.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
#!/bin/bash
# This script pushes. Use when you have dotnet installed.
releaseconf=$1
if [ -z $releaseconf ]; then
releaseconf=Release
fi

# Check for dependencies
# BassBoom Copyright (C) 2023 Aptivi
#
# This file is part of BassBoom
#
# BassBoom is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BassBoom is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# Convenience functions
checkerror() {
if [ $1 != 0 ]
then
printf "$2 - Error $1\n" >&2
exit $1
fi
}

# This script pushes. Use when you have dotnet installed.
dotnetpath=`which dotnet`
if [ ! $? == 0 ]; then
echo dotnet is not found.
exit 1
fi
checkerror $? "dotnet is not found"

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

# Inform success
echo Push successful.
Expand Down

0 comments on commit 31134bd

Please sign in to comment.