From b5decc60e8e1b1a0cc6832e9c6e95ccd0a9409c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 22 Aug 2019 10:11:00 +0200 Subject: [PATCH] Add the build number to macos build script --- azure-pipelines.yml | 5 +++-- compileOSX.sh | 14 ++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd9f5347..41db6d04 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,7 +45,7 @@ jobs: - script: | cd $(Build.SourcesDirectory) VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" - ./compileOSX.sh $VERSION + ./compileOSX.sh $VERSION $(Build.BuildNumber) displayName: 'Build' - task: CopyFiles@2 inputs: @@ -85,7 +85,8 @@ jobs: displayName: 'Create installer' - task: CopyFiles@2 inputs: - contents: $(Build.SourcesDirectory)\ci\win\Output\*.exe + sourceFolder: $(Build.SourcesDirectory)\ci\win\Output\ + contents: * targetFolder: $(Build.ArtifactStagingDirectory) - task: PublishPipelineArtifact@1 inputs: diff --git a/compileOSX.sh b/compileOSX.sh index 1d8ac2dc..9a7098d7 100755 --- a/compileOSX.sh +++ b/compileOSX.sh @@ -3,7 +3,9 @@ set -e VERSION=${1:-"9.5.0"} -if [ "$2" == "clean" ]; then +BUILD_NUMBER=${2:-"0"} + +if [ "$3" == "clean" ]; then ./cleanOSX.sh fi @@ -11,19 +13,19 @@ hash qmake 2>/dev/null || { echo >&2 "Qmake command not available. Please add th echo "Compiling YACReader" cd YACReader -qmake +qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" make cd .. echo "Compiling YACReaderLibrary" cd YACReaderLibrary -qmake +qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" make cd .. echo "Compiling YACReaderLibraryServer" cd YACReaderLibraryServer -qmake +qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" make cd .. @@ -36,7 +38,7 @@ cp -R YACReaderLibraryServer/YACReaderLibraryServer.app YACReaderLibraryServer.a ./releaseOSX.sh echo "Copying to destination folder" -dest="YACReader-$VERSION MacOSX-Intel" +dest="YACReader-$VERSION.$BUILD_NUMBER MacOSX-Intel" mkdir -p "$dest" cp -R YACReader.app "${dest}/YACReader.app" cp -R YACReaderLibrary.app "${dest}/YACReaderLibrary.app" @@ -53,6 +55,6 @@ echo "Creating dmg package" #tar -czf "${dest}".tar.gz "${dest}" #hdiutil create "${dest}".dmg -srcfolder "./${dest}" -ov -create-dmg --volname "YACReader $VERSION Installer" --volicon icon.icns --window-size 600 403 --icon-size 128 --app-drop-link 485 90 --background background.png --icon YACReader 80 90 --icon YACReaderLibrary 235 90 --eula COPYING.txt --icon YACReaderLibraryServer 470 295 --icon README.md 120 295 --icon COPYING.txt 290 295 "$dest.dmg" "$dest" +create-dmg --volname "YACReader $VERSION.$BUILD_NUMBER Installer" --volicon icon.icns --window-size 600 403 --icon-size 128 --app-drop-link 485 90 --background background.png --icon YACReader 80 90 --icon YACReaderLibrary 235 90 --eula COPYING.txt --icon YACReaderLibraryServer 470 295 --icon README.md 120 295 --icon COPYING.txt 290 295 "$dest.dmg" "$dest" echo "Done!"