Add the build number to macos build script

This commit is contained in:
Luis Ángel San Martín 2019-08-22 10:11:00 +02:00
parent be25613a98
commit b5decc60e8
2 changed files with 11 additions and 8 deletions

View File

@ -45,7 +45,7 @@ jobs:
- script: | - script: |
cd $(Build.SourcesDirectory) cd $(Build.SourcesDirectory)
VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" 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' displayName: 'Build'
- task: CopyFiles@2 - task: CopyFiles@2
inputs: inputs:
@ -85,7 +85,8 @@ jobs:
displayName: 'Create installer' displayName: 'Create installer'
- task: CopyFiles@2 - task: CopyFiles@2
inputs: inputs:
contents: $(Build.SourcesDirectory)\ci\win\Output\*.exe sourceFolder: $(Build.SourcesDirectory)\ci\win\Output\
contents: *
targetFolder: $(Build.ArtifactStagingDirectory) targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
inputs: inputs:

View File

@ -3,7 +3,9 @@ set -e
VERSION=${1:-"9.5.0"} VERSION=${1:-"9.5.0"}
if [ "$2" == "clean" ]; then BUILD_NUMBER=${2:-"0"}
if [ "$3" == "clean" ]; then
./cleanOSX.sh ./cleanOSX.sh
fi fi
@ -11,19 +13,19 @@ hash qmake 2>/dev/null || { echo >&2 "Qmake command not available. Please add th
echo "Compiling YACReader" echo "Compiling YACReader"
cd YACReader cd YACReader
qmake qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\""
make make
cd .. cd ..
echo "Compiling YACReaderLibrary" echo "Compiling YACReaderLibrary"
cd YACReaderLibrary cd YACReaderLibrary
qmake qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\""
make make
cd .. cd ..
echo "Compiling YACReaderLibraryServer" echo "Compiling YACReaderLibraryServer"
cd YACReaderLibraryServer cd YACReaderLibraryServer
qmake qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\""
make make
cd .. cd ..
@ -36,7 +38,7 @@ cp -R YACReaderLibraryServer/YACReaderLibraryServer.app YACReaderLibraryServer.a
./releaseOSX.sh ./releaseOSX.sh
echo "Copying to destination folder" echo "Copying to destination folder"
dest="YACReader-$VERSION MacOSX-Intel" dest="YACReader-$VERSION.$BUILD_NUMBER MacOSX-Intel"
mkdir -p "$dest" mkdir -p "$dest"
cp -R YACReader.app "${dest}/YACReader.app" cp -R YACReader.app "${dest}/YACReader.app"
cp -R YACReaderLibrary.app "${dest}/YACReaderLibrary.app" cp -R YACReaderLibrary.app "${dest}/YACReaderLibrary.app"
@ -53,6 +55,6 @@ echo "Creating dmg package"
#tar -czf "${dest}".tar.gz "${dest}" #tar -czf "${dest}".tar.gz "${dest}"
#hdiutil create "${dest}".dmg -srcfolder "./${dest}" -ov #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!" echo "Done!"