Commit 38220ba4 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: On demand compilation of the puppet

Before we had to provide the puppet in the packaging. Now we compile the
puppet on demand so we can be sure it is always there in the right version
and working.

Task-number: QTCREATORBUG-11763
Change-Id: I8556ef677ed27fbcc8a7775dced60230104e3237
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 3db252ee
......@@ -18,6 +18,8 @@ QT += core-private qml-private quick-private gui-private
CONFIG += c++11
}
DEFINES += QWEAKPOINTER_ENABLE_ARROW
DEFINES -= QT_CREATOR
......@@ -37,9 +39,12 @@ SOURCES += $$PWD/qml2puppetmain.cpp
RESOURCES += $$PWD/../qmlpuppet.qrc
DEFINES -= QT_NO_CAST_FROM_ASCII
OTHER_FILES += Info.plist.in
OTHER_FILES += Info.plist
macx {
QMAKE_INFO_PLIST = $$PWD/Info.plist
CONFIG -= app_bundle
QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$system_quote($$PWD/Info.plist)
} else {
target.path = $$QTC_PREFIX/bin
INSTALLS += target
......
......@@ -3,8 +3,6 @@ TARGET = qml2puppet
TEMPLATE = app
CONFIG += console
DESTDIR = $$[QT_INSTALL_BINS]
build_all:!build_pass {
CONFIG -= build_all
CONFIG += release
......
......@@ -22,9 +22,10 @@ SOURCES += $$PWD/qmlpuppetmain.cpp
RESOURCES += $$PWD/../qmlpuppet.qrc
DEFINES -= QT_NO_CAST_FROM_ASCII
OTHER_FILES += Info.plist.in
OTHER_FILES += Info.plist
macx {
QMAKE_INFO_PLIST = $$PWD/Info.plist
CONFIG -= app_bundle
QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$system_quote($$PWD/Info.plist)
} else {
target.path = $$QTC_PREFIX/bin
INSTALLS += target
......
......@@ -2,8 +2,6 @@ TARGET = qmlpuppet
TEMPLATE = app
DESTDIR = $$[QT_INSTALL_BINS]
build_all:!build_pass {
CONFIG -= build_all
CONFIG += release
......@@ -13,4 +11,4 @@ greaterThan(QT_MAJOR_VERSION, 4) {
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}
include(qmlpuppet.pri)
\ No newline at end of file
include(qmlpuppet.pri)
......@@ -2,7 +2,9 @@ INCLUDEPATH += $$PWD/
HEADERS += $$PWD/../include/nodeinstance.h
HEADERS += $$PWD/nodeinstanceserverproxy.h
HEADERS += $$PWD/puppetcreator.h
SOURCES += $$PWD/nodeinstanceserverproxy.cpp
SOURCES += $$PWD/nodeinstance.cpp
SOURCES += $$PWD/nodeinstanceview.cpp
SOURCES += $$PWD/puppetcreator.cpp
......@@ -79,12 +79,6 @@ protected:
void writeCommand(const QVariant &command);
void dispatchCommand(const QVariant &command);
NodeInstanceClientInterface *nodeInstanceClient() const;
QString missingQmlPuppetErrorMessage(const QString &preMessage) const;
QString copyAndPasterMessage(const QString &pathToQt) const;
QString qmlPuppetApplicationName() const;
QString macOSBundlePath(const QString &path) const;
QString creatorQmlPuppetPath();
static bool checkPuppetVersion(const QString &qmlPuppetPath);
signals:
void processCrashed();
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QMLDESIGNER_PUPPETCREATOR_H
#define QMLDESIGNER_PUPPETCREATOR_H
#include <QString>
#include <QProcessEnvironment>
namespace ProjectExplorer {
class Kit;
}
namespace QmlDesigner {
class PuppetCreator
{
enum Puppetype {
FallbackPuppet,
UserSpacePuppet
};
public:
enum QmlPuppetVersion {
Qml1Puppet,
Qml2Puppet
};
PuppetCreator(ProjectExplorer::Kit *kit, const QString &qtCreatorVersion);
QProcess *createPuppetProcess(QmlPuppetVersion puppetVersion,
const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
const char *outputSlot,
const char *finishSlot) const;
QString compileLog() const;
protected:
bool build(const QString &qmlPuppetProjectFilePath) const;
QString qmlpuppetDirectory(Puppetype puppetPathType) const;
QString qmlpuppetFallbackDirectory() const;
QString qml2puppetPath(Puppetype puppetType) const;
QString qmlpuppetPath(Puppetype puppetPathType) const;
bool startBuildProcess(const QString &buildDirectoryPath,
const QString &command,
const QStringList &processArguments = QStringList()) const;
static QString puppetSourceDirectoryPath();
static QString qml2puppetProjectFile();
static QString qmlpuppetProjectFile();
bool checkPuppetIsReady(const QString &puppetPath) const;
bool checkQml2puppetIsReady() const;
bool checkQmlpuppetIsReady() const;
bool qtIsSupported() const;
static bool checkPuppetVersion(const QString &qmlPuppetPath);
QProcess *puppetProcess(const QString &puppetPath,
const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
const char *outputSlot,
const char *finishSlot) const;
QProcess *qmlpuppetProcess(const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
const char *outputSlot,
const char *finishSlot) const;
QProcess *qml2puppetProcess(const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
const char *outputSlot,
const char *finishSlot) const;
QProcessEnvironment processEnvironment() const;
QString buildCommand() const;
QString qmakeCommand() const;
private:
QString m_qtCreatorVersion;
mutable QString m_compileLog;
ProjectExplorer::Kit *m_kit;
static bool m_useOnlyFallbackPuppet;
};
} // namespace QmlDesigner
#endif // QMLDESIGNER_PUPPETCREATOR_H
......@@ -4,25 +4,8 @@ TEMPLATE = app
include(../../../../qtcreator.pri)
BUILD_PUPPET_IN_CREATOR_BINPATH = $$(BUILD_PUPPET_IN_CREATOR_BINPATH)
CONFIG(debug, debug|release):isEmpty(BUILD_PUPPET_IN_CREATOR_BINPATH) {
QML_TARGET_PATH=$$[QT_INSTALL_BINS]/$$TARGET$$TARGET_EXT
if(write_file($$QML_TARGET_PATH)) {
CONVERTED_PATH=$$system_quote($$system_path($$QML_TARGET_PATH))
win32 {
system(del $$CONVERTED_PATH)
} else {
system(rm $$CONVERTED_PATH)
}
DESTDIR = $$[QT_INSTALL_BINS]
message("Build Qml Puppet to the Qt binary directory!")
} else {
message("Cannot create write Qml Puppet to the Qt binary directory!")
}
} else {
DESTDIR = $$IDE_BIN_PATH
message("Build Qml Puppet to Qt Creator binary directory!")
}
DESTDIR = $$IDE_BIN_PATH
include(../../../rpath.pri)
include(../../../../share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment