Skip to content

Commit

Permalink
Qbs: Added generation of 7-zip archive for Windows
Browse files Browse the repository at this point in the history
It is not built by default. Instead it can be triggered by "-p archive" or
"--all-products" (this one will also build the installer).

Also configured AppVeyor to upload the archive and synchronized the
location of the Windows snapshots with the OS X snapshots.

Related to issue #366, but right now this is not a special version
regarding where settings are stored and it does still include the update
check, which will download the MSI installer. Especially that last thing
should be changed before this can be distributed (for example through the
itch.io app).
  • Loading branch information
bjorn committed May 6, 2016
1 parent 7b7c8d3 commit f263148
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 6 deletions.
14 changes: 10 additions & 4 deletions appveyor.yml
Expand Up @@ -35,13 +35,19 @@ build_script:

after_build:
- cd qt-release
- cd dist*
- pushd installer*
- move tiled-*.msi %APPVEYOR_BUILD_FOLDER%
- popd
- pushd archive*
- move tiled-*.7z %APPVEYOR_BUILD_FOLDER%
- popd
- if defined TILED_SNAPSHOT move appcast-win*-snapshots.xml %APPVEYOR_BUILD_FOLDER%

artifacts:
- name: Installer
path: 'tiled-*.msi'
- name: Archive
path: 'tiled-*.7z'
- name: AppCast
path: 'appcast-win*-snapshots.xml'

Expand All @@ -57,12 +63,12 @@ deploy:

- provider: FTP
protocol: sftp
host: files.mapeditor.org
host: update.mapeditor.org
username: bjorn
password:
secure: Hx5YfCOtpeBbftD4qnVCRLUGmMU9nogJTlSxq0xNbJQ=
folder: public_html/files.mapeditor.org/public/daily
artifact: /.*\.msi/
folder: sparkle/snapshots-win
artifact: /.*\.(msi|7z)/
on:
branch: snapshot
appveyor_repo_tag: false
Expand Down
2 changes: 1 addition & 1 deletion dist/appcast-win-snapshots.xml.in
Expand Up @@ -8,7 +8,7 @@
<title>Tiled @VERSION@</title>
<pubDate>@DATE@</pubDate>
<sparkle:releaseNotesLink>https://github.com/bjorn/tiled/commits/snapshot</sparkle:releaseNotesLink>
<enclosure url="http://files.mapeditor.org/daily/@FILENAME@"
<enclosure url="http://update.mapeditor.org/snapshots-win/@FILENAME@"
sparkle:version="@VERSION@"
type="application/octet-stream"/>
</item>
Expand Down
29 changes: 29 additions & 0 deletions dist/win/archive.qbs
@@ -0,0 +1,29 @@
import qbs

InstallPackage {
builtByDefault: false
condition: {
return (project.snapshot || project.release) &&
(qbs.toolchain.contains("mingw") || qbs.toolchain.contains("msvc"));
}

archiver.type: "7zip"

Depends {
productTypes: [
"application",
"dynamiclibrary",
"qm",
"installable",
]
}

property int bits: {
if (qbs.architecture === "x86_64")
return 64;
if (qbs.architecture === "x86")
return 32;
}

targetName: "tiled-" + project.version + "-win" + bits
}
164 changes: 164 additions & 0 deletions dist/win/distribute.qbs
@@ -0,0 +1,164 @@
/*
Installs all files necessary to run Tiled and other files that should be
shipped when Tiled is distributed.
*/

import qbs
import qbs.FileInfo

Product {
name: "distribute"
type: "installable"
builtByDefault: false

Depends { name: "cpp" }
Depends { name: "Qt.core" }

Group {
name: "Examples"
prefix: "../../examples/"
files: [
"desert.tmx",
"desert.tsx",
"hexagonal-mini.tmx",
"hexmini.png",
"isometric_grass_and_water.png",
"isometric_grass_and_water.tmx",
"perspective_walls.png",
"perspective_walls.tmx",
"perspective_walls.tsx",
"sewers.tmx",
"sewer_tileset.png",
"tmw_desert_spacing.png",
]

qbs.install: true
qbs.installDir: "examples"
}

Group {
name: "Examples (automapping)"
prefix: "../../examples/sewer_automap/"
files: [
"rules.txt",
"rules_sewers.png",
"rule_001.tmx",
"rule_002.tmx",
"rule_003.tmx",
"rule_004.tmx",
"rule_005.tmx",
"rule_006.tmx",
"rule_007.tmx",
"rule_008.tmx",
"rule_009.tmx",
"sewers.tmx",
]
qbs.install: true
qbs.installDir: "examples/sewer_automap"
}

Group {
name: "Qt DLLs"
prefix: Qt.core.binPath + "/"
property string postfix: qbs.debugInformation ? "d.dll" : ".dll"
files: [
"Qt5Core" + postfix,
"Qt5Gui" + postfix,
"Qt5Network" + postfix,
"Qt5Widgets" + postfix,
"Qt5OpenGL" + postfix,
"icuin54.dll",
"icuuc54.dll",
"icudt54.dll",
]
qbs.install: true
qbs.installDir: ""
}

Group {
name: "Qt Platform Plugin"
prefix: FileInfo.joinPaths(Qt.core.binPath, "../plugins/platforms/")
files: [
"qwindows.dll",
]
qbs.install: true
qbs.installDir: "plugins/platforms"
}

Group {
name: "Qt Image Format Plugins"
prefix: FileInfo.joinPaths(Qt.core.binPath, "../plugins/imageformats/")
files: [
"qgif.dll",
"qjpeg.dll",
"qtiff.dll",
]
qbs.install: true
qbs.installDir: "plugins/imageformats"
}

Group {
name: "Qt Translations"
prefix: FileInfo.joinPaths(Qt.core.binPath, "../translations/")
files: [
"qt_cs.qm",
"qt_de.qm",
"qt_es.qm",
"qt_fr.qm",
"qt_he.qm",
"qt_ja.qm",
"qt_pt.qm",
"qt_ru.qm",
"qt_zh_CN.qm",
"qt_zh_TW.qm",
]
qbs.install: true
qbs.installDir: "translations"
}

Group {
name: "Runtime DLLs"

prefix: {
if (qbs.toolchain.contains("mingw"))
return FileInfo.joinPaths(cpp.toolchainInstallPath) + "/"
else if (qbs.architecture === "x86_64")
return "C:/windows/SysWOW64/"
else
return "C:/windows/system32/"
}
files: {
if (qbs.toolchain.contains("mingw")) {
return [
"libgcc_s_dw2-1.dll",
"libstdc++-6.dll",
"libwinpthread-1.dll",
]
} else {
return [
"MSVCP120.DLL",
"MSVCR120.DLL",
]
}
}
qbs.install: true
qbs.installDir: ""
}

Group {
name: "Misc Files"
prefix: "../../"
files: [
"COPYING",
"AUTHORS",
"README.md",
"NEWS",
"LICENSE.APACHE",
"LICENSE.BSD",
"LICENSE.GPL",
"dist/win/qt.conf",
]
qbs.install: true
qbs.installDir: ""
}
}
File renamed without changes.
4 changes: 3 additions & 1 deletion tiled.qbs
Expand Up @@ -12,7 +12,9 @@ Project {
property bool release: qbs.getEnv("TILED_RELEASE")

references: [
"dist/win/dist.qbs",
"dist/win/archive.qbs",
"dist/win/distribute.qbs",
"dist/win/installer.qbs",
"src/automappingconverter",
"src/libtiled",
"src/plugins",
Expand Down

0 comments on commit f263148

Please sign in to comment.