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 41fc2dc commit b757801
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 39 deletions.
50 changes: 33 additions & 17 deletions tools/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
#!/bin/bash

# VisualCard Copyright (C) 2021-2024 Aptivi
#
# This file is part of VisualCard
#
# VisualCard 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.
#
# VisualCard 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. Use when you have dotnet installed.
releaseconf=$1
if [ -z $releaseconf ]; then
Expand All @@ -8,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 "../VisualCard.sln" -p:Configuration=$releaseconf
if [ ! $? == 0 ]; then
echo Download failed.
exit 1
fi
"$dotnetpath" restore "../VisualCard.sln" -p:Configuration=$releaseconf ${@:2}
checkerror $? "Failed to download packages"

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

# 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

# VisualCard Copyright (C) 2021-2024 Aptivi
#
# This file is part of VisualCard
#
# VisualCard 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.
#
# VisualCard 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
17 changes: 17 additions & 0 deletions tools/docgen.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#!/bin/bash

# VisualCard Copyright (C) 2021-2024 Aptivi
#
# This file is part of VisualCard
#
# VisualCard 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.
#
# VisualCard 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/>.

# Check for dependencies
msbuildpath=`which docfx`
if [ ! $? == 0 ]; then
Expand Down
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
# VisualCard Copyright (C) 2021-2024 Aptivi
#
# This file is part of VisualCard
#
# VisualCard 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.
#
# VisualCard 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 b757801

Please sign in to comment.