Merge lp:~zeller-benjamin/ubuntu-sdk-ide/snapcraft-step1 into lp:ubuntu-sdk-ide
- snapcraft-step1
- Merge into trunk
Proposed by
Benjamin Zeller
Status: | Merged |
---|---|
Approved by: | Zoltan Balogh |
Approved revision: | 162 |
Merged at revision: | 162 |
Proposed branch: | lp:~zeller-benjamin/ubuntu-sdk-ide/snapcraft-step1 |
Merge into: | lp:ubuntu-sdk-ide |
Diff against target: |
1792 lines (+1298/-81) 30 files modified
CMakeLists.txt (+1/-1) apply-patches.sh (+12/-0) debian/patches/cmake_ubuntuspecificbits.diff (+101/-60) dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro (+9/-2) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro (+32/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/Main.qml (+54/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop (+9/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro (+48/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.qrc (+5/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.wrapper (+63/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/main.cpp (+14/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml (+23/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json (+108/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/qml/publishpage.qml (+2/-2) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/usdk-target-build (+1/-0) dist/qtcreator/src/plugins/ubuntu/src/plugin.pri (+1/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.cpp (+1/-1) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.h (+1/-1) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.cpp (+468/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.h (+105/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.cpp (+30/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.h (+22/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h (+1/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.cpp (+46/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.h (+37/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.cpp (+86/-5) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.h (+1/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp (+9/-3) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp (+7/-5) fix-qt-build.py (+1/-1) |
To merge this branch: | bzr merge lp:~zeller-benjamin/ubuntu-sdk-ide/snapcraft-step1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Zoltan Balogh | Approve | ||
Review via email: mp+306510@code.launchpad.net |
Commit message
Support to package snapcraft projects in the IDE (Step 1)
Description of the change
Support to package snapcraft projects in the IDE (Step 1)
To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
review:
Approve
(continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) wrote : | # |
let's see it in action in the meantime
review:
Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:162
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-09-14 14:37:07 +0000 | |||
3 | +++ CMakeLists.txt 2016-09-22 16:34:17 +0000 | |||
4 | @@ -86,7 +86,7 @@ | |||
5 | 86 | ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG) | 86 | ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG) |
6 | 87 | 87 | ||
7 | 88 | add_custom_target(ApplyPatches | 88 | add_custom_target(ApplyPatches |
9 | 89 | env QUILT_PATCHES=debian/patches quilt push -a | 89 | ${CMAKE_SOURCE_DIR}/apply-patches.sh |
10 | 90 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 90 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
11 | 91 | 91 | ||
12 | 92 | ExternalProject_Add(${QT_VERSION} | 92 | ExternalProject_Add(${QT_VERSION} |
13 | 93 | 93 | ||
14 | === added file 'apply-patches.sh' | |||
15 | --- apply-patches.sh 1970-01-01 00:00:00 +0000 | |||
16 | +++ apply-patches.sh 2016-09-22 16:34:17 +0000 | |||
17 | @@ -0,0 +1,12 @@ | |||
18 | 1 | #!/bin/bash | ||
19 | 2 | |||
20 | 3 | env QUILT_PATCHES=debian/patches quilt push -a | ||
21 | 4 | |||
22 | 5 | RESULT=$? | ||
23 | 6 | |||
24 | 7 | if [ $RESULT -eq 0 -o $RESULT -eq 2 ]; then | ||
25 | 8 | exit 0 | ||
26 | 9 | fi | ||
27 | 10 | |||
28 | 11 | exit 1 | ||
29 | 12 | |||
30 | 0 | 13 | ||
31 | === modified file 'debian/patches/cmake_ubuntuspecificbits.diff' | |||
32 | --- debian/patches/cmake_ubuntuspecificbits.diff 2016-09-15 12:31:17 +0000 | |||
33 | +++ debian/patches/cmake_ubuntuspecificbits.diff 2016-09-22 16:34:17 +0000 | |||
34 | @@ -1,8 +1,6 @@ | |||
40 | 1 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 1 | --- a/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp |
41 | 2 | =================================================================== | 2 | +++ b/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp |
42 | 3 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 3 | @@ -165,10 +165,10 @@ |
38 | 4 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | ||
39 | 5 | @@ -165,10 +165,10 @@ void CMakeManager::createXmlFile(Utils:: | ||
43 | 6 | proc->setWorkingDirectory(buildDirectoryPath); | 4 | proc->setWorkingDirectory(buildDirectoryPath); |
44 | 7 | proc->setEnvironment(env); | 5 | proc->setEnvironment(env); |
45 | 8 | 6 | ||
46 | @@ -16,11 +14,9 @@ | |||
47 | 16 | Utils::QtcProcess::addArgs(&args, arguments); | 14 | Utils::QtcProcess::addArgs(&args, arguments); |
48 | 17 | 15 | ||
49 | 18 | proc->setCommand(executable, args); | 16 | proc->setCommand(executable, args); |
55 | 19 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/qmlprojectmanager/qmlproject.cpp | 17 | --- a/dist/qtcreator/src/plugins/qmlprojectmanager/qmlproject.cpp |
56 | 20 | =================================================================== | 18 | +++ b/dist/qtcreator/src/plugins/qmlprojectmanager/qmlproject.cpp |
57 | 21 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/qmlprojectmanager/qmlproject.cpp | 19 | @@ -288,9 +288,10 @@ |
53 | 22 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/qmlprojectmanager/qmlproject.cpp | ||
54 | 23 | @@ -288,9 +288,10 @@ Internal::Manager *QmlProject::projectMa | ||
58 | 24 | bool QmlProject::supportsKit(Kit *k, QString *errorMessage) const | 20 | bool QmlProject::supportsKit(Kit *k, QString *errorMessage) const |
59 | 25 | { | 21 | { |
60 | 26 | Id deviceType = DeviceTypeKitInformation::deviceTypeId(k); | 22 | Id deviceType = DeviceTypeKitInformation::deviceTypeId(k); |
61 | @@ -33,11 +29,9 @@ | |||
62 | 33 | return false; | 29 | return false; |
63 | 34 | } | 30 | } |
64 | 35 | 31 | ||
70 | 36 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.cpp | 32 | --- a/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.cpp |
71 | 37 | =================================================================== | 33 | +++ b/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.cpp |
72 | 38 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.cpp | 34 | @@ -2024,6 +2024,7 @@ |
68 | 39 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.cpp | ||
69 | 40 | @@ -2024,6 +2024,7 @@ EvalResult *QmakeProFileNode::evaluate(c | ||
73 | 41 | result->newVarValues[AndroidExtraLibs] = input.readerExact->values(QLatin1String("ANDROID_EXTRA_LIBS")); | 35 | result->newVarValues[AndroidExtraLibs] = input.readerExact->values(QLatin1String("ANDROID_EXTRA_LIBS")); |
74 | 42 | result->newVarValues[IsoIconsVar] = input.readerExact->values(QLatin1String("ISO_ICONS")); | 36 | result->newVarValues[IsoIconsVar] = input.readerExact->values(QLatin1String("ISO_ICONS")); |
75 | 43 | result->newVarValues[QmakeProjectName] = input.readerExact->values(QLatin1String("QMAKE_PROJECT_NAME")); | 37 | result->newVarValues[QmakeProjectName] = input.readerExact->values(QLatin1String("QMAKE_PROJECT_NAME")); |
76 | @@ -45,11 +39,9 @@ | |||
77 | 45 | 39 | ||
78 | 46 | result->isDeployable = false; | 40 | result->isDeployable = false; |
79 | 47 | if (result->projectType == ApplicationTemplate) { | 41 | if (result->projectType == ApplicationTemplate) { |
85 | 48 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.h | 42 | --- a/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.h |
86 | 49 | =================================================================== | 43 | +++ b/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.h |
87 | 50 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.h | 44 | @@ -107,7 +107,8 @@ |
83 | 51 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/qmakeprojectmanager/qmakenodes.h | ||
84 | 52 | @@ -107,7 +107,8 @@ enum QmakeVariable { | ||
88 | 53 | AndroidPackageSourceDir, | 45 | AndroidPackageSourceDir, |
89 | 54 | AndroidExtraLibs, | 46 | AndroidExtraLibs, |
90 | 55 | IsoIconsVar, | 47 | IsoIconsVar, |
91 | @@ -59,10 +51,8 @@ | |||
92 | 59 | }; | 51 | }; |
93 | 60 | 52 | ||
94 | 61 | namespace Internal { | 53 | namespace Internal { |
99 | 62 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeconfigitem.h | 54 | --- a/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeconfigitem.h |
100 | 63 | =================================================================== | 55 | +++ b/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeconfigitem.h |
97 | 64 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeconfigitem.h | ||
98 | 65 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeconfigitem.h | ||
101 | 66 | @@ -25,6 +25,8 @@ | 56 | @@ -25,6 +25,8 @@ |
102 | 67 | 57 | ||
103 | 68 | #pragma once | 58 | #pragma once |
104 | @@ -72,7 +62,7 @@ | |||
105 | 72 | #include <QByteArray> | 62 | #include <QByteArray> |
106 | 73 | #include <QList> | 63 | #include <QList> |
107 | 74 | 64 | ||
109 | 75 | @@ -34,7 +36,7 @@ namespace ProjectExplorer { class Kit; } | 65 | @@ -34,7 +36,7 @@ |
110 | 76 | 66 | ||
111 | 77 | namespace CMakeProjectManager { | 67 | namespace CMakeProjectManager { |
112 | 78 | 68 | ||
113 | @@ -81,11 +71,9 @@ | |||
114 | 81 | public: | 71 | public: |
115 | 82 | enum Type { FILEPATH, PATH, BOOL, STRING, INTERNAL, STATIC }; | 72 | enum Type { FILEPATH, PATH, BOOL, STRING, INTERNAL, STATIC }; |
116 | 83 | CMakeConfigItem(); | 73 | CMakeConfigItem(); |
122 | 84 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.cpp | 74 | --- a/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.cpp |
123 | 85 | =================================================================== | 75 | +++ b/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.cpp |
124 | 86 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.cpp | 76 | @@ -568,6 +568,11 @@ |
120 | 87 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.cpp | ||
121 | 88 | @@ -568,6 +568,11 @@ bool QtVersionManager::isValidId(int id) | ||
125 | 89 | return m_versions.contains(id); | 77 | return m_versions.contains(id); |
126 | 90 | } | 78 | } |
127 | 91 | 79 | ||
128 | @@ -97,11 +85,9 @@ | |||
129 | 97 | BaseQtVersion *QtVersionManager::version(int id) | 85 | BaseQtVersion *QtVersionManager::version(int id) |
130 | 98 | { | 86 | { |
131 | 99 | QTC_ASSERT(isLoaded(), return 0); | 87 | QTC_ASSERT(isLoaded(), return 0); |
137 | 100 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.h | 88 | --- a/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.h |
138 | 101 | =================================================================== | 89 | +++ b/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.h |
139 | 102 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.h | 90 | @@ -63,6 +63,7 @@ |
135 | 103 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/qtsupport/qtversionmanager.h | ||
136 | 104 | @@ -63,6 +63,7 @@ public: | ||
140 | 105 | static void removeVersion(BaseQtVersion *version); | 91 | static void removeVersion(BaseQtVersion *version); |
141 | 106 | 92 | ||
142 | 107 | static bool isValidId(int id); | 93 | static bool isValidId(int id); |
143 | @@ -109,11 +95,9 @@ | |||
144 | 109 | 95 | ||
145 | 110 | signals: | 96 | signals: |
146 | 111 | // content of BaseQtVersion objects with qmake path might have changed | 97 | // content of BaseQtVersion objects with qmake path might have changed |
152 | 112 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/plugins.pro | 98 | --- a/dist/qtcreator/src/plugins/plugins.pro |
153 | 113 | =================================================================== | 99 | +++ b/dist/qtcreator/src/plugins/plugins.pro |
154 | 114 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/plugins.pro | 100 | @@ -56,7 +56,8 @@ |
150 | 115 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/plugins.pro | ||
151 | 116 | @@ -56,7 +56,8 @@ SUBDIRS = \ | ||
155 | 117 | winrt \ | 101 | winrt \ |
156 | 118 | qmlprofiler \ | 102 | qmlprofiler \ |
157 | 119 | updateinfo \ | 103 | updateinfo \ |
158 | @@ -123,11 +107,9 @@ | |||
159 | 123 | 107 | ||
160 | 124 | DO_NOT_BUILD_QMLDESIGNER = $$(DO_NOT_BUILD_QMLDESIGNER) | 108 | DO_NOT_BUILD_QMLDESIGNER = $$(DO_NOT_BUILD_QMLDESIGNER) |
161 | 125 | isEmpty(DO_NOT_BUILD_QMLDESIGNER) { | 109 | isEmpty(DO_NOT_BUILD_QMLDESIGNER) { |
167 | 126 | Index: ubuntu-sdk-ide/dist/qt5/ubuntu-sdk/ubuntu-sdk.pro | 110 | --- a/dist/qt5/ubuntu-sdk/ubuntu-sdk.pro |
168 | 127 | =================================================================== | 111 | +++ b/dist/qt5/ubuntu-sdk/ubuntu-sdk.pro |
169 | 128 | --- ubuntu-sdk-ide.orig/dist/qt5/ubuntu-sdk/ubuntu-sdk.pro | 112 | @@ -11,10 +11,10 @@ |
165 | 129 | +++ ubuntu-sdk-ide/dist/qt5/ubuntu-sdk/ubuntu-sdk.pro | ||
166 | 130 | @@ -11,10 +11,10 @@ load(qt_parts) | ||
170 | 131 | src_uitk_launcher.subdir = ubuntu-ui-toolkit-launcher | 113 | src_uitk_launcher.subdir = ubuntu-ui-toolkit-launcher |
171 | 132 | src_uitk_launcher.depends = sub-src | 114 | src_uitk_launcher.depends = sub-src |
172 | 133 | 115 | ||
173 | @@ -141,11 +123,9 @@ | |||
174 | 141 | 123 | ||
175 | 142 | # additional 'make test' target required by continuous integration system | 124 | # additional 'make test' target required by continuous integration system |
176 | 143 | test.target = test | 125 | test.target = test |
182 | 144 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.cpp | 126 | --- a/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.cpp |
183 | 145 | =================================================================== | 127 | +++ b/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.cpp |
184 | 146 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.cpp | 128 | @@ -387,6 +387,18 @@ |
180 | 147 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.cpp | ||
181 | 148 | @@ -387,6 +387,18 @@ void CMakeProject::runCMake() | ||
185 | 149 | } | 129 | } |
186 | 150 | } | 130 | } |
187 | 151 | 131 | ||
188 | @@ -164,10 +144,8 @@ | |||
189 | 164 | QList<CMakeBuildTarget> CMakeProject::buildTargets() const | 144 | QList<CMakeBuildTarget> CMakeProject::buildTargets() const |
190 | 165 | { | 145 | { |
191 | 166 | BuildDirManager *bdm = nullptr; | 146 | BuildDirManager *bdm = nullptr; |
196 | 167 | Index: ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.h | 147 | --- a/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.h |
197 | 168 | =================================================================== | 148 | +++ b/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.h |
194 | 169 | --- ubuntu-sdk-ide.orig/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.h | ||
195 | 170 | +++ ubuntu-sdk-ide/dist/qtcreator/src/plugins/cmakeprojectmanager/cmakeproject.h | ||
198 | 171 | @@ -27,6 +27,7 @@ | 149 | @@ -27,6 +27,7 @@ |
199 | 172 | 150 | ||
200 | 173 | #include "cmake_global.h" | 151 | #include "cmake_global.h" |
201 | @@ -176,7 +154,7 @@ | |||
202 | 176 | 154 | ||
203 | 177 | #include <projectexplorer/extracompiler.h> | 155 | #include <projectexplorer/extracompiler.h> |
204 | 178 | #include <projectexplorer/project.h> | 156 | #include <projectexplorer/project.h> |
206 | 179 | @@ -111,6 +112,8 @@ public: | 157 | @@ -111,6 +112,8 @@ |
207 | 180 | 158 | ||
208 | 181 | void runCMake(); | 159 | void runCMake(); |
209 | 182 | 160 | ||
210 | @@ -185,11 +163,9 @@ | |||
211 | 185 | signals: | 163 | signals: |
212 | 186 | /// emitted when cmake is running: | 164 | /// emitted when cmake is running: |
213 | 187 | void parsingStarted(); | 165 | void parsingStarted(); |
219 | 188 | Index: ubuntu-sdk-ide/dist/qt5/ubuntu-sdk/src/UbuntuToolkit/menubar.cpp | 166 | --- a/dist/qt5/ubuntu-sdk/src/UbuntuToolkit/menubar.cpp |
220 | 189 | =================================================================== | 167 | +++ b/dist/qt5/ubuntu-sdk/src/UbuntuToolkit/menubar.cpp |
221 | 190 | --- ubuntu-sdk-ide.orig/dist/qt5/ubuntu-sdk/src/UbuntuToolkit/menubar.cpp | 168 | @@ -249,11 +249,11 @@ |
217 | 191 | +++ ubuntu-sdk-ide/dist/qt5/ubuntu-sdk/src/UbuntuToolkit/menubar.cpp | ||
218 | 192 | @@ -249,11 +249,11 @@ PlatformMenuWrapper::PlatformMenuWrapper | ||
222 | 193 | , m_target(target) | 169 | , m_target(target) |
223 | 194 | , m_inserted(false) | 170 | , m_inserted(false) |
224 | 195 | { | 171 | { |
225 | @@ -206,3 +182,68 @@ | |||
226 | 206 | 182 | ||
227 | 207 | syncPlatformMenu(); | 183 | syncPlatformMenu(); |
228 | 208 | } | 184 | } |
229 | 185 | --- a/dist/qtcreator/src/plugins/coreplugin/generatedfile.cpp | ||
230 | 186 | +++ b/dist/qtcreator/src/plugins/coreplugin/generatedfile.cpp | ||
231 | 187 | @@ -161,6 +161,12 @@ | ||
232 | 188 | |||
233 | 189 | Utils::FileSaver saver(m_d->path, flags); | ||
234 | 190 | saver.write(m_d->contents); | ||
235 | 191 | + | ||
236 | 192 | + if (attributes() & UserExecutable) { | ||
237 | 193 | + QFile *createdFile = saver.file(); | ||
238 | 194 | + createdFile->setPermissions(createdFile->permissions() | QFileDevice::ExeOwner); | ||
239 | 195 | + } | ||
240 | 196 | + | ||
241 | 197 | return saver.finalize(errorMessage); | ||
242 | 198 | } | ||
243 | 199 | |||
244 | 200 | --- a/dist/qtcreator/src/plugins/coreplugin/generatedfile.h | ||
245 | 201 | +++ b/dist/qtcreator/src/plugins/coreplugin/generatedfile.h | ||
246 | 202 | @@ -46,7 +46,9 @@ | ||
247 | 203 | /* File exists and the user indicated that he wants to keep it */ | ||
248 | 204 | KeepExistingFileAttribute = 0x8, | ||
249 | 205 | /* Force overwriting of a file without asking the user to keep it */ | ||
250 | 206 | - ForceOverwrite = 0x10 | ||
251 | 207 | + ForceOverwrite = 0x10, | ||
252 | 208 | + /* Set User executable flag*/ | ||
253 | 209 | + UserExecutable = 0x20 | ||
254 | 210 | }; | ||
255 | 211 | Q_DECLARE_FLAGS(Attributes, Attribute) | ||
256 | 212 | |||
257 | 213 | --- a/dist/qtcreator/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp | ||
258 | 214 | +++ b/dist/qtcreator/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp | ||
259 | 215 | @@ -70,6 +70,7 @@ | ||
260 | 216 | f.overwrite = tmp.value(QLatin1String("overwrite"), false); | ||
261 | 217 | f.openInEditor = tmp.value(QLatin1String("openInEditor"), false); | ||
262 | 218 | f.openAsProject = tmp.value(QLatin1String("openAsProject"), false); | ||
263 | 219 | + f.isUserExecutable = tmp.value(QLatin1String("userExecutable"), false); | ||
264 | 220 | |||
265 | 221 | f.options = JsonWizard::parseOptions(tmp.value(QLatin1String("options")), errorMessage); | ||
266 | 222 | if (!errorMessage->isEmpty()) | ||
267 | 223 | @@ -146,6 +147,8 @@ | ||
268 | 224 | attributes |= Core::GeneratedFile::OpenProjectAttribute; | ||
269 | 225 | if (JsonWizard::boolFromVariant(file.overwrite, expander)) | ||
270 | 226 | attributes |= Core::GeneratedFile::ForceOverwrite; | ||
271 | 227 | + if (JsonWizard::boolFromVariant(file.isUserExecutable, expander)) | ||
272 | 228 | + attributes |= Core::GeneratedFile::UserExecutable; | ||
273 | 229 | |||
274 | 230 | if (file.keepExisting) | ||
275 | 231 | attributes |= Core::GeneratedFile::KeepExistingFileAttribute; | ||
276 | 232 | @@ -231,6 +234,7 @@ | ||
277 | 233 | if (!file->write(errorMessage)) | ||
278 | 234 | return false; | ||
279 | 235 | } | ||
280 | 236 | + | ||
281 | 237 | return true; | ||
282 | 238 | } | ||
283 | 239 | |||
284 | 240 | --- a/dist/qtcreator/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h | ||
285 | 241 | +++ b/dist/qtcreator/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h | ||
286 | 242 | @@ -55,6 +55,7 @@ | ||
287 | 243 | QVariant overwrite = false; | ||
288 | 244 | QVariant openInEditor = false; | ||
289 | 245 | QVariant openAsProject = false; | ||
290 | 246 | + QVariant isUserExecutable = false; | ||
291 | 247 | |||
292 | 248 | QList<JsonWizard::OptionDefinition> options; | ||
293 | 249 | }; | ||
294 | 209 | 250 | ||
295 | === modified file 'dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro' | |||
296 | --- dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro 2016-09-05 17:35:40 +0000 | |||
297 | +++ dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro 2016-09-22 16:34:17 +0000 | |||
298 | @@ -106,7 +106,10 @@ | |||
299 | 106 | src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp \ | 106 | src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp \ |
300 | 107 | src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp \ | 107 | src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp \ |
301 | 108 | src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp \ | 108 | src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp \ |
303 | 109 | src/ubuntu/processoutputdialog.cpp | 109 | src/ubuntu/processoutputdialog.cpp \ |
304 | 110 | $$PWD/src/ubuntu/ubuntujsextension.cpp \ | ||
305 | 111 | src/ubuntu/snap/snapcraftpackagestep.cpp \ | ||
306 | 112 | src/ubuntu/snap/snaphelper.cpp | ||
307 | 110 | 113 | ||
308 | 111 | HEADERS += \ | 114 | HEADERS += \ |
309 | 112 | src/ubuntu/ubuntuplugin.h \ | 115 | src/ubuntu/ubuntuplugin.h \ |
310 | @@ -175,7 +178,10 @@ | |||
311 | 175 | src/ubuntu/device/container/ubuntulocaldeployconfiguration.h \ | 178 | src/ubuntu/device/container/ubuntulocaldeployconfiguration.h \ |
312 | 176 | src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.h \ | 179 | src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.h \ |
313 | 177 | src/ubuntu/device/container/ubuntulocalrunconfiguration.h \ | 180 | src/ubuntu/device/container/ubuntulocalrunconfiguration.h \ |
315 | 178 | src/ubuntu/processoutputdialog.h | 181 | src/ubuntu/processoutputdialog.h \ |
316 | 182 | $$PWD/src/ubuntu/ubuntujsextension.h \ | ||
317 | 183 | src/ubuntu/snap/snapcraftpackagestep.h \ | ||
318 | 184 | src/ubuntu/snap/snaphelper.h | ||
319 | 179 | 185 | ||
320 | 180 | #remote device support | 186 | #remote device support |
321 | 181 | SOURCES += \ | 187 | SOURCES += \ |
322 | @@ -214,6 +220,7 @@ | |||
323 | 214 | src/ubuntu/device/remote/ubuntudirectuploadstep.h \ | 220 | src/ubuntu/device/remote/ubuntudirectuploadstep.h \ |
324 | 215 | src/ubuntu/device/remote/ubuntudeploystepfactory.h | 221 | src/ubuntu/device/remote/ubuntudeploystepfactory.h |
325 | 216 | 222 | ||
326 | 223 | |||
327 | 217 | FORMS += \ | 224 | FORMS += \ |
328 | 218 | src/ubuntu/device/remote/ubunturemoterunconfigurationwidget.ui \ | 225 | src/ubuntu/device/remote/ubunturemoterunconfigurationwidget.ui \ |
329 | 219 | 226 | ||
330 | 220 | 227 | ||
331 | === added directory 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake' | |||
332 | === added directory 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName' | |||
333 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro' | |||
334 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro 1970-01-01 00:00:00 +0000 | |||
335 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro 2016-09-22 16:34:17 +0000 | |||
336 | @@ -0,0 +1,32 @@ | |||
337 | 1 | # This is the basic qmake template for the Ubuntu-SDK | ||
338 | 2 | # it handles creation and installation of the manifest | ||
339 | 3 | # file and takes care of subprojects | ||
340 | 4 | TEMPLATE = subdirs | ||
341 | 5 | |||
342 | 6 | SUBDIRS += %{ProjectNameL} | ||
343 | 7 | |||
344 | 8 | # enables/disabled the extra targets to build a snapcraft package | ||
345 | 9 | # also tells the IDE this is a snapcraft project | ||
346 | 10 | CONFIG += snapcraft | ||
347 | 11 | |||
348 | 12 | snapcraft { | ||
349 | 13 | |||
350 | 14 | SNAPCRAFT_FILE=snapcraft.yaml | ||
351 | 15 | |||
352 | 16 | #the Ubuntu SDK IDE uses the snap target to create the package | ||
353 | 17 | snappy.target = snap | ||
354 | 18 | snappy.commands = cd $$OUT_PWD | ||
355 | 19 | snappy.commands += && rm -rf \'$$OUT_PWD/snap-deploy\' | ||
356 | 20 | snappy.commands += && make INSTALL_ROOT=$$OUT_PWD/snap-deploy install | ||
357 | 21 | snappy.commands += && cd $$OUT_PWD/snap-deploy | ||
358 | 22 | snappy.commands += && snapcraft | ||
359 | 23 | |||
360 | 24 | OTHER_FILES+=$$SNAPCRAFT_FILE | ||
361 | 25 | QMAKE_EXTRA_TARGETS += snappy | ||
362 | 26 | |||
363 | 27 | packaging.files = $$SNAPCRAFT_FILE | ||
364 | 28 | packaging.path = / | ||
365 | 29 | |||
366 | 30 | INSTALLS+=packaging | ||
367 | 31 | } | ||
368 | 32 | |||
369 | 0 | 33 | ||
370 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/Main.qml' | |||
371 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/Main.qml 1970-01-01 00:00:00 +0000 | |||
372 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/Main.qml 2016-09-22 16:34:17 +0000 | |||
373 | @@ -0,0 +1,54 @@ | |||
374 | 1 | import QtQuick 2.4 | ||
375 | 2 | import Ubuntu.Components 1.3 | ||
376 | 3 | |||
377 | 4 | /*! | ||
378 | 5 | \brief MainView with a Label and Button elements. | ||
379 | 6 | */ | ||
380 | 7 | |||
381 | 8 | MainView { | ||
382 | 9 | // objectName for functional testing purposes (autopilot-qt5) | ||
383 | 10 | objectName: "mainView" | ||
384 | 11 | |||
385 | 12 | applicationName: "%{ProjectNameL}.%{DeveloperId}" | ||
386 | 13 | |||
387 | 14 | width: units.gu(100) | ||
388 | 15 | height: units.gu(75) | ||
389 | 16 | |||
390 | 17 | Page { | ||
391 | 18 | header: PageHeader { | ||
392 | 19 | id: pageHeader | ||
393 | 20 | title: i18n.tr("%{ProjectNameL}") | ||
394 | 21 | StyleHints { | ||
395 | 22 | foregroundColor: UbuntuColors.orange | ||
396 | 23 | backgroundColor: UbuntuColors.porcelain | ||
397 | 24 | dividerColor: UbuntuColors.slate | ||
398 | 25 | } | ||
399 | 26 | } | ||
400 | 27 | |||
401 | 28 | Label { | ||
402 | 29 | id: label | ||
403 | 30 | objectName: "label" | ||
404 | 31 | anchors { | ||
405 | 32 | horizontalCenter: parent.horizontalCenter | ||
406 | 33 | top: pageHeader.bottom | ||
407 | 34 | topMargin: units.gu(2) | ||
408 | 35 | } | ||
409 | 36 | |||
410 | 37 | text: i18n.tr("Hello..") | ||
411 | 38 | } | ||
412 | 39 | |||
413 | 40 | Button { | ||
414 | 41 | objectName: "button" | ||
415 | 42 | anchors { | ||
416 | 43 | horizontalCenter: parent.horizontalCenter | ||
417 | 44 | top: label.bottom | ||
418 | 45 | topMargin: units.gu(2) | ||
419 | 46 | } | ||
420 | 47 | width: parent.width | ||
421 | 48 | text: i18n.tr("Tap me!") | ||
422 | 49 | onClicked: { | ||
423 | 50 | label.text = i18n.tr("..world!") | ||
424 | 51 | } | ||
425 | 52 | } | ||
426 | 53 | } | ||
427 | 54 | } | ||
428 | 0 | 55 | ||
429 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop' | |||
430 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop 1970-01-01 00:00:00 +0000 | |||
431 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop 2016-09-22 16:34:17 +0000 | |||
432 | @@ -0,0 +1,9 @@ | |||
433 | 1 | [Desktop Entry] | ||
434 | 2 | Version=1.0 | ||
435 | 3 | Name=%{ProjectNameL} | ||
436 | 4 | Exec=%{ProjectNameL} | ||
437 | 5 | TryExec=%{ProjectNameL} | ||
438 | 6 | Icon=${SNAP}/meta/gui/%{ProjectNameL}.png | ||
439 | 7 | Terminal=false | ||
440 | 8 | Type=Application | ||
441 | 9 | X-Ubuntu-Touch=true | ||
442 | 0 | 10 | ||
443 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png' | |||
444 | 1 | Binary files dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 1970-01-01 00:00:00 +0000 and dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 2016-09-22 16:34:17 +0000 differ | 11 | Binary files dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 1970-01-01 00:00:00 +0000 and dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 2016-09-22 16:34:17 +0000 differ |
445 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro' | |||
446 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro 1970-01-01 00:00:00 +0000 | |||
447 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro 2016-09-22 16:34:17 +0000 | |||
448 | @@ -0,0 +1,48 @@ | |||
449 | 1 | TEMPLATE = app | ||
450 | 2 | TARGET = %{ProjectNameL} | ||
451 | 3 | |||
452 | 4 | QT += qml quick | ||
453 | 5 | |||
454 | 6 | # enables/disabled the extra targets to build a snapcraft package | ||
455 | 7 | # also tells the IDE this is a snapcraft project | ||
456 | 8 | CONFIG += snapcraft | ||
457 | 9 | |||
458 | 10 | SOURCES += main.cpp | ||
459 | 11 | |||
460 | 12 | RESOURCES += %{ProjectNameL}.qrc | ||
461 | 13 | |||
462 | 14 | QML_FILES += $$files(*.qml,true) \ | ||
463 | 15 | $$files(*.js,true) | ||
464 | 16 | |||
465 | 17 | CONF_FILES += %{ProjectNameL}.png | ||
466 | 18 | |||
467 | 19 | AP_TEST_FILES += tests/autopilot/run \ | ||
468 | 20 | $$files(tests/*.py,true) | ||
469 | 21 | |||
470 | 22 | #show all the files in QtCreator | ||
471 | 23 | OTHER_FILES += $${CONF_FILES} \ | ||
472 | 24 | $${QML_FILES} \ | ||
473 | 25 | $${AP_TEST_FILES} \ | ||
474 | 26 | %{ProjectNameL}.desktop \ | ||
475 | 27 | %{ProjectNameL}.wrapper | ||
476 | 28 | |||
477 | 29 | snapcraft { | ||
478 | 30 | #specify where the config files are installed to | ||
479 | 31 | config_files.path = /setup/gui | ||
480 | 32 | config_files.files += $${CONF_FILES} | ||
481 | 33 | INSTALLS+=config_files | ||
482 | 34 | |||
483 | 35 | #install the desktop file | ||
484 | 36 | desktop_file.path = /setup/gui | ||
485 | 37 | desktop_file.files = $$PWD/%{ProjectNameL}.desktop | ||
486 | 38 | desktop_file.CONFIG += no_check_exist | ||
487 | 39 | INSTALLS+=desktop_file | ||
488 | 40 | |||
489 | 41 | # Default rules for deployment. | ||
490 | 42 | |||
491 | 43 | wrapper.files = %{ProjectNameL}.wrapper | ||
492 | 44 | wrapper.path = /deploy/bin | ||
493 | 45 | |||
494 | 46 | target.path = /deploy/bin | ||
495 | 47 | INSTALLS+=target wrapper | ||
496 | 48 | } | ||
497 | 0 | 49 | ||
498 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.qrc' | |||
499 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.qrc 1970-01-01 00:00:00 +0000 | |||
500 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.qrc 2016-09-22 16:34:17 +0000 | |||
501 | @@ -0,0 +1,5 @@ | |||
502 | 1 | <RCC> | ||
503 | 2 | <qresource prefix="/"> | ||
504 | 3 | <file>Main.qml</file> | ||
505 | 4 | </qresource> | ||
506 | 5 | </RCC> | ||
507 | 0 | 6 | ||
508 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.wrapper' | |||
509 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.wrapper 1970-01-01 00:00:00 +0000 | |||
510 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.wrapper 2016-09-22 16:34:17 +0000 | |||
511 | @@ -0,0 +1,63 @@ | |||
512 | 1 | #!/bin/bash | ||
513 | 2 | |||
514 | 3 | if [ "$SNAP_ARCH" == "amd64" ]; then | ||
515 | 4 | ARCH="x86_64-linux-gnu" | ||
516 | 5 | elif [ "$SNAP_ARCH" == "armhf" ]; then | ||
517 | 6 | ARCH="arm-linux-gnueabihf" | ||
518 | 7 | else | ||
519 | 8 | ARCH="$SNAP_ARCH-linux-gnu" | ||
520 | 9 | fi | ||
521 | 10 | |||
522 | 11 | export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH:$LD_LIBRARY_PATH | ||
523 | 12 | |||
524 | 13 | # XKB config | ||
525 | 14 | export XKB_CONFIG_ROOT=$SNAP/usr/share/X11/xkb | ||
526 | 15 | |||
527 | 16 | if [ "$DESKTOP_SESSION" == "unity8" ]; then | ||
528 | 17 | # Qt Platform to Mir | ||
529 | 18 | export QT_QPA_PLATFORM=ubuntumirclient | ||
530 | 19 | # Mir runtime | ||
531 | 20 | export MIR_SOCKET=$XDG_RUNTIME_DIR/mir_socket | ||
532 | 21 | export MIR_CLIENT_PLATFORM_PATH=$SNAP/usr/lib/$ARCH/mir/client-platform | ||
533 | 22 | fi | ||
534 | 23 | |||
535 | 24 | # Qt Libs | ||
536 | 25 | export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH/qt5/libs:$LD_LIBRARY_PATH | ||
537 | 26 | export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH/pulseaudio:$LD_LIBRARY_PATH | ||
538 | 27 | |||
539 | 28 | # Qt Modules | ||
540 | 29 | export QT_PLUGIN_PATH=$SNAP/usr/lib/$ARCH/qt5/plugins | ||
541 | 30 | export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$SNAP/usr/lib/$ARCH/qt5/qml | ||
542 | 31 | export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$SNAP/lib/$ARCH | ||
543 | 32 | |||
544 | 33 | # Mesa Libs | ||
545 | 34 | export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH/mesa:$LD_LIBRARY_PATH | ||
546 | 35 | export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH/mesa-egl:$LD_LIBRARY_PATH | ||
547 | 36 | |||
548 | 37 | # XDG Config | ||
549 | 38 | export XDG_CONFIG_DIRS=$SNAP/etc/xdg:$XDG_CONFIG_DIRS | ||
550 | 39 | export XDG_CONFIG_DIRS=$SNAP/usr/xdg:$XDG_CONFIG_DIRS | ||
551 | 40 | # Note: this doesn't seem to work, QML's LocalStorage either ignores | ||
552 | 41 | # or fails to use $SNAP_USER_DATA if defined here | ||
553 | 42 | export XDG_DATA_DIRS=$SNAP_USER_DATA:$XDG_DATA_DIRS | ||
554 | 43 | export XDG_DATA_DIRS=$SNAP/usr/share:$XDG_DATA_DIRS | ||
555 | 44 | |||
556 | 45 | # needed for fontconfig | ||
557 | 46 | export XDG_DATA_HOME=$SNAP/usr/share | ||
558 | 47 | |||
559 | 48 | # Font Config | ||
560 | 49 | export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d | ||
561 | 50 | export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf | ||
562 | 51 | |||
563 | 52 | # Tell libGL where to find the drivers | ||
564 | 53 | export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/$ARCH/dri | ||
565 | 54 | |||
566 | 55 | # Necessary for the SDK to find the translations directory | ||
567 | 56 | export APP_DIR=$SNAP | ||
568 | 57 | |||
569 | 58 | # ensure the snappy gl libs win | ||
570 | 59 | export LD_LIBRARY_PATH="$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH" | ||
571 | 60 | |||
572 | 61 | cd $SNAP | ||
573 | 62 | exec $SNAP/bin/%{ProjectNameL} | ||
574 | 63 | |||
575 | 0 | 64 | ||
576 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/main.cpp' | |||
577 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/main.cpp 1970-01-01 00:00:00 +0000 | |||
578 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/main.cpp 2016-09-22 16:34:17 +0000 | |||
579 | @@ -0,0 +1,14 @@ | |||
580 | 1 | #include <QGuiApplication> | ||
581 | 2 | #include <QQmlApplicationEngine> | ||
582 | 3 | #include <QQuickView> | ||
583 | 4 | |||
584 | 5 | int main(int argc, char *argv[]) | ||
585 | 6 | { | ||
586 | 7 | QGuiApplication app(argc, argv); | ||
587 | 8 | |||
588 | 9 | QQuickView view; | ||
589 | 10 | view.setSource(QUrl(QStringLiteral("qrc:///Main.qml"))); | ||
590 | 11 | view.setResizeMode(QQuickView::SizeRootObjectToView); | ||
591 | 12 | view.show(); | ||
592 | 13 | return app.exec(); | ||
593 | 14 | } | ||
594 | 0 | 15 | ||
595 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml' | |||
596 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml 1970-01-01 00:00:00 +0000 | |||
597 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml 2016-09-22 16:34:17 +0000 | |||
598 | @@ -0,0 +1,23 @@ | |||
599 | 1 | name: %{ProjectNameL} | ||
600 | 2 | version: 0.01 | ||
601 | 3 | summary: Example application | ||
602 | 4 | description: Shows a basic UITK based UI | ||
603 | 5 | confinement: strict | ||
604 | 6 | |||
605 | 7 | apps: | ||
606 | 8 | %{ProjectNameL}: | ||
607 | 9 | command: %{ProjectNameL}.wrapper | ||
608 | 10 | plugs: [unity7, opengl] | ||
609 | 11 | |||
610 | 12 | parts: | ||
611 | 13 | %{ProjectNameL}: | ||
612 | 14 | plugin: dump | ||
613 | 15 | source: deploy/ | ||
614 | 16 | stage-packages: | ||
615 | 17 | - ubuntu-sdk-libs | ||
616 | 18 | - qtubuntu-desktop | ||
617 | 19 | - qtmir-desktop | ||
618 | 20 | - mir-graphics-drivers-desktop | ||
619 | 21 | |||
620 | 22 | |||
621 | 23 | |||
622 | 0 | 24 | ||
623 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json' | |||
624 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json 1970-01-01 00:00:00 +0000 | |||
625 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json 2016-09-22 16:34:17 +0000 | |||
626 | @@ -0,0 +1,108 @@ | |||
627 | 1 | { | ||
628 | 2 | "version": 1, | ||
629 | 3 | "supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ], | ||
630 | 4 | "id": "A.QtQuick Snappy Application", | ||
631 | 5 | "category": "B.Snapcraft", | ||
632 | 6 | "trDescription": "Creates a experimental C++ Ubuntu snappy application project with a sample UI containing a Label and a Button.", | ||
633 | 7 | "trDisplayName": "QtQuick App with QML Ubuntu UI", | ||
634 | 8 | "trDisplayCategory": "Snapcraft", | ||
635 | 9 | "icon": "../share/ubuntu.png", | ||
636 | 10 | "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}", | ||
637 | 11 | |||
638 | 12 | "options": | ||
639 | 13 | [ | ||
640 | 14 | { "key": "ProjectFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, | ||
641 | 15 | { "key": "ProjectNameL", "value": "%{JS: \"%{ProjectName}\".toLowerCase()}" }, | ||
642 | 16 | { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, | ||
643 | 17 | { "key": "IsTopLevelProject", "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}'}" } | ||
644 | 18 | ], | ||
645 | 19 | |||
646 | 20 | "pages": | ||
647 | 21 | [ | ||
648 | 22 | { | ||
649 | 23 | "trDisplayName": "Project Location", | ||
650 | 24 | "trShortTitle": "Location", | ||
651 | 25 | "typeId": "Project" | ||
652 | 26 | }, | ||
653 | 27 | { | ||
654 | 28 | "trDisplayName": "Developer ID", | ||
655 | 29 | "trShortTitle": "Developer ID", | ||
656 | 30 | "typeId": "Fields", | ||
657 | 31 | "data" : | ||
658 | 32 | [ | ||
659 | 33 | { | ||
660 | 34 | "name": "DeveloperId", | ||
661 | 35 | "trDisplayName": "Developer ID:", | ||
662 | 36 | "mandatory": true, | ||
663 | 37 | "type": "LineEdit", | ||
664 | 38 | "data": { | ||
665 | 39 | "validator": "^[A-Za-z0-9-]+$", | ||
666 | 40 | "trText": "%{JS: Ubuntu.developerId()}" | ||
667 | 41 | } | ||
668 | 42 | } | ||
669 | 43 | ] | ||
670 | 44 | }, | ||
671 | 45 | { | ||
672 | 46 | "trDisplayName": "Kit Selection", | ||
673 | 47 | "trShortTitle": "Kits", | ||
674 | 48 | "typeId": "Kits", | ||
675 | 49 | "enabled": "%{IsTopLevelProject}", | ||
676 | 50 | "data": { "projectFilePath": "%{ProjectFile}" } | ||
677 | 51 | }, | ||
678 | 52 | { | ||
679 | 53 | "trDisplayName": "Project Management", | ||
680 | 54 | "trShortTitle": "Summary", | ||
681 | 55 | "typeId": "Summary" | ||
682 | 56 | } | ||
683 | 57 | ], | ||
684 | 58 | "generators": | ||
685 | 59 | [ | ||
686 | 60 | { | ||
687 | 61 | "typeId": "File", | ||
688 | 62 | "data": | ||
689 | 63 | [ | ||
690 | 64 | { | ||
691 | 65 | "source": "appName.pro", | ||
692 | 66 | "target": "%{ProjectFile}", | ||
693 | 67 | "openAsProject": true | ||
694 | 68 | }, | ||
695 | 69 | { | ||
696 | 70 | "source": "snapcraft.yaml", | ||
697 | 71 | "openInEditor": true | ||
698 | 72 | }, | ||
699 | 73 | { | ||
700 | 74 | "source": "appName/main.cpp", | ||
701 | 75 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{CppFileName}", | ||
702 | 76 | "openInEditor": true | ||
703 | 77 | }, | ||
704 | 78 | { | ||
705 | 79 | "source": "appName/Main.qml", | ||
706 | 80 | "target": "%{ProjectDirectory}/%{ProjectNameL}/Main.qml", | ||
707 | 81 | "openInEditor": true | ||
708 | 82 | }, | ||
709 | 83 | { | ||
710 | 84 | "source": "appName/appName.desktop", | ||
711 | 85 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{ProjectNameL}.desktop" | ||
712 | 86 | }, | ||
713 | 87 | { | ||
714 | 88 | "source": "appName/appName.png", | ||
715 | 89 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{ProjectNameL}.png" | ||
716 | 90 | }, | ||
717 | 91 | { | ||
718 | 92 | "source": "appName/appName.pro", | ||
719 | 93 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{ProjectNameL}.pro" | ||
720 | 94 | }, | ||
721 | 95 | { | ||
722 | 96 | "source": "appName/appName.qrc", | ||
723 | 97 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{ProjectNameL}.qrc" | ||
724 | 98 | }, | ||
725 | 99 | { | ||
726 | 100 | "source": "appName/appName.wrapper", | ||
727 | 101 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{ProjectNameL}.wrapper", | ||
728 | 102 | "userExecutable": true | ||
729 | 103 | } | ||
730 | 104 | |||
731 | 105 | ] | ||
732 | 106 | } | ||
733 | 107 | ] | ||
734 | 108 | } | ||
735 | 0 | 109 | ||
736 | === modified file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/qml/publishpage.qml' | |||
737 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/qml/publishpage.qml 2016-06-09 08:47:42 +0000 | |||
738 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/qml/publishpage.qml 2016-09-22 16:34:17 +0000 | |||
739 | @@ -80,7 +80,7 @@ | |||
740 | 80 | spacing: units.gu(2) | 80 | spacing: units.gu(2) |
741 | 81 | Button { | 81 | Button { |
742 | 82 | visible: publishModel.showValidationUi | 82 | visible: publishModel.showValidationUi |
744 | 83 | text: "Validate existing click package" | 83 | text: "Validate existing package" |
745 | 84 | onClicked: { | 84 | onClicked: { |
746 | 85 | publishModel.on_pushButtonReviewersTools_clicked(); | 85 | publishModel.on_pushButtonReviewersTools_clicked(); |
747 | 86 | } | 86 | } |
748 | @@ -88,7 +88,7 @@ | |||
749 | 88 | Button { | 88 | Button { |
750 | 89 | visible: publishModel.showValidationUi | 89 | visible: publishModel.showValidationUi |
751 | 90 | enabled: publishModel.canBuild | 90 | enabled: publishModel.canBuild |
753 | 91 | text: "Build and validate click package" | 91 | text: "Build and validate package" |
754 | 92 | onClicked: { | 92 | onClicked: { |
755 | 93 | publishModel.on_pushButtonClickPackage_clicked(); | 93 | publishModel.on_pushButtonClickPackage_clicked(); |
756 | 94 | } | 94 | } |
757 | 95 | 95 | ||
758 | === modified file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/usdk-target-build' | |||
759 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/usdk-target-build 2016-08-26 14:14:29 +0000 | |||
760 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/usdk-target-build 2016-09-22 16:34:17 +0000 | |||
761 | @@ -147,6 +147,7 @@ | |||
762 | 147 | "qttools5-dev:{TARGET}", | 147 | "qttools5-dev:{TARGET}", |
763 | 148 | "ubuntu-sdk-qmake-extras:{TARGET}", | 148 | "ubuntu-sdk-qmake-extras:{TARGET}", |
764 | 149 | "ubuntu-ui-toolkit-doc:{TARGET}", | 149 | "ubuntu-ui-toolkit-doc:{TARGET}", |
765 | 150 | "snapcraft" | ||
766 | 150 | ], | 151 | ], |
767 | 151 | "ubuntu-sdk-16.10": [ | 152 | "ubuntu-sdk-16.10": [ |
768 | 152 | ] | 153 | ] |
769 | 153 | 154 | ||
770 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/plugin.pri' | |||
771 | --- dist/qtcreator/src/plugins/ubuntu/src/plugin.pri 2016-06-09 08:47:42 +0000 | |||
772 | +++ dist/qtcreator/src/plugins/ubuntu/src/plugin.pri 2016-09-22 16:34:17 +0000 | |||
773 | @@ -71,3 +71,4 @@ | |||
774 | 71 | LIBS += -L$$[QT_INSTALL_LIBS]/qtcreator | 71 | LIBS += -L$$[QT_INSTALL_LIBS]/qtcreator |
775 | 72 | LIBS += -L$$[QT_INSTALL_LIBS]/qtcreator/plugins | 72 | LIBS += -L$$[QT_INSTALL_LIBS]/qtcreator/plugins |
776 | 73 | } | 73 | } |
777 | 74 | |||
778 | 74 | 75 | ||
779 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.cpp' | |||
780 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.cpp 2016-08-26 14:14:29 +0000 | |||
781 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.cpp 2016-09-22 16:34:17 +0000 | |||
782 | @@ -1,5 +1,5 @@ | |||
783 | 1 | /* | 1 | /* |
785 | 2 | * Copyright 2014 Canonical Ltd. | 2 | * Copyright 2016 Canonical Ltd. |
786 | 3 | * | 3 | * |
787 | 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
788 | 5 | * it under the terms of the GNU Lesser General Public License as published by | 5 | * it under the terms of the GNU Lesser General Public License as published by |
789 | 6 | 6 | ||
790 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.h' | |||
791 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.h 2016-08-26 14:14:29 +0000 | |||
792 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/clicktoolchain.h 2016-09-22 16:34:17 +0000 | |||
793 | @@ -1,5 +1,5 @@ | |||
794 | 1 | /* | 1 | /* |
796 | 2 | * Copyright 2014 Canonical Ltd. | 2 | * Copyright 2016 Canonical Ltd. |
797 | 3 | * | 3 | * |
798 | 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
799 | 5 | * it under the terms of the GNU Lesser General Public License as published by | 5 | * it under the terms of the GNU Lesser General Public License as published by |
800 | 6 | 6 | ||
801 | === added directory 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap' | |||
802 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.cpp' | |||
803 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.cpp 1970-01-01 00:00:00 +0000 | |||
804 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.cpp 2016-09-22 16:34:17 +0000 | |||
805 | @@ -0,0 +1,468 @@ | |||
806 | 1 | /* | ||
807 | 2 | * Copyright 2016 Canonical Ltd. | ||
808 | 3 | * | ||
809 | 4 | * This program is free software; you can redistribute it and/or modify | ||
810 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
811 | 6 | * the Free Software Foundation; version 2.1. | ||
812 | 7 | * | ||
813 | 8 | * This program is distributed in the hope that it will be useful, | ||
814 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
815 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
816 | 11 | * GNU Lesser General Public License for more details. | ||
817 | 12 | * | ||
818 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
819 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
820 | 15 | * | ||
821 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
822 | 17 | */ | ||
823 | 18 | |||
824 | 19 | #include "snapcraftpackagestep.h" | ||
825 | 20 | |||
826 | 21 | #include <ubuntu/ubuntuconstants.h> | ||
827 | 22 | #include <ubuntu/ubuntupackageoutputparser.h> | ||
828 | 23 | |||
829 | 24 | #include <projectexplorer/target.h> | ||
830 | 25 | #include <projectexplorer/task.h> | ||
831 | 26 | #include <projectexplorer/kitinformation.h> | ||
832 | 27 | #include <projectexplorer/project.h> | ||
833 | 28 | #include <projectexplorer/projectexplorerconstants.h> | ||
834 | 29 | #include <projectexplorer/buildconfiguration.h> | ||
835 | 30 | #include <projectexplorer/toolchain.h> | ||
836 | 31 | #include <utils/qtcassert.h> | ||
837 | 32 | #include <utils/fileutils.h> | ||
838 | 33 | |||
839 | 34 | #include <QTimer> | ||
840 | 35 | #include <QRegularExpression> | ||
841 | 36 | |||
842 | 37 | namespace Ubuntu { | ||
843 | 38 | namespace Internal { | ||
844 | 39 | |||
845 | 40 | const char * PACKAGE_NAME_REGEX = "^Snapped ([\\S]+\\.snap)$"; | ||
846 | 41 | |||
847 | 42 | SnapcraftPackageStep::SnapcraftPackageStep(ProjectExplorer::BuildStepList *bsl) | ||
848 | 43 | : ProjectExplorer::BuildStep (bsl, Constants::UBUNTU_SNAP_PACKAGESTEP_ID) | ||
849 | 44 | { | ||
850 | 45 | |||
851 | 46 | } | ||
852 | 47 | |||
853 | 48 | SnapcraftPackageStep::SnapcraftPackageStep(ProjectExplorer::BuildStepList *bsl, SnapcraftPackageStep *other) | ||
854 | 49 | : ProjectExplorer::BuildStep (bsl, other) | ||
855 | 50 | { | ||
856 | 51 | |||
857 | 52 | } | ||
858 | 53 | |||
859 | 54 | SnapcraftPackageStep::~SnapcraftPackageStep() | ||
860 | 55 | { | ||
861 | 56 | cleanup(); | ||
862 | 57 | } | ||
863 | 58 | |||
864 | 59 | QString SnapcraftPackageStep::packagePath() const | ||
865 | 60 | { | ||
866 | 61 | if(m_snapPackageName.isEmpty()) | ||
867 | 62 | return QString(); | ||
868 | 63 | return snapWorkingDir() | ||
869 | 64 | + QDir::separator() | ||
870 | 65 | + m_snapPackageName; | ||
871 | 66 | } | ||
872 | 67 | |||
873 | 68 | QString SnapcraftPackageStep::snapWorkingDir() const | ||
874 | 69 | { | ||
875 | 70 | return m_buildDir+QStringLiteral("/snap-deploy"); | ||
876 | 71 | } | ||
877 | 72 | |||
878 | 73 | bool SnapcraftPackageStep::init(QList<const ProjectExplorer::BuildStep *> &earlierSteps) | ||
879 | 74 | { | ||
880 | 75 | Q_UNUSED(earlierSteps) | ||
881 | 76 | return true; | ||
882 | 77 | } | ||
883 | 78 | |||
884 | 79 | void SnapcraftPackageStep::run(QFutureInterface<bool> &fi) | ||
885 | 80 | { | ||
886 | 81 | internalInit(); | ||
887 | 82 | |||
888 | 83 | if (m_tasks.size()) { | ||
889 | 84 | foreach (const ProjectExplorer::Task& task, m_tasks) { | ||
890 | 85 | addTask(task); | ||
891 | 86 | } | ||
892 | 87 | emit addOutput(tr("Configuration is invalid. Aborting build") | ||
893 | 88 | ,ProjectExplorer::BuildStep::MessageOutput); | ||
894 | 89 | |||
895 | 90 | reportRunResult(fi, false); | ||
896 | 91 | cleanup(); | ||
897 | 92 | return; | ||
898 | 93 | } | ||
899 | 94 | |||
900 | 95 | m_state = Idle; | ||
901 | 96 | m_futureInterface = &fi; | ||
902 | 97 | m_futureInterface->setProgressRange(0,2); | ||
903 | 98 | QTimer::singleShot(0,this,SLOT(doNextStep())); | ||
904 | 99 | } | ||
905 | 100 | |||
906 | 101 | void SnapcraftPackageStep::cleanup() | ||
907 | 102 | { | ||
908 | 103 | if (m_process) { | ||
909 | 104 | m_process->disconnect(this); | ||
910 | 105 | m_process->kill(); | ||
911 | 106 | m_process->deleteLater(); | ||
912 | 107 | m_process = 0; | ||
913 | 108 | } | ||
914 | 109 | |||
915 | 110 | //not owned by us | ||
916 | 111 | m_futureInterface = 0; | ||
917 | 112 | |||
918 | 113 | if (m_outputParserChain) { | ||
919 | 114 | delete m_outputParserChain; | ||
920 | 115 | m_outputParserChain = 0; | ||
921 | 116 | } | ||
922 | 117 | |||
923 | 118 | //reset params | ||
924 | 119 | m_SnapReviewParam = m_MakeParam = ProjectExplorer::ProcessParameters(); | ||
925 | 120 | m_currParam = nullptr; | ||
926 | 121 | } | ||
927 | 122 | |||
928 | 123 | /*! | ||
929 | 124 | * \brief UbuntuPackageStep::setupAndStartProcess | ||
930 | 125 | * Setups the interal QProcess and connects the required SIGNALS | ||
931 | 126 | * also makes sure the process has a clean output parser | ||
932 | 127 | */ | ||
933 | 128 | void SnapcraftPackageStep::setupAndStartProcess(ProjectExplorer::ProcessParameters ¶ms) | ||
934 | 129 | { | ||
935 | 130 | if (m_process) { | ||
936 | 131 | m_process->disconnect(this); | ||
937 | 132 | m_process->kill(); | ||
938 | 133 | m_process->deleteLater(); | ||
939 | 134 | } | ||
940 | 135 | |||
941 | 136 | m_currParam = ¶ms; | ||
942 | 137 | |||
943 | 138 | QDir wd(params.effectiveWorkingDirectory()); | ||
944 | 139 | if (!wd.exists()) | ||
945 | 140 | wd.mkpath(wd.absolutePath()); | ||
946 | 141 | |||
947 | 142 | QString effectiveCommand = params.effectiveCommand(); | ||
948 | 143 | if (!QFileInfo(effectiveCommand).exists()) { | ||
949 | 144 | onProcessFailedToStart(); | ||
950 | 145 | return; | ||
951 | 146 | } | ||
952 | 147 | |||
953 | 148 | m_process = new Utils::QtcProcess(); | ||
954 | 149 | connect(m_process,SIGNAL(finished(int)),this,SLOT(doNextStep())); | ||
955 | 150 | connect(m_process,SIGNAL(readyReadStandardOutput()),this,SLOT(onProcessStdOut())); | ||
956 | 151 | connect(m_process,SIGNAL(readyReadStandardError()),this,SLOT(onProcessStdErr())); | ||
957 | 152 | |||
958 | 153 | m_process->setCommand(params.effectiveCommand(),params.effectiveArguments()); | ||
959 | 154 | m_process->setEnvironment(params.environment()); | ||
960 | 155 | m_process->setWorkingDirectory(wd.absolutePath()); | ||
961 | 156 | |||
962 | 157 | emit addOutput(tr("Starting: \"%1 %2\"").arg(params.effectiveCommand(),params.effectiveArguments()), | ||
963 | 158 | BuildStep::MessageOutput); | ||
964 | 159 | |||
965 | 160 | ProjectExplorer::IOutputParser *parser = target()->kit()->createOutputParser(); | ||
966 | 161 | |||
967 | 162 | //add special parser on click review step | ||
968 | 163 | if(m_state == SnapReview) { | ||
969 | 164 | UbuntuPackageOutputParser *packageStepParser = new UbuntuPackageOutputParser; | ||
970 | 165 | //packageStepParser->setTreatAllErrorsAsWarnings(m_treatClickErrorsAsWarnings); | ||
971 | 166 | connect(this,SIGNAL(currentSubStepFinished()),packageStepParser,SLOT(setEndOfData())); | ||
972 | 167 | if (parser) | ||
973 | 168 | parser->appendOutputParser(packageStepParser); | ||
974 | 169 | else | ||
975 | 170 | parser = packageStepParser; | ||
976 | 171 | |||
977 | 172 | } | ||
978 | 173 | |||
979 | 174 | if(m_outputParserChain) { | ||
980 | 175 | delete m_outputParserChain; | ||
981 | 176 | m_outputParserChain = 0; | ||
982 | 177 | } | ||
983 | 178 | |||
984 | 179 | if(parser) { | ||
985 | 180 | m_outputParserChain = parser; | ||
986 | 181 | m_outputParserChain->setWorkingDirectory(params.effectiveWorkingDirectory()); | ||
987 | 182 | |||
988 | 183 | connect(m_outputParserChain,SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)), | ||
989 | 184 | this,SLOT(outputAdded(QString,ProjectExplorer::BuildStep::OutputFormat))); | ||
990 | 185 | connect(m_outputParserChain,SIGNAL(addTask(ProjectExplorer::Task)), | ||
991 | 186 | this,SLOT(taskAdded(ProjectExplorer::Task))); | ||
992 | 187 | } | ||
993 | 188 | |||
994 | 189 | m_process->start(); | ||
995 | 190 | if(!m_process->waitForStarted()) { | ||
996 | 191 | onProcessFailedToStart(); | ||
997 | 192 | return; | ||
998 | 193 | } | ||
999 | 194 | } | ||
1000 | 195 | |||
1001 | 196 | /*! | ||
1002 | 197 | * \brief UbuntuPackageStep::checkLastProcessSuccess | ||
1003 | 198 | * Checks if the last process has run without any errors | ||
1004 | 199 | */ | ||
1005 | 200 | bool SnapcraftPackageStep::processFinished(FinishedCheckMode mode) | ||
1006 | 201 | { | ||
1007 | 202 | //make sure all data has been read | ||
1008 | 203 | QString line = QString::fromLocal8Bit(m_process->readAllStandardError()); | ||
1009 | 204 | if (!line.isEmpty()) | ||
1010 | 205 | stdError(line); | ||
1011 | 206 | |||
1012 | 207 | line = QString::fromLocal8Bit(m_process->readAllStandardOutput()); | ||
1013 | 208 | if (!line.isEmpty()) | ||
1014 | 209 | stdOutput(line); | ||
1015 | 210 | |||
1016 | 211 | emit currentSubStepFinished(); | ||
1017 | 212 | |||
1018 | 213 | bool success = true; | ||
1019 | 214 | |||
1020 | 215 | if (m_outputParserChain) { | ||
1021 | 216 | m_outputParserChain->flush(); | ||
1022 | 217 | |||
1023 | 218 | if(m_outputParserChain->hasFatalErrors()) | ||
1024 | 219 | success = false; | ||
1025 | 220 | } | ||
1026 | 221 | |||
1027 | 222 | if(success) { | ||
1028 | 223 | QString command; | ||
1029 | 224 | if(m_currParam) | ||
1030 | 225 | command = QDir::toNativeSeparators(m_currParam->effectiveCommand()); | ||
1031 | 226 | else | ||
1032 | 227 | command = tr("Unknown command"); | ||
1033 | 228 | |||
1034 | 229 | if (m_process->exitStatus() == QProcess::NormalExit && m_process->exitCode() == 0) { | ||
1035 | 230 | emit addOutput(tr("The process \"%1\" exited normally.").arg(command), | ||
1036 | 231 | BuildStep::MessageOutput); | ||
1037 | 232 | } else if (m_process->exitStatus() == QProcess::NormalExit) { | ||
1038 | 233 | emit addOutput(tr("The process \"%1\" exited with code %2.") | ||
1039 | 234 | .arg(command, QString::number(m_process->exitCode())), | ||
1040 | 235 | BuildStep::ErrorMessageOutput); | ||
1041 | 236 | if(mode == CheckReturnCode) | ||
1042 | 237 | //error | ||
1043 | 238 | success = false; | ||
1044 | 239 | else { | ||
1045 | 240 | emit addOutput(tr("Ignoring return code for this step"),BuildStep::ErrorMessageOutput); | ||
1046 | 241 | } | ||
1047 | 242 | } else { | ||
1048 | 243 | emit addOutput(tr("The process \"%1\" crashed.").arg(command), BuildStep::ErrorMessageOutput); | ||
1049 | 244 | |||
1050 | 245 | //error | ||
1051 | 246 | success = false; | ||
1052 | 247 | } | ||
1053 | 248 | } | ||
1054 | 249 | |||
1055 | 250 | //the process failed, lets clean up | ||
1056 | 251 | if (!success) { | ||
1057 | 252 | if(m_futureInterface) | ||
1058 | 253 | reportRunResult(*m_futureInterface, false); | ||
1059 | 254 | cleanup(); | ||
1060 | 255 | } | ||
1061 | 256 | return success; | ||
1062 | 257 | } | ||
1063 | 258 | |||
1064 | 259 | void SnapcraftPackageStep::stdOutput(const QString &line) | ||
1065 | 260 | { | ||
1066 | 261 | m_lastLine = line; | ||
1067 | 262 | |||
1068 | 263 | if (m_outputParserChain) | ||
1069 | 264 | m_outputParserChain->stdOutput(line); | ||
1070 | 265 | emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline); | ||
1071 | 266 | } | ||
1072 | 267 | |||
1073 | 268 | void SnapcraftPackageStep::stdError(const QString &line) | ||
1074 | 269 | { | ||
1075 | 270 | if (m_outputParserChain) | ||
1076 | 271 | m_outputParserChain->stdError(line); | ||
1077 | 272 | emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); | ||
1078 | 273 | } | ||
1079 | 274 | |||
1080 | 275 | |||
1081 | 276 | void SnapcraftPackageStep::onProcessStdOut() | ||
1082 | 277 | { | ||
1083 | 278 | m_process->setReadChannel(QProcess::StandardOutput); | ||
1084 | 279 | while (m_process->canReadLine()) { | ||
1085 | 280 | QString line = QString::fromLocal8Bit(m_process->readLine()); | ||
1086 | 281 | stdOutput(line); | ||
1087 | 282 | } | ||
1088 | 283 | } | ||
1089 | 284 | |||
1090 | 285 | void SnapcraftPackageStep::onProcessStdErr() | ||
1091 | 286 | { | ||
1092 | 287 | m_process->setReadChannel(QProcess::StandardError); | ||
1093 | 288 | while (m_process->canReadLine()) { | ||
1094 | 289 | QString line = QString::fromLocal8Bit(m_process->readLine()); | ||
1095 | 290 | stdError(line); | ||
1096 | 291 | } | ||
1097 | 292 | } | ||
1098 | 293 | |||
1099 | 294 | void SnapcraftPackageStep::outputAdded(const QString &string, ProjectExplorer::BuildStep::OutputFormat format) | ||
1100 | 295 | { | ||
1101 | 296 | emit addOutput(string, format, BuildStep::DontAppendNewline); | ||
1102 | 297 | } | ||
1103 | 298 | |||
1104 | 299 | void SnapcraftPackageStep::taskAdded(const ProjectExplorer::Task &task) | ||
1105 | 300 | { | ||
1106 | 301 | emit addTask(task); | ||
1107 | 302 | } | ||
1108 | 303 | |||
1109 | 304 | void SnapcraftPackageStep::onProcessFailedToStart() | ||
1110 | 305 | { | ||
1111 | 306 | if(m_futureInterface) | ||
1112 | 307 | reportRunResult(*m_futureInterface, false); | ||
1113 | 308 | |||
1114 | 309 | QString command = tr("Unknown command"); | ||
1115 | 310 | QString args; | ||
1116 | 311 | |||
1117 | 312 | if (m_currParam) { | ||
1118 | 313 | command = QDir::toNativeSeparators(m_currParam->effectiveCommand()); | ||
1119 | 314 | args = m_currParam->prettyArguments(); | ||
1120 | 315 | } | ||
1121 | 316 | |||
1122 | 317 | emit addOutput(tr("Could not start process \"%1\" %2") | ||
1123 | 318 | .arg(command, args), | ||
1124 | 319 | BuildStep::ErrorMessageOutput); | ||
1125 | 320 | |||
1126 | 321 | cleanup(); | ||
1127 | 322 | |||
1128 | 323 | } | ||
1129 | 324 | |||
1130 | 325 | QString SnapcraftPackageStep::makeCommand(ProjectExplorer::ToolChain *tc, const Utils::Environment &env) const | ||
1131 | 326 | { | ||
1132 | 327 | if (tc) | ||
1133 | 328 | return tc->makeCommand(env); | ||
1134 | 329 | return QString(); | ||
1135 | 330 | } | ||
1136 | 331 | |||
1137 | 332 | |||
1138 | 333 | ProjectExplorer::BuildStepConfigWidget *SnapcraftPackageStep::createConfigWidget() | ||
1139 | 334 | { | ||
1140 | 335 | return nullptr; | ||
1141 | 336 | } | ||
1142 | 337 | |||
1143 | 338 | void SnapcraftPackageStep::cancel() | ||
1144 | 339 | { | ||
1145 | 340 | |||
1146 | 341 | } | ||
1147 | 342 | |||
1148 | 343 | bool SnapcraftPackageStep::immutable() const | ||
1149 | 344 | { | ||
1150 | 345 | return true; | ||
1151 | 346 | } | ||
1152 | 347 | |||
1153 | 348 | bool SnapcraftPackageStep::runInGuiThread() const | ||
1154 | 349 | { | ||
1155 | 350 | return true; | ||
1156 | 351 | } | ||
1157 | 352 | |||
1158 | 353 | void SnapcraftPackageStep::doNextStep() | ||
1159 | 354 | { | ||
1160 | 355 | switch (m_state) { | ||
1161 | 356 | case Idle: { | ||
1162 | 357 | m_state = MakeSnap; | ||
1163 | 358 | m_currParam = nullptr; | ||
1164 | 359 | setupAndStartProcess(m_MakeParam); | ||
1165 | 360 | break; | ||
1166 | 361 | } | ||
1167 | 362 | case MakeSnap: { | ||
1168 | 363 | if (!processFinished(CheckReturnCode)) | ||
1169 | 364 | return; | ||
1170 | 365 | |||
1171 | 366 | m_currParam = nullptr; | ||
1172 | 367 | |||
1173 | 368 | QRegularExpression exp((QLatin1String(PACKAGE_NAME_REGEX))); | ||
1174 | 369 | QRegularExpressionMatch m = exp.match(m_lastLine); | ||
1175 | 370 | if(m.hasMatch()) { | ||
1176 | 371 | m_snapPackageName = m.captured(1); | ||
1177 | 372 | emit addOutput(tr("The click package has been created in %1").arg(snapWorkingDir()) , | ||
1178 | 373 | ProjectExplorer::BuildStep::MessageOutput); | ||
1179 | 374 | } | ||
1180 | 375 | |||
1181 | 376 | m_futureInterface->setProgressValueAndText(1,tr("Reviewing snap package")); | ||
1182 | 377 | m_state = SnapReview; | ||
1183 | 378 | |||
1184 | 379 | m_SnapReviewParam.setArguments(QString::fromLatin1(Constants::CLICK_REVIEWERSTOOLS_ARGS).arg(packagePath())); | ||
1185 | 380 | m_SnapReviewParam.resolveAll(); | ||
1186 | 381 | setupAndStartProcess(m_SnapReviewParam); | ||
1187 | 382 | break; | ||
1188 | 383 | } | ||
1189 | 384 | case SnapReview: { | ||
1190 | 385 | //we need to ignore the return code for now, | ||
1191 | 386 | //until we have proper support for ignoring specific errors | ||
1192 | 387 | if (!processFinished(IgnoreReturnCode)) | ||
1193 | 388 | return; | ||
1194 | 389 | |||
1195 | 390 | if(m_futureInterface) | ||
1196 | 391 | reportRunResult(*m_futureInterface, true); | ||
1197 | 392 | cleanup(); | ||
1198 | 393 | break; | ||
1199 | 394 | } | ||
1200 | 395 | } | ||
1201 | 396 | } | ||
1202 | 397 | |||
1203 | 398 | void SnapcraftPackageStep::internalInit() | ||
1204 | 399 | { | ||
1205 | 400 | m_tasks.clear(); | ||
1206 | 401 | |||
1207 | 402 | QString projectDir = target()->project()->projectDirectory().toString(); | ||
1208 | 403 | m_buildDir.clear(); | ||
1209 | 404 | Utils::Environment env = Utils::Environment::systemEnvironment(); | ||
1210 | 405 | Utils::MacroExpander *mExp = 0; | ||
1211 | 406 | |||
1212 | 407 | |||
1213 | 408 | ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration(); | ||
1214 | 409 | if (!bc) { | ||
1215 | 410 | ProjectExplorer::Task t(ProjectExplorer::Task::Error | ||
1216 | 411 | ,tr("No valid BuildConfiguration set for step: %1").arg(displayName()) | ||
1217 | 412 | ,Utils::FileName(),-1 | ||
1218 | 413 | ,ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); | ||
1219 | 414 | m_tasks.append(t); | ||
1220 | 415 | |||
1221 | 416 | //SnapcraftPackageStep::run will stop if tasks exist | ||
1222 | 417 | return; | ||
1223 | 418 | |||
1224 | 419 | } | ||
1225 | 420 | |||
1226 | 421 | m_buildDir = bc->buildDirectory().toString(); | ||
1227 | 422 | env = bc->environment(); | ||
1228 | 423 | mExp = bc->macroExpander(); | ||
1229 | 424 | |||
1230 | 425 | { | ||
1231 | 426 | QStringList arguments { | ||
1232 | 427 | QStringLiteral("snap") | ||
1233 | 428 | }; | ||
1234 | 429 | |||
1235 | 430 | ProjectExplorer::ProcessParameters* params = &m_MakeParam; | ||
1236 | 431 | params->setMacroExpander(mExp); | ||
1237 | 432 | |||
1238 | 433 | //setup process parameters | ||
1239 | 434 | params->setWorkingDirectory(m_buildDir); | ||
1240 | 435 | params->setCommand( | ||
1241 | 436 | makeCommand(ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit()), | ||
1242 | 437 | env)); | ||
1243 | 438 | params->setArguments(Utils::QtcProcess::joinArgs(arguments)); | ||
1244 | 439 | |||
1245 | 440 | Utils::Environment tmpenv = env; | ||
1246 | 441 | // Force output to english for the parsers. Do this here and not in the toolchain's | ||
1247 | 442 | // addToEnvironment() to not screw up the users run environment. | ||
1248 | 443 | tmpenv.set(QLatin1String("LC_ALL"), QLatin1String("C")); | ||
1249 | 444 | params->setEnvironment(tmpenv); | ||
1250 | 445 | |||
1251 | 446 | params->resolveAll(); | ||
1252 | 447 | } | ||
1253 | 448 | |||
1254 | 449 | //builds the snap review arguments | ||
1255 | 450 | { | ||
1256 | 451 | ProjectExplorer::ProcessParameters* params = &m_SnapReviewParam; | ||
1257 | 452 | params->setMacroExpander(mExp); | ||
1258 | 453 | |||
1259 | 454 | //setup process parameters | ||
1260 | 455 | params->setWorkingDirectory(m_buildDir); | ||
1261 | 456 | params->setCommand(QLatin1String(Constants::CLICK_REVIEWERSTOOLS_BINARY)); | ||
1262 | 457 | |||
1263 | 458 | Utils::Environment tmpEnv = env; | ||
1264 | 459 | // Force output to english for the parsers. Do this here and not in the toolchain's | ||
1265 | 460 | // addToEnvironment() to not screw up the users run environment. | ||
1266 | 461 | tmpEnv.set(QLatin1String("LC_ALL"), QLatin1String("C")); | ||
1267 | 462 | params->setEnvironment(tmpEnv); | ||
1268 | 463 | } | ||
1269 | 464 | } | ||
1270 | 465 | |||
1271 | 466 | |||
1272 | 467 | } // namespace Internal | ||
1273 | 468 | } // namespace Ubuntu | ||
1274 | 0 | 469 | ||
1275 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.h' | |||
1276 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.h 1970-01-01 00:00:00 +0000 | |||
1277 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snapcraftpackagestep.h 2016-09-22 16:34:17 +0000 | |||
1278 | @@ -0,0 +1,105 @@ | |||
1279 | 1 | /* | ||
1280 | 2 | * Copyright 2016 Canonical Ltd. | ||
1281 | 3 | * | ||
1282 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1283 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1284 | 6 | * the Free Software Foundation; version 2.1. | ||
1285 | 7 | * | ||
1286 | 8 | * This program is distributed in the hope that it will be useful, | ||
1287 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1288 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1289 | 11 | * GNU Lesser General Public License for more details. | ||
1290 | 12 | * | ||
1291 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1292 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1293 | 15 | * | ||
1294 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1295 | 17 | */ | ||
1296 | 18 | |||
1297 | 19 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTPACKAGESTEP_H | ||
1298 | 20 | #define UBUNTU_INTERNAL_SNAPCRAFTPACKAGESTEP_H | ||
1299 | 21 | |||
1300 | 22 | |||
1301 | 23 | #include <projectexplorer/buildstep.h> | ||
1302 | 24 | #include <projectexplorer/ioutputparser.h> | ||
1303 | 25 | #include <projectexplorer/processparameters.h> | ||
1304 | 26 | #include <utils/qtcprocess.h> | ||
1305 | 27 | |||
1306 | 28 | namespace ProjectExplorer{ | ||
1307 | 29 | class ToolChain; | ||
1308 | 30 | } | ||
1309 | 31 | |||
1310 | 32 | namespace Ubuntu { | ||
1311 | 33 | namespace Internal { | ||
1312 | 34 | |||
1313 | 35 | class SnapcraftPackageStep : public ProjectExplorer::BuildStep | ||
1314 | 36 | { | ||
1315 | 37 | Q_OBJECT | ||
1316 | 38 | public: | ||
1317 | 39 | |||
1318 | 40 | enum State { | ||
1319 | 41 | Idle, | ||
1320 | 42 | MakeSnap, | ||
1321 | 43 | SnapReview | ||
1322 | 44 | }; | ||
1323 | 45 | |||
1324 | 46 | enum FinishedCheckMode { | ||
1325 | 47 | CheckReturnCode, | ||
1326 | 48 | IgnoreReturnCode | ||
1327 | 49 | }; | ||
1328 | 50 | |||
1329 | 51 | SnapcraftPackageStep(ProjectExplorer::BuildStepList *bsl); | ||
1330 | 52 | SnapcraftPackageStep(ProjectExplorer::BuildStepList *bsl, SnapcraftPackageStep *other); | ||
1331 | 53 | virtual ~SnapcraftPackageStep(); | ||
1332 | 54 | |||
1333 | 55 | QString packagePath () const; | ||
1334 | 56 | QString snapWorkingDir () const; | ||
1335 | 57 | |||
1336 | 58 | // BuildStep interface | ||
1337 | 59 | virtual bool init(QList<const ProjectExplorer::BuildStep *> &earlierSteps) override; | ||
1338 | 60 | virtual void run(QFutureInterface<bool> &fi) override; | ||
1339 | 61 | virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; | ||
1340 | 62 | virtual void cancel() override; | ||
1341 | 63 | virtual bool immutable() const override; | ||
1342 | 64 | virtual bool runInGuiThread() const override; | ||
1343 | 65 | |||
1344 | 66 | signals: | ||
1345 | 67 | void currentSubStepFinished(); | ||
1346 | 68 | |||
1347 | 69 | protected slots: | ||
1348 | 70 | void doNextStep (); | ||
1349 | 71 | void onProcessFailedToStart(); | ||
1350 | 72 | void onProcessStdOut(); | ||
1351 | 73 | void onProcessStdErr(); | ||
1352 | 74 | void outputAdded(const QString &string, ProjectExplorer::BuildStep::OutputFormat format); | ||
1353 | 75 | void taskAdded (const ProjectExplorer::Task & task); | ||
1354 | 76 | |||
1355 | 77 | private: | ||
1356 | 78 | void internalInit (); | ||
1357 | 79 | void cleanup(); | ||
1358 | 80 | QString makeCommand(ProjectExplorer::ToolChain *tc, const Utils::Environment &env) const; | ||
1359 | 81 | void setupAndStartProcess(ProjectExplorer::ProcessParameters ¶ms); | ||
1360 | 82 | void stdOutput(const QString &line); | ||
1361 | 83 | void stdError(const QString &line); | ||
1362 | 84 | bool processFinished(FinishedCheckMode mode); | ||
1363 | 85 | |||
1364 | 86 | private: | ||
1365 | 87 | State m_state = SnapcraftPackageStep::Idle; | ||
1366 | 88 | QList<ProjectExplorer::Task> m_tasks; | ||
1367 | 89 | QFutureInterface<bool> *m_futureInterface; | ||
1368 | 90 | |||
1369 | 91 | Utils::QtcProcess *m_process = nullptr; | ||
1370 | 92 | ProjectExplorer::IOutputParser *m_outputParserChain = nullptr; | ||
1371 | 93 | |||
1372 | 94 | QString m_buildDir; | ||
1373 | 95 | QString m_lastLine; | ||
1374 | 96 | QString m_snapPackageName; | ||
1375 | 97 | ProjectExplorer::ProcessParameters m_MakeParam; | ||
1376 | 98 | ProjectExplorer::ProcessParameters m_SnapReviewParam; | ||
1377 | 99 | ProjectExplorer::ProcessParameters *m_currParam = nullptr; | ||
1378 | 100 | }; | ||
1379 | 101 | |||
1380 | 102 | } // namespace Internal | ||
1381 | 103 | } // namespace Ubuntu | ||
1382 | 104 | |||
1383 | 105 | #endif // UBUNTU_INTERNAL_SNAPCRAFTPACKAGESTEP_H | ||
1384 | 0 | 106 | ||
1385 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.cpp' | |||
1386 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.cpp 1970-01-01 00:00:00 +0000 | |||
1387 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.cpp 2016-09-22 16:34:17 +0000 | |||
1388 | @@ -0,0 +1,30 @@ | |||
1389 | 1 | #include "snaphelper.h" | ||
1390 | 2 | |||
1391 | 3 | #include <projectexplorer/project.h> | ||
1392 | 4 | #include <qmakeprojectmanager/qmakeproject.h> | ||
1393 | 5 | #include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> | ||
1394 | 6 | |||
1395 | 7 | namespace Ubuntu { | ||
1396 | 8 | namespace Internal { | ||
1397 | 9 | |||
1398 | 10 | SnapHelper::SnapHelper() | ||
1399 | 11 | { | ||
1400 | 12 | |||
1401 | 13 | } | ||
1402 | 14 | |||
1403 | 15 | bool SnapHelper::isSnappyProject(ProjectExplorer::Project *project) | ||
1404 | 16 | { | ||
1405 | 17 | if (!project) | ||
1406 | 18 | return false; | ||
1407 | 19 | |||
1408 | 20 | QString mimeType = project->projectManager()->mimeType(); | ||
1409 | 21 | if(mimeType != QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE)) | ||
1410 | 22 | return false; | ||
1411 | 23 | |||
1412 | 24 | QmakeProjectManager::QmakeProject *qPro = static_cast<QmakeProjectManager::QmakeProject *>(project); | ||
1413 | 25 | QmakeProjectManager::QmakeProFileNode *node = qPro->rootProjectNode(); | ||
1414 | 26 | return node->variableValue(QmakeProjectManager::ConfigVar).contains(QStringLiteral("snapcraft"), Qt::CaseInsensitive); | ||
1415 | 27 | } | ||
1416 | 28 | |||
1417 | 29 | } // namespace Internal | ||
1418 | 30 | } // namespace Ubuntu | ||
1419 | 0 | 31 | ||
1420 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.h' | |||
1421 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.h 1970-01-01 00:00:00 +0000 | |||
1422 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snaphelper.h 2016-09-22 16:34:17 +0000 | |||
1423 | @@ -0,0 +1,22 @@ | |||
1424 | 1 | #ifndef UBUNTU_INTERNAL_SNAPHELPER_H | ||
1425 | 2 | #define UBUNTU_INTERNAL_SNAPHELPER_H | ||
1426 | 3 | |||
1427 | 4 | namespace ProjectExplorer { | ||
1428 | 5 | class Project; | ||
1429 | 6 | } | ||
1430 | 7 | |||
1431 | 8 | namespace Ubuntu { | ||
1432 | 9 | namespace Internal { | ||
1433 | 10 | |||
1434 | 11 | class SnapHelper | ||
1435 | 12 | { | ||
1436 | 13 | public: | ||
1437 | 14 | SnapHelper(); | ||
1438 | 15 | |||
1439 | 16 | static bool isSnappyProject (ProjectExplorer::Project* project); | ||
1440 | 17 | }; | ||
1441 | 18 | |||
1442 | 19 | } // namespace Internal | ||
1443 | 20 | } // namespace Ubuntu | ||
1444 | 21 | |||
1445 | 22 | #endif // UBUNTU_INTERNAL_SNAPHELPER_H | ||
1446 | 0 | 23 | ||
1447 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h' | |||
1448 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h 2016-08-26 14:14:29 +0000 | |||
1449 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h 2016-09-22 16:34:17 +0000 | |||
1450 | @@ -344,6 +344,7 @@ | |||
1451 | 344 | const char UBUNTU_DEPLOY_UPLOADSTEP_ID[] = "UbuntuProjectManager.UploadStep"; | 344 | const char UBUNTU_DEPLOY_UPLOADSTEP_ID[] = "UbuntuProjectManager.UploadStep"; |
1452 | 345 | const char UBUNTU_DEPLOY_MAKESTEP_ID[] = "UbuntuProjectManager.UbuntuCMake.DeployMakeStep"; | 345 | const char UBUNTU_DEPLOY_MAKESTEP_ID[] = "UbuntuProjectManager.UbuntuCMake.DeployMakeStep"; |
1453 | 346 | const char UBUNTU_CLICK_PACKAGESTEP_ID[] = "UbuntuProjectManager.ClickPackageStep"; | 346 | const char UBUNTU_CLICK_PACKAGESTEP_ID[] = "UbuntuProjectManager.ClickPackageStep"; |
1454 | 347 | const char UBUNTU_SNAP_PACKAGESTEP_ID[] = "UbuntuProjectManager.SnapPackageStep"; | ||
1455 | 347 | const char UBUNTU_DEPLOY_DESTDIR[] = ".ubuntu-sdk-deploy"; | 348 | const char UBUNTU_DEPLOY_DESTDIR[] = ".ubuntu-sdk-deploy"; |
1456 | 348 | const char UBUNTU_CLICK_SUCCESS_PACKAGE_REGEX[] = "^.*'(.*)'.$"; | 349 | const char UBUNTU_CLICK_SUCCESS_PACKAGE_REGEX[] = "^.*'(.*)'.$"; |
1457 | 349 | 350 | ||
1458 | 350 | 351 | ||
1459 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.cpp' | |||
1460 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.cpp 1970-01-01 00:00:00 +0000 | |||
1461 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.cpp 2016-09-22 16:34:17 +0000 | |||
1462 | @@ -0,0 +1,46 @@ | |||
1463 | 1 | /* | ||
1464 | 2 | * Copyright 2016 Canonical Ltd. | ||
1465 | 3 | * | ||
1466 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1467 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1468 | 6 | * the Free Software Foundation; version 2.1. | ||
1469 | 7 | * | ||
1470 | 8 | * This program is distributed in the hope that it will be useful, | ||
1471 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1472 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1473 | 11 | * GNU Lesser General Public License for more details. | ||
1474 | 12 | * | ||
1475 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1476 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1477 | 15 | * | ||
1478 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1479 | 17 | */ | ||
1480 | 18 | #include "ubuntujsextension.h" | ||
1481 | 19 | #include <ubuntu/ubuntubzr.h> | ||
1482 | 20 | |||
1483 | 21 | namespace Ubuntu { | ||
1484 | 22 | namespace Internal { | ||
1485 | 23 | |||
1486 | 24 | UbuntuJsExtension::UbuntuJsExtension(QObject *parent) : QObject(parent) | ||
1487 | 25 | { | ||
1488 | 26 | |||
1489 | 27 | } | ||
1490 | 28 | |||
1491 | 29 | QString UbuntuJsExtension::developerId() const | ||
1492 | 30 | { | ||
1493 | 31 | QString maintainer = QStringLiteral("username"); | ||
1494 | 32 | UbuntuBzr *bzr = UbuntuBzr::instance(); | ||
1495 | 33 | |||
1496 | 34 | if(!bzr->isInitialized()) { | ||
1497 | 35 | bzr->initialize(); | ||
1498 | 36 | bzr->waitForFinished(); | ||
1499 | 37 | } | ||
1500 | 38 | |||
1501 | 39 | if(bzr->isInitialized()) { | ||
1502 | 40 | maintainer = bzr->launchpadId(); | ||
1503 | 41 | } | ||
1504 | 42 | |||
1505 | 43 | return maintainer; | ||
1506 | 44 | } | ||
1507 | 45 | |||
1508 | 46 | }} | ||
1509 | 0 | 47 | ||
1510 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.h' | |||
1511 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.h 1970-01-01 00:00:00 +0000 | |||
1512 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntujsextension.h 2016-09-22 16:34:17 +0000 | |||
1513 | @@ -0,0 +1,37 @@ | |||
1514 | 1 | /* | ||
1515 | 2 | * Copyright 2016 Canonical Ltd. | ||
1516 | 3 | * | ||
1517 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1518 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1519 | 6 | * the Free Software Foundation; version 2.1. | ||
1520 | 7 | * | ||
1521 | 8 | * This program is distributed in the hope that it will be useful, | ||
1522 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1523 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1524 | 11 | * GNU Lesser General Public License for more details. | ||
1525 | 12 | * | ||
1526 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1527 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1528 | 15 | * | ||
1529 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1530 | 17 | */ | ||
1531 | 18 | #ifndef UBUNTUJSEXTENSION_H | ||
1532 | 19 | #define UBUNTUJSEXTENSION_H | ||
1533 | 20 | |||
1534 | 21 | #include <QObject> | ||
1535 | 22 | |||
1536 | 23 | namespace Ubuntu { | ||
1537 | 24 | namespace Internal { | ||
1538 | 25 | |||
1539 | 26 | class UbuntuJsExtension : public QObject | ||
1540 | 27 | { | ||
1541 | 28 | Q_OBJECT | ||
1542 | 29 | public: | ||
1543 | 30 | explicit UbuntuJsExtension(QObject *parent = 0); | ||
1544 | 31 | |||
1545 | 32 | Q_INVOKABLE QString developerId() const; | ||
1546 | 33 | }; | ||
1547 | 34 | |||
1548 | 35 | }} | ||
1549 | 36 | |||
1550 | 37 | #endif // UBUNTUJSEXTENSION_H | ||
1551 | 0 | 38 | ||
1552 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.cpp' | |||
1553 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.cpp 2016-09-05 17:35:40 +0000 | |||
1554 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.cpp 2016-09-22 16:34:17 +0000 | |||
1555 | @@ -30,6 +30,8 @@ | |||
1556 | 30 | #include "ubuntuproject.h" | 30 | #include "ubuntuproject.h" |
1557 | 31 | 31 | ||
1558 | 32 | #include <ubuntu/device/remote/ubuntudevice.h> | 32 | #include <ubuntu/device/remote/ubuntudevice.h> |
1559 | 33 | #include <ubuntu/snap/snaphelper.h> | ||
1560 | 34 | #include <ubuntu/snap/snapcraftpackagestep.h> | ||
1561 | 33 | 35 | ||
1562 | 34 | #include <projectexplorer/projectexplorer.h> | 36 | #include <projectexplorer/projectexplorer.h> |
1563 | 35 | #include <projectexplorer/project.h> | 37 | #include <projectexplorer/project.h> |
1564 | @@ -159,7 +161,6 @@ | |||
1565 | 159 | m_ubuntuProcess.append(QStringList() << QString::fromLatin1(Constants::CLICK_REVIEWERSTOOLS_LOCATION).arg(sClickPackagePath)); | 161 | m_ubuntuProcess.append(QStringList() << QString::fromLatin1(Constants::CLICK_REVIEWERSTOOLS_LOCATION).arg(sClickPackagePath)); |
1566 | 160 | m_ubuntuProcess.start(QString(QLatin1String(Constants::UBUNTUPACKAGINGWIDGET_CLICK_REVIEWER_TOOLS_AGAINST_PACKAGE)).arg(sClickPackagePath)); | 162 | m_ubuntuProcess.start(QString(QLatin1String(Constants::UBUNTUPACKAGINGWIDGET_CLICK_REVIEWER_TOOLS_AGAINST_PACKAGE)).arg(sClickPackagePath)); |
1567 | 161 | } | 163 | } |
1568 | 162 | |||
1569 | 163 | } | 164 | } |
1570 | 164 | 165 | ||
1571 | 165 | void UbuntuPackagingModel::onMessage(QString msg) | 166 | void UbuntuPackagingModel::onMessage(QString msg) |
1572 | @@ -294,6 +295,16 @@ | |||
1573 | 294 | if(!project) | 295 | if(!project) |
1574 | 295 | return; | 296 | return; |
1575 | 296 | 297 | ||
1576 | 298 | if (SnapHelper::isSnappyProject(project)) { | ||
1577 | 299 | if(m_reviewToolsInstalled) | ||
1578 | 300 | m_postPackageTask = Verify; | ||
1579 | 301 | else | ||
1580 | 302 | m_postPackageTask = None; | ||
1581 | 303 | |||
1582 | 304 | buildSnapPackage(); | ||
1583 | 305 | return; | ||
1584 | 306 | } | ||
1585 | 307 | |||
1586 | 297 | QString mimeType = project->projectManager()->mimeType(); | 308 | QString mimeType = project->projectManager()->mimeType(); |
1587 | 298 | if(mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEPROJECTMIMETYPE) | 309 | if(mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEPROJECTMIMETYPE) |
1588 | 299 | || mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE) | 310 | || mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE) |
1589 | @@ -303,6 +314,7 @@ | |||
1590 | 303 | m_postPackageTask = Verify; | 314 | m_postPackageTask = Verify; |
1591 | 304 | else | 315 | else |
1592 | 305 | m_postPackageTask = None; | 316 | m_postPackageTask = None; |
1593 | 317 | |||
1594 | 306 | buildClickPackage(); | 318 | buildClickPackage(); |
1595 | 307 | } else { | 319 | } else { |
1596 | 308 | m_UbuntuMenu_connection = QObject::connect(UbuntuMenu::instance(),SIGNAL(finished_action(const QProcess*,QString)),this,SLOT(onFinishedAction(const QProcess*,QString))); | 320 | m_UbuntuMenu_connection = QObject::connect(UbuntuMenu::instance(),SIGNAL(finished_action(const QProcess*,QString)),this,SLOT(onFinishedAction(const QProcess*,QString))); |
1597 | @@ -330,10 +342,11 @@ | |||
1598 | 330 | if (success) { | 342 | if (success) { |
1599 | 331 | //the step that created the click package is always in the last list and always the last step | 343 | //the step that created the click package is always in the last list and always the last step |
1600 | 332 | UbuntuPackageStep *pckStep = qobject_cast<UbuntuPackageStep*>(m_packageBuildSteps.last()->steps().last()); | 344 | UbuntuPackageStep *pckStep = qobject_cast<UbuntuPackageStep*>(m_packageBuildSteps.last()->steps().last()); |
1602 | 333 | if (pckStep && !pckStep->packagePath().isEmpty()) { | 345 | SnapcraftPackageStep *snapPckStep = qobject_cast<SnapcraftPackageStep*>(m_packageBuildSteps.last()->steps().last()); |
1603 | 346 | if ((pckStep && !pckStep->packagePath().isEmpty()) || (snapPckStep && !snapPckStep->packagePath().isEmpty())) { | ||
1604 | 334 | m_ubuntuProcess.stop(); | 347 | m_ubuntuProcess.stop(); |
1605 | 335 | 348 | ||
1607 | 336 | QString sClickPackagePath = pckStep->packagePath(); | 349 | QString sClickPackagePath = pckStep ? pckStep->packagePath() : snapPckStep->packagePath(); |
1608 | 337 | if (sClickPackagePath.isEmpty()) { | 350 | if (sClickPackagePath.isEmpty()) { |
1609 | 338 | clearPackageBuildList(); | 351 | clearPackageBuildList(); |
1610 | 339 | return; | 352 | return; |
1611 | @@ -381,19 +394,34 @@ | |||
1612 | 381 | void UbuntuPackagingModel::buildAndInstallPackageRequested() | 394 | void UbuntuPackagingModel::buildAndInstallPackageRequested() |
1613 | 382 | { | 395 | { |
1614 | 383 | m_postPackageTask = Install; | 396 | m_postPackageTask = Install; |
1615 | 397 | |||
1616 | 398 | if (SnapHelper::isSnappyProject(ProjectExplorer::SessionManager::startupProject())) { | ||
1617 | 399 | QMessageBox::information(Core::ICore::mainWindow(), qApp->applicationName(), | ||
1618 | 400 | tr("Installing is currently not supported for snappy projects.")); | ||
1619 | 401 | return; | ||
1620 | 402 | } | ||
1621 | 403 | |||
1622 | 384 | buildClickPackage(); | 404 | buildClickPackage(); |
1623 | 385 | } | 405 | } |
1624 | 386 | 406 | ||
1625 | 387 | void UbuntuPackagingModel::buildAndVerifyPackageRequested() | 407 | void UbuntuPackagingModel::buildAndVerifyPackageRequested() |
1626 | 388 | { | 408 | { |
1627 | 389 | m_postPackageTask = Verify; | 409 | m_postPackageTask = Verify; |
1629 | 390 | buildClickPackage(); | 410 | |
1630 | 411 | if (SnapHelper::isSnappyProject(ProjectExplorer::SessionManager::startupProject())) | ||
1631 | 412 | buildSnapPackage(); | ||
1632 | 413 | else | ||
1633 | 414 | buildClickPackage(); | ||
1634 | 391 | } | 415 | } |
1635 | 392 | 416 | ||
1636 | 393 | void UbuntuPackagingModel::buildPackageRequested() | 417 | void UbuntuPackagingModel::buildPackageRequested() |
1637 | 394 | { | 418 | { |
1638 | 395 | m_postPackageTask = None; | 419 | m_postPackageTask = None; |
1640 | 396 | buildClickPackage(); | 420 | |
1641 | 421 | if (SnapHelper::isSnappyProject(ProjectExplorer::SessionManager::startupProject())) | ||
1642 | 422 | buildSnapPackage(); | ||
1643 | 423 | else | ||
1644 | 424 | buildClickPackage(); | ||
1645 | 397 | } | 425 | } |
1646 | 398 | 426 | ||
1647 | 399 | void UbuntuPackagingModel::targetChanged() | 427 | void UbuntuPackagingModel::targetChanged() |
1648 | @@ -561,6 +589,59 @@ | |||
1649 | 561 | } | 589 | } |
1650 | 562 | } | 590 | } |
1651 | 563 | 591 | ||
1652 | 592 | void UbuntuPackagingModel::buildSnapPackage() | ||
1653 | 593 | { | ||
1654 | 594 | ProjectExplorer::Project* project = ProjectExplorer::SessionManager::startupProject(); | ||
1655 | 595 | if(!project) { | ||
1656 | 596 | QMessageBox::warning(Core::ICore::mainWindow(),tr("No Project"),tr("No valid project loaded.")); | ||
1657 | 597 | return; | ||
1658 | 598 | } | ||
1659 | 599 | |||
1660 | 600 | if(ProjectExplorer::BuildManager::isBuilding()) { | ||
1661 | 601 | QMessageBox::information(Core::ICore::mainWindow(),tr("Build running"),tr("There is currently a build running, please wait for it to be finished")); | ||
1662 | 602 | return; | ||
1663 | 603 | } | ||
1664 | 604 | |||
1665 | 605 | if(!ProjectExplorer::ProjectExplorerPlugin::instance()->saveModifiedFiles()) | ||
1666 | 606 | return; | ||
1667 | 607 | |||
1668 | 608 | if(!SnapHelper::isSnappyProject(project)) | ||
1669 | 609 | return; | ||
1670 | 610 | |||
1671 | 611 | ProjectExplorer::Target* target = project->activeTarget(); | ||
1672 | 612 | if(!target) | ||
1673 | 613 | return; | ||
1674 | 614 | |||
1675 | 615 | ProjectExplorer::BuildConfiguration* bc = target->activeBuildConfiguration(); | ||
1676 | 616 | if(!bc) { | ||
1677 | 617 | QMessageBox::information(Core::ICore::mainWindow(),tr("Error"),tr("Please add a valid buildconfiguration to your project")); | ||
1678 | 618 | return; | ||
1679 | 619 | } | ||
1680 | 620 | |||
1681 | 621 | if(!bc->isEnabled()) { | ||
1682 | 622 | QString disabledReason = bc->disabledReason(); | ||
1683 | 623 | QMessageBox::information(Core::ICore::mainWindow(),tr("Disabled"),tr("The currently selected Buildconfiguration is disabled. %1").arg(disabledReason)); | ||
1684 | 624 | return; | ||
1685 | 625 | } | ||
1686 | 626 | |||
1687 | 627 | clearPackageBuildList(); | ||
1688 | 628 | |||
1689 | 629 | m_packageBuildSteps.append(QSharedPointer<ProjectExplorer::BuildStepList> (new ProjectExplorer::BuildStepList(bc,ProjectExplorer::Constants::BUILDSTEPS_BUILD))); | ||
1690 | 630 | ProjectExplorer::BuildStepList *buildSteps = bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)); | ||
1691 | 631 | if (buildSteps && buildSteps->count() > 0) { | ||
1692 | 632 | //add the normal buildsteps | ||
1693 | 633 | m_packageBuildSteps.last()->cloneSteps(buildSteps); | ||
1694 | 634 | } | ||
1695 | 635 | |||
1696 | 636 | //append the snap packaging step | ||
1697 | 637 | SnapcraftPackageStep *package = new SnapcraftPackageStep(m_packageBuildSteps.last().data()); | ||
1698 | 638 | m_packageBuildSteps.last()->appendStep(package); | ||
1699 | 639 | |||
1700 | 640 | m_buildManagerConnection = connect(ProjectExplorer::BuildManager::instance(),SIGNAL(buildQueueFinished(bool)),this,SLOT(buildFinished(bool))); | ||
1701 | 641 | |||
1702 | 642 | ProjectExplorer::BuildManager::buildList(m_packageBuildSteps.last().data(),tr("Build Project")); | ||
1703 | 643 | } | ||
1704 | 644 | |||
1705 | 564 | /*! | 645 | /*! |
1706 | 565 | * \brief UbuntuPackagingWidget::clearAdditionalBuildSteps | 646 | * \brief UbuntuPackagingWidget::clearAdditionalBuildSteps |
1707 | 566 | * Clears the last used additional buildsteps | 647 | * Clears the last used additional buildsteps |
1708 | 567 | 648 | ||
1709 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.h' | |||
1710 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.h 2016-06-09 08:47:42 +0000 | |||
1711 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntupackagingmodel.h 2016-09-22 16:34:17 +0000 | |||
1712 | @@ -95,6 +95,7 @@ | |||
1713 | 95 | 95 | ||
1714 | 96 | private: | 96 | private: |
1715 | 97 | void buildClickPackage (); | 97 | void buildClickPackage (); |
1716 | 98 | void buildSnapPackage (); | ||
1717 | 98 | void clearPackageBuildList (); | 99 | void clearPackageBuildList (); |
1718 | 99 | void updateFrameworkList (); | 100 | void updateFrameworkList (); |
1719 | 100 | void resetValidationResult (); | 101 | void resetValidationResult (); |
1720 | 101 | 102 | ||
1721 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp' | |||
1722 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-09-05 17:35:40 +0000 | |||
1723 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-09-22 16:34:17 +0000 | |||
1724 | @@ -49,9 +49,11 @@ | |||
1725 | 49 | #include <ubuntu/device/remote/ubunturemotedeployconfiguration.h> | 49 | #include <ubuntu/device/remote/ubunturemotedeployconfiguration.h> |
1726 | 50 | #include <ubuntu/device/remote/ubuntudeploystepfactory.h> | 50 | #include <ubuntu/device/remote/ubuntudeploystepfactory.h> |
1727 | 51 | 51 | ||
1731 | 52 | #include "wizards/ubuntuprojectapplicationwizard.h" | 52 | #include <ubuntu/wizards/ubuntuprojectapplicationwizard.h> |
1732 | 53 | #include "wizards/ubuntufirstrunwizard.h" | 53 | #include <ubuntu/wizards/ubuntufirstrunwizard.h> |
1733 | 54 | #include "wizards/ubuntuprojectmigrationwizard.h" | 54 | #include <ubuntu/wizards/ubuntuprojectmigrationwizard.h> |
1734 | 55 | |||
1735 | 56 | #include "ubuntujsextension.h" | ||
1736 | 55 | 57 | ||
1737 | 56 | #include <coreplugin/modemanager.h> | 58 | #include <coreplugin/modemanager.h> |
1738 | 57 | #include <projectexplorer/kitmanager.h> | 59 | #include <projectexplorer/kitmanager.h> |
1739 | @@ -60,6 +62,7 @@ | |||
1740 | 60 | #include <projectexplorer/processparameters.h> | 62 | #include <projectexplorer/processparameters.h> |
1741 | 61 | #include <coreplugin/featureprovider.h> | 63 | #include <coreplugin/featureprovider.h> |
1742 | 62 | #include <coreplugin/coreplugin.h> | 64 | #include <coreplugin/coreplugin.h> |
1743 | 65 | #include <coreplugin/jsexpander.h> | ||
1744 | 63 | #include <utils/mimetypes/mimedatabase.h> | 66 | #include <utils/mimetypes/mimedatabase.h> |
1745 | 64 | #include <utils/mimetypes/mimeglobpattern_p.h> | 67 | #include <utils/mimetypes/mimeglobpattern_p.h> |
1746 | 65 | #include <cmakeprojectmanager/cmaketoolmanager.h> | 68 | #include <cmakeprojectmanager/cmaketoolmanager.h> |
1747 | @@ -233,6 +236,9 @@ | |||
1748 | 233 | addAutoReleasedObject(new Internal::UbuntuManifestEditorFactory); | 236 | addAutoReleasedObject(new Internal::UbuntuManifestEditorFactory); |
1749 | 234 | addAutoReleasedObject(new Internal::UbuntuApparmorEditorFactory); | 237 | addAutoReleasedObject(new Internal::UbuntuApparmorEditorFactory); |
1750 | 235 | 238 | ||
1751 | 239 | //Ubuntu expander | ||
1752 | 240 | Core::JsExpander::registerQObjectForJs(QStringLiteral("Ubuntu"), new UbuntuJsExtension); | ||
1753 | 241 | |||
1754 | 236 | //trigger kit autodetection and update after projectexplorer loaded the kits | 242 | //trigger kit autodetection and update after projectexplorer loaded the kits |
1755 | 237 | connect(ProjectExplorer::KitManager::instance(),SIGNAL(kitsLoaded()) | 243 | connect(ProjectExplorer::KitManager::instance(),SIGNAL(kitsLoaded()) |
1756 | 238 | ,this,SLOT(onKitsLoaded())); | 244 | ,this,SLOT(onKitsLoaded())); |
1757 | 239 | 245 | ||
1758 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp' | |||
1759 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-09-05 17:35:40 +0000 | |||
1760 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-09-22 16:34:17 +0000 | |||
1761 | @@ -18,11 +18,13 @@ | |||
1762 | 18 | 18 | ||
1763 | 19 | #include "ubuntuprojectapplicationwizard.h" | 19 | #include "ubuntuprojectapplicationwizard.h" |
1764 | 20 | #include "ubuntufirstrunwizard.h" | 20 | #include "ubuntufirstrunwizard.h" |
1770 | 21 | #include "../ubuntushared.h" | 21 | |
1771 | 22 | #include "../ubuntuconstants.h" | 22 | #include <ubuntu/ubuntushared.h> |
1772 | 23 | #include "../ubuntuproject.h" | 23 | #include <ubuntu/ubuntushared.h> |
1773 | 24 | #include "../ubuntubzr.h" | 24 | #include <ubuntu/ubuntuconstants.h> |
1774 | 25 | #include "../ubuntuclicktool.h" | 25 | #include <ubuntu/ubuntuproject.h> |
1775 | 26 | #include <ubuntu/ubuntubzr.h> | ||
1776 | 27 | #include <ubuntu/ubuntuclicktool.h> | ||
1777 | 26 | 28 | ||
1778 | 27 | #include <utils/qtcassert.h> | 29 | #include <utils/qtcassert.h> |
1779 | 28 | #include <utils/pathchooser.h> | 30 | #include <utils/pathchooser.h> |
1780 | 29 | 31 | ||
1781 | === modified file 'fix-qt-build.py' | |||
1782 | --- fix-qt-build.py 2016-09-14 14:37:07 +0000 | |||
1783 | +++ fix-qt-build.py 2016-09-22 16:34:17 +0000 | |||
1784 | @@ -24,7 +24,7 @@ | |||
1785 | 24 | for root, dirs, files in os.walk(workDir): | 24 | for root, dirs, files in os.walk(workDir): |
1786 | 25 | for file in files: | 25 | for file in files: |
1787 | 26 | if file.endswith("ubuntu_save_gitmodules"): | 26 | if file.endswith("ubuntu_save_gitmodules"): |
1789 | 27 | shutil.move(os.path.join(root, file), os.path.join(root, ".gitmodules")) | 27 | shutil.copy2(os.path.join(root, file), os.path.join(root, ".gitmodules")) |
1790 | 28 | 28 | ||
1791 | 29 | #all subdirectores need a .git dir | 29 | #all subdirectores need a .git dir |
1792 | 30 | for entry in os.listdir(workDir): | 30 | for entry in os.listdir(workDir): |
PASSED: Continuous integration, rev:162 /jenkins. ubuntu. com/ubuntu- sdk/job/ qtcreator- ide-ci- amd64/346/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/6776/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ qtcreator- ide-ci- amd64/346/ rebuild
https:/