fix sailfish + fix ios-simulator + new checks

This commit is contained in:
therecipe 2016-12-16 21:59:46 +01:00
parent 8dbcd7aecc
commit 28b6970117
7 changed files with 140 additions and 130 deletions

View file

@ -246,9 +246,7 @@ If you use the STUB version, you are forced to use `qtminimal` otherwise it's op
5. Install Java SE Development Kit >= 8 (Linux: install in `$HOME/jdk/`); you can also define a custom location with **JDK_DIR**
* https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
6. You may need to `chmod` your `$GOROOT/pkg` dir or run the setup as **root**
7. Install and test (20 min)
6. Install and test (20 min)
* `%GOPATH%\bin\qtsetup android`
@ -256,9 +254,9 @@ If you use the STUB version, you are forced to use `qtminimal` otherwise it's op
* `$GOPATH/bin/qtsetup android`
8. Create your first [application](#example)
7. Create your first [application](#example)
9. Deploy applications with `[GOPATH]/bin/qtdeploy build android path/to/your/project`
8. Deploy applications with `[GOPATH]/bin/qtdeploy build android path/to/your/project`
## iOS
@ -286,9 +284,7 @@ If you use the STUB version, you are forced to use `qtminimal` otherwise it's op
* https://releases.sailfishos.org/sdk/installers/1611/SailfishOSSDK-Beta-1611-Qt5-mac-offline.dmg
* https://releases.sailfishos.org/sdk/installers/1611/SailfishOSSDK-Beta-1611-Qt5-linux-64-offline.run
4. You may need to `chmod` your `$GOROOT` dir or run the setup as **root**
5. Install and test (20 min)
4. Install and test (20 min)
* `%GOPATH%\bin\qtsetup sailfish && %GOPATH%\bin\qtsetup sailfish-emulator`
@ -296,9 +292,9 @@ If you use the STUB version, you are forced to use `qtminimal` otherwise it's op
* `$GOPATH/bin/qtsetup sailfish && $GOPATH/bin/qtsetup sailfish-emulator`
6. Create your first [application](#example)
5. Create your first [application](#example)
7. Deploy applications with `[GOPATH]/bin/qtdeploy build sailfish path/to/your/project` or `[GOPATH]/bin/qtdeploy build sailfish-emulator path/to/your/project`
6. Deploy applications with `[GOPATH]/bin/qtdeploy build sailfish path/to/your/project` or `[GOPATH]/bin/qtdeploy build sailfish-emulator path/to/your/project`
## Raspberry Pi
@ -404,9 +400,7 @@ If you use the STUB version, you are forced to use `qtminimal` otherwise it's op
* `sudo chown -R $USER $HOME/Qt5.7.0/`
14. You may need to `chmod` your `$GOROOT/pkg` dir or run the setup as **root**
15. Install and test the binding (20 min)
14. Install and test the binding (20 min)
* Raspberry Pi 1
* `$GOPATH/bin/qtsetup rpi1`
@ -417,7 +411,7 @@ If you use the STUB version, you are forced to use `qtminimal` otherwise it's op
* Raspberry Pi 3
* `$GOPATH/bin/qtsetup rpi3`
16. Notes
15. Notes
* run `startx &` before starting an application with `-platform xcb` (qml/quick applications won't work; they may work with Qt 5.8)
@ -425,9 +419,9 @@ If you use the STUB version, you are forced to use `qtminimal` otherwise it's op
* you can increase the available gpu memory by editing `/boot/config.txt`
17. Create your first [application](#example)
16. Create your first [application](#example)
18. Deploy applications with `$GOPATH/bin/qtdeploy build rpiX path/to/your/project` (replace X with 1, 2 or 3)
17. Deploy applications with `$GOPATH/bin/qtdeploy build rpiX path/to/your/project` (replace X with 1, 2 or 3)
## Docker

View file

@ -1086,7 +1086,7 @@ func run() {
case /*"ios",*/ "ios-simulator":
{
utils.RunCmdOptional(exec.Command("xcrun", "instruments", "-w", "iPhone 7 Plus (10.1)#"), fmt.Sprintf("start simulator for %v on %v", buildTarget, runtime.GOOS))
utils.RunCmdOptional(exec.Command("xcrun", "instruments", "-w", "iPhone 7 Plus (10.2)#"), fmt.Sprintf("start simulator for %v on %v", buildTarget, runtime.GOOS))
utils.RunCmd(exec.Command("xcrun", "simctl", "uninstall", "booted", filepath.Join(depPath, "main.app")), fmt.Sprintf("uninstall app for %v on %v", buildTarget, runtime.GOOS))
utils.RunCmd(exec.Command("xcrun", "simctl", "install", "booted", filepath.Join(depPath, "main.app")), fmt.Sprintf("install app for %v on %v", buildTarget, runtime.GOOS))
utils.RunCmd(exec.Command("xcrun", "simctl", "launch", "booted", fmt.Sprintf("com.identifier.%v", appName)), fmt.Sprintf("launch app for %v on %v", buildTarget, runtime.GOOS))

View file

@ -13,48 +13,9 @@ import (
func check(buildTarget string) {
utils.Log.Infof("running setup/check %v", buildTarget)
switch buildTarget {
case "desktop", "android", "ios", "ios-simulator",
"sailfish", "sailfish-emulator", "rpi1", "rpi2", "rpi3", "windows", "darwin", "linux",
"linux-docker", "windows-docker", "android-docker":
{
var buildDocker = strings.HasSuffix(buildTarget, "-docker")
switch buildTarget {
case "windows":
{
if runtime.GOOS == "windows" && !buildDocker {
} else if runtime.GOOS == "linux" || buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
}
utils.CheckBuildTarget(buildTarget)
case "darwin", "ios", "ios-simulator":
{
if runtime.GOOS == "darwin" && !buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v (not even with docker)", buildTarget, runtime.GOOS)
}
}
case "linux":
{
if runtime.GOOS == "linux" && !buildDocker {
} else if buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
}
}
}
default:
{
utils.Log.Panicf("failed to recognize build target %v", buildTarget)
}
}
utils.Log.Infoln("VERSION:", "0.0.2")
utils.Log.Infoln("VERSION:", "0.0.3")
utils.Log.Infoln("GOOS:", runtime.GOOS)
utils.Log.Infoln("GOARCH:", runtime.GOARCH)
utils.Log.Infoln("GOVERSION:", runtime.Version())

View file

@ -25,6 +25,10 @@ func install(buildTarget string) {
var env, tagFlags = getEnvAndTagflags(buildTarget)
if buildTarget == "sailfish" {
env["GOARCH"] = "386"
delete(env, "GOARM")
var _, err = ioutil.ReadDir(filepath.Join(runtime.GOROOT(), "bin", "linux_386"))
if err != nil {
var build = exec.Command(filepath.Join(runtime.GOROOT(), "src", func() string {
@ -104,46 +108,7 @@ func installPkgCmd(buildTarget, tagFlags, pkg string, env map[string]string) *ex
}
func getEnvAndTagflags(buildTarget string) (env map[string]string, tagFlags string) {
switch buildTarget {
case "desktop", "android", "ios", "ios-simulator",
"sailfish", "sailfish-emulator", "rpi1", "rpi2", "rpi3", "windows", "darwin", "linux",
"linux-docker", "windows-docker", "android-docker":
{
var buildDocker = strings.HasSuffix(buildTarget, "-docker")
switch buildTarget {
case "windows":
{
if runtime.GOOS == "windows" && !buildDocker {
} else if runtime.GOOS == "linux" || buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
}
case "darwin", "ios", "ios-simulator":
{
if runtime.GOOS == "darwin" && !buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v (not even with docker)", buildTarget, runtime.GOOS)
}
}
case "linux":
{
if runtime.GOOS == "linux" && !buildDocker {
} else if buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
}
}
}
default:
{
utils.Log.Panicf("failed to recognize build target %v", buildTarget)
}
}
utils.CheckBuildTarget(buildTarget)
switch buildTarget {
case

View file

@ -2,8 +2,6 @@ package main
import (
"os"
"runtime"
"strings"
"github.com/therecipe/qt/internal/utils"
)
@ -18,29 +16,7 @@ func main() {
"sailfish", "sailfish-emulator", "rpi1", "rpi2", "rpi3", "windows", "darwin", "linux",
"linux-docker", "windows-docker", "android-docker":
buildTarget = os.Args[1]
var buildDocker = strings.HasSuffix(buildTarget, "-docker")
switch buildTarget {
case "windows":
if runtime.GOOS == "windows" && !buildDocker {
} else if runtime.GOOS == "linux" || buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
case "darwin", "ios", "ios-simulator":
if runtime.GOOS == "darwin" && !buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v (not even with docker)", buildTarget, runtime.GOOS)
}
case "linux":
if runtime.GOOS == "linux" && !buildDocker {
} else if buildDocker {
} else {
utils.Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
}
utils.CheckBuildTarget(buildTarget)
case "prep", "check", "generate", "install", "test", "full":
buildMode = os.Args[1]

View file

@ -2,6 +2,7 @@ import QtQuick 2.0
Rectangle
{
id: root
width: 320
height: 240
@ -9,18 +10,69 @@ Rectangle
Text
{
id: title
id: title
anchors.centerIn: parent
color: "white"
font.pointSize: 16
font.pointSize: 16
Connections
Connections
{
target: QmlBridge
onSendToQml: title.text = data
}
}
target: QmlBridge
onSendToQml: title.text = data
}
}
Text
{
id: titleShadow
anchors
{
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
color: "white"
font.pointSize: 16
opacity: 0.75
Connections
{
target: QmlBridge
onSendToQml:
{
titleShadow.text = data
titleShadow.state = "up"
}
}
states: State
{
name: "up";
AnchorChanges
{
target: titleShadow
anchors.horizontalCenter: undefined
anchors.verticalCenter: undefined
anchors.bottom: root.top
}
}
transitions: Transition
{
AnchorAnimation { duration: 900 }
onRunningChanged:
{
if ((titleShadow.state == "up") && (!running)) //after the transition is completed
{
enabled = false
titleShadow.state = ""
enabled = true
}
}
}
}
MouseArea
{

View file

@ -20,3 +20,65 @@ func QT_DIR() string {
func QT_STUB() bool {
return strings.ToLower(os.Getenv("QT_STUB")) == "true"
}
func CheckBuildTarget(buildTarget string) {
switch buildTarget {
case "desktop", "android", "ios", "ios-simulator",
"sailfish", "sailfish-emulator", "rpi1", "rpi2", "rpi3", "windows", "darwin", "linux",
"linux-docker", "windows-docker", "android-docker":
{
var buildDocker = strings.HasSuffix(buildTarget, "-docker")
switch buildTarget {
case "windows":
{
if runtime.GOOS == "windows" && !buildDocker {
} else if runtime.GOOS == "linux" || buildDocker {
} else {
Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
}
case "darwin", "ios", "ios-simulator":
{
if runtime.GOOS == "darwin" && !buildDocker {
} else {
Log.Fatalf("%v is currently not supported as a deploy target on %v (not even with docker)", buildTarget, runtime.GOOS)
}
}
case "linux":
{
if runtime.GOOS == "linux" && !buildDocker {
} else if buildDocker {
} else {
Log.Fatalf("%v is currently not supported as a deploy target on %v", buildTarget, runtime.GOOS)
}
}
}
}
default:
{
Log.Panicf("failed to recognize build target %v", buildTarget)
}
}
if buildTarget == "android" || strings.HasPrefix(buildTarget, "ios") {
switch {
case UseMsys2():
{
Log.Fatalf("%v is not supported as a deploy target on %v with MSYS2 -> install the official Qt version instead and try again", buildTarget, runtime.GOOS)
}
case UseHomeBrew():
{
Log.Fatalf("%v is not supported as a deploy target on %v with HomeBrew -> install the official Qt version instead and try again", buildTarget, runtime.GOOS)
}
case UsePkgConfig():
{
Log.Fatalf("%v is not supported as a deploy target on %v with PkgConfig -> install the official Qt version instead and try again", buildTarget, runtime.GOOS)
}
}
}
}