Merge branch 'mac-build'
This commit is contained in:
10
.travis.yml
10
.travis.yml
@@ -28,11 +28,11 @@ install:
|
||||
|
||||
env:
|
||||
global:
|
||||
secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
|
||||
secure: "gTRPB+QAFO+OgIMSonYIMq5yhyvMib20DaeMrueqDsQatXdoJHhmncV1m2Kqiwh2o7esZPVTKo2PcvLyWOqtFS6Jt/AX7TzEqj4yehgD4xr6stpaKkTkKgtd2UR29CJPASWJHXzavnm8d57ZNq5iEu0YhwdlKeu1/Koe3QoU5SM="
|
||||
|
||||
script: "./travis-script.sh"
|
||||
script: "tools/travis-script.sh"
|
||||
|
||||
after_success:
|
||||
- python upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH
|
||||
- python upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/Android/bin/Wagic-debug.apk -r Wagic-android.apk -b $TRAVIS_BRANCH
|
||||
- python upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH
|
||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH
|
||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/Android/bin/Wagic-debug.apk -r Wagic-android.apk -b $TRAVIS_BRANCH
|
||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH
|
||||
|
||||
@@ -61,7 +61,7 @@ after_deploy:
|
||||
|
||||
# to run your custom scripts instead of provider deployments
|
||||
deploy_script:
|
||||
- "C:/Python27/python.exe upload-binaries.py -t %GH_TOKEN% -s %APPVEYOR_REPO_COMMIT% -l projects/mtg/bin/Wagic-windows.zip -r Wagic-windows.zip -b %APPVEYOR_REPO_BRANCH%"
|
||||
- "C:/Python27/python.exe tools/upload-binaries.py -t %GH_TOKEN% -s %APPVEYOR_REPO_COMMIT% -l projects/mtg/bin/Wagic-windows.zip -r Wagic-windows.zip -b %APPVEYOR_REPO_BRANCH%"
|
||||
|
||||
# to disable deployment
|
||||
#deploy: off
|
||||
|
||||
20
projects/mtg/MacOS/Info.plist
Normal file
20
projects/mtg/MacOS/Info.plist
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Created by Qt/QMake</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>wagic.launcher</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>wagic.wagic</string>
|
||||
<key>NOTE</key>
|
||||
<string>This file was generated by Qt/QMake.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
projects/mtg/MacOS/wagic.icns
Normal file
BIN
projects/mtg/MacOS/wagic.icns
Normal file
Binary file not shown.
5
projects/mtg/MacOS/wagic.launcher
Executable file
5
projects/mtg/MacOS/wagic.launcher
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ${0%/*/*}/Resources
|
||||
#cd ../Resources
|
||||
exec ../MacOS/wagic -platformpluginpath ../PlugIns >> ../logs/out.log 2> ../logs/err.log
|
||||
@@ -134,6 +134,28 @@ maemo5: {
|
||||
USERDIR = /sdcard/Wagic/Res
|
||||
DEFINES += RESDIR=\\\"$$RESDIR\\\"
|
||||
DEFINES += USERDIR=\\\"$$USERDIR\\\"
|
||||
} else:macx {
|
||||
# Copy the custom Info.plist to the app bundle
|
||||
QMAKE_INFO_PLIST = MacOS/Info.plist
|
||||
# Icon is mandatory for submission
|
||||
ICON = MacOS/wagic.icns
|
||||
|
||||
#Move resource file
|
||||
res.commands = cd $$_PRO_FILE_PWD_/bin/Res; python createResourceZip.py;
|
||||
res.depends = all
|
||||
QMAKE_EXTRA_TARGETS += res
|
||||
|
||||
# Create a dmg file
|
||||
dmg.commands = mkdir wagic.app/Contents/logs; mkdir wagic.app/Contents/Resources/Res; mv $$_PRO_FILE_PWD_/bin/Res/core*.zip wagic.app/Contents/Resources/Res; cp $$_PRO_FILE_PWD_/MacOS/wagic.launcher wagic.app/Contents/MacOS; $$dirname(QMAKE_QMAKE)/macdeployqt wagic.app -dmg
|
||||
dmg.depends = res
|
||||
QMAKE_EXTRA_TARGETS += dmg
|
||||
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
|
||||
QMAKE_MAC_SDK = macosx
|
||||
|
||||
# Only Intel binaries are accepted so force this
|
||||
CONFIG += x86
|
||||
|
||||
} else:unix {
|
||||
# Variables
|
||||
BINDIR = /usr/bin
|
||||
|
||||
32
tools/build-macos-script.sh
Executable file
32
tools/build-macos-script.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
## New of branch to use
|
||||
TRAVIS_MAC_BRANCH=travis_mac_osx
|
||||
|
||||
## Only cross-compile on Mac the master branch
|
||||
test "$TRAVIS_BRANCH" != "master" && exit 0
|
||||
|
||||
## Configure Git to use OAuth token
|
||||
git config credential.helper "store --file=.git/credentials"
|
||||
echo "https://${GH_TOKEN}:@github.com" > .git/credentials
|
||||
|
||||
## Delete remote Travis-Mac branch (if any)
|
||||
REMOTE=$(git branch -r | grep "origin/$TRAVIS_MAC_BRANCH\$")
|
||||
if test -n "$REMOTE" ; then
|
||||
# Delete remote branch
|
||||
git branch -r -D "origin/$TRAVIS_MAC_BRANCH"
|
||||
# Push (delete) remote branch on temote server (e.g. github)
|
||||
git push origin ":$TRAVIS_MAC_BRANCH"
|
||||
fi
|
||||
|
||||
## Create a new branch
|
||||
git checkout -q -b "$TRAVIS_MAC_BRANCH" "$TRAVIS_BRANCH"
|
||||
|
||||
## Write a new Travis-CI configuration file
|
||||
cp tools/mac.travis.yml .travis.yml
|
||||
git add .travis.yml
|
||||
git rm appveyor.yml
|
||||
git commit -m "Auto-Updated Travis-CI configuration for Mac"
|
||||
|
||||
## Push new branch to remote server
|
||||
git push -q origin $TRAVIS_MAC_BRANCH:$TRAVIS_MAC_BRANCH
|
||||
12
tools/macos.travis.yml
Normal file
12
tools/macos.travis.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
language: objective-c
|
||||
before_install:
|
||||
- brew update
|
||||
- brew install qt5
|
||||
env:
|
||||
global:
|
||||
secure: "gTRPB+QAFO+OgIMSonYIMq5yhyvMib20DaeMrueqDsQatXdoJHhmncV1m2Kqiwh2o7esZPVTKo2PcvLyWOqtFS6Jt/AX7TzEqj4yehgD4xr6stpaKkTkKgtd2UR29CJPASWJHXzavnm8d57ZNq5iEu0YhwdlKeu1/Koe3QoU5SM="
|
||||
script:
|
||||
- /usr/local/opt/qt5/bin/qmake projects/mtg/wagic-qt.pro CONFIG+=graphics
|
||||
- make -j 4 dmg
|
||||
after_success:
|
||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l wagic.dmg -r Wagic-macosx.dmg -b $TRAVIS_BRANCH
|
||||
@@ -36,11 +36,11 @@ cd ../../../..
|
||||
|
||||
# we're building a PSP binary here
|
||||
cd JGE
|
||||
make -j 8
|
||||
make -j 4
|
||||
cd ..
|
||||
cd projects/mtg
|
||||
mkdir objs
|
||||
make -j 8
|
||||
make -j 4
|
||||
mkdir WTH
|
||||
mkdir WTH/Res
|
||||
mv EBOOT.PBP WTH/
|
||||
@@ -56,7 +56,7 @@ zip psprelease.zip -r WTH/
|
||||
cd ../..
|
||||
|
||||
# we're building an Android binary here
|
||||
android-ndk-r9/ndk-build -C projects/mtg/Android -j8
|
||||
android-ndk-r9/ndk-build -C projects/mtg/Android -j4
|
||||
$ANDROID list targets
|
||||
$ANDROID update project -t 1 -p projects/mtg/Android
|
||||
ant debug -f projects/mtg/Android/build.xml
|
||||
@@ -65,36 +65,17 @@ ant debug -f projects/mtg/Android/build.xml
|
||||
mkdir qt-gui-build
|
||||
cd qt-gui-build
|
||||
$QMAKE ../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
|
||||
make -j 8
|
||||
make -j 4
|
||||
cd ..
|
||||
|
||||
# let's try an Intel linux binary in debug text-mode-only
|
||||
$QMAKE projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR
|
||||
make -j 8
|
||||
|
||||
# we're cross-compiling a Qt Windows version here,
|
||||
# PATH is only set here to prevent colision
|
||||
|
||||
# export PATH="$PATH:/opt/mingw32/bin"
|
||||
# mkdir build
|
||||
# cd build
|
||||
# mkdir win-cross
|
||||
# cd win-cross
|
||||
# /opt/mingw32/bin/qmake ../../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
|
||||
# make -j 8
|
||||
# cd release
|
||||
# cp ../../../projects/mtg/bin/fmod.dll .
|
||||
# cp /opt/mingw32/bin/QtCore4.dll .
|
||||
# cp /opt/mingw32/bin/QtGui4.dll .
|
||||
# cp /opt/mingw32/bin/QtNetwork4.dll .
|
||||
# cp /opt/mingw32/bin/QtOpenGL4.dll .
|
||||
# cp ../../../projects/mtg/bin/zlib1.dll .
|
||||
# cp /opt/mingw32/bin/libpng15-15.dll .
|
||||
# cd ..
|
||||
# zip win-cross.zip -r release/
|
||||
# cd ../..
|
||||
make -j 4
|
||||
|
||||
# Now we run the testsuite (Res needs to be in the working directory)
|
||||
cd projects/mtg
|
||||
../../wagic
|
||||
cd ../..
|
||||
|
||||
# Let's launch de Mac cross-compilation
|
||||
./tools/build-macos-script.sh
|
||||
@@ -49,7 +49,7 @@ def main():
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if (options.token and options.sha and options.local and options.remote and options.branch == 'master'):
|
||||
if (options.token and options.sha and options.local and options.remote and (options.branch == 'master' or options.branch == 'travis_mac_osx')):
|
||||
gh = login(token = options.token)
|
||||
else:
|
||||
parser.print_help()
|
||||
@@ -1,99 +0,0 @@
|
||||
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
if [ "$TRAVIS_BRANCH" == "alphas" ]; then
|
||||
echo -e "Creating a release\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-d '{"tag_name": "alpha-'${TRAVIS_BUILD_NUMBER}'", "target_commitish": "master", "name": "Alpha release number '${TRAVIS_BUILD_NUMBER}'", "body": "Automatic alpha release generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
|
||||
IDDI=`cat json.txt | jq '.id'`
|
||||
|
||||
echo -e "Uploading Core resources\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github.manifold-preview" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @core.zip \
|
||||
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip"
|
||||
|
||||
echo -e "Uploading android package\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github.manifold-preview" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
|
||||
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk"
|
||||
|
||||
echo -e "Uploading PSP package\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github.manifold-preview" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @projects/mtg/psprelease.zip \
|
||||
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip"
|
||||
|
||||
# echo -e "Uploading Windows package\n"
|
||||
# curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
# -H "Accept: application/vnd.github.manifold-preview" \
|
||||
# -H "Content-Type: application/zip" \
|
||||
# --data-binary @build/win-cross/win-cross.zip \
|
||||
# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip"
|
||||
|
||||
echo -e "Done uploading\n"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
if [ "$TRAVIS_BRANCH" == "master" ]; then
|
||||
|
||||
# get info about all releases
|
||||
echo -e "Getting info about previous releases"
|
||||
curl -X GET -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
|
||||
|
||||
# extract info only about only "latest-release" tag
|
||||
cat json.txt |jq 'map(select (.tag_name == "latest-master"))' > latest.txt
|
||||
|
||||
# get id of release
|
||||
ID_TO_DELETE=`cat latest.txt |jq '.[0].id'`
|
||||
|
||||
# delete previous release
|
||||
echo -e "Deleting release number ${ID_TO_DELETE}"
|
||||
curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/WagicProject/wagic/releases/${ID_TO_DELETE}"
|
||||
|
||||
# delete previous tag
|
||||
curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/WagicProject/wagic/git/refs/tags/latest-master"
|
||||
|
||||
|
||||
echo -e "Creating a release\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-d '{"tag_name": "latest-master", "target_commitish": "master", "name": "master-'${TRAVIS_BUILD_NUMBER}'", "body": "Automatic release based on latest commit to master branch generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
|
||||
IDDI=`cat json.txt | jq '.id'`
|
||||
|
||||
echo -e "Uploading Core resources\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github.manifold-preview" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @core.zip \
|
||||
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip"
|
||||
|
||||
echo -e "Uploading android package\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github.manifold-preview" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
|
||||
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk"
|
||||
|
||||
echo -e "Uploading PSP package\n"
|
||||
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github.manifold-preview" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @projects/mtg/psprelease.zip \
|
||||
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip"
|
||||
|
||||
# echo -e "Uploading Windows package\n"
|
||||
# curl -X POST -H "Authorization: token ${GH_TOKEN}" \
|
||||
# -H "Accept: application/vnd.github.manifold-preview" \
|
||||
# -H "Content-Type: application/zip" \
|
||||
# --data-binary @build/win-cross/win-cross.zip \
|
||||
# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip"
|
||||
|
||||
echo -e "Done uploading\n"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user