Skip to content

Commit

Permalink
Use sfdk in build.sh
Browse files Browse the repository at this point in the history
Use sfdk to build releases.

Signed-off-by: Tomi Leppänen <[email protected]>
  • Loading branch information
Tomin1 committed Apr 19, 2022
1 parent 13b7918 commit c12dbca
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

: "${SFDK:=$HOME/.local/opt/SailfishOS/bin/sfdk}"

usage() {
2>&1 echo "Usage: $0 [--tag TAG] --dir DIRECTORY TARGET [TARGET...]"
2>&1 echo "Usage: $0 [--tag TAG] [--dir DIRECTORY] TARGET [TARGET...]"
exit 1
}

clean() {
git reset --hard HEAD
rm -f Makefile *.list
rm -f Makefile ./*.list
find data/ qml/ src/ tools/ translations/ \( \
-name Makefile -o \
-name '*.list' -o \
Expand All @@ -38,10 +40,6 @@ clean() {
popd
}

build() {
mb2 -t "$1" build -p -d $2
}

DIR=""
TAG=""
HARBOUR=""
Expand Down Expand Up @@ -69,7 +67,7 @@ done

TARGETS=$@

if [ "$DIR" = "" ] || [[ "${#TARGETS[@]}" -eq 0 ]]
if [[ "${#TARGETS[@]}" -eq 0 ]]
then
usage
fi
Expand All @@ -86,7 +84,11 @@ fi
for target in $TARGETS
do
echo "Building for $target"
build "$target" "$HARBOUR"
cp -v RPMS/*patience-deck-[0-9]*.rpm "$DIR/"
$SFDK -c "target=$target" build -p -d $HARBOUR
if [ "$DIR" != "" ]
then
cp -v "$($SFDK config --show | grep output-prefix \
| cut -d' ' -f3)/$target/"*patience-deck-[0-9]*.rpm "$DIR/"
fi
clean
done

0 comments on commit c12dbca

Please sign in to comment.