From 6b6091ea61ca86bd7675b84e3e763fd69feb45c7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger <tobias.hunger@theqtcompany.com> Date: Thu, 25 Jun 2015 12:10:23 +0200 Subject: [PATCH] Replace several "Plain C++" with one JSON wizard Change-Id: Ia08f2127cdb25785cf313ec0a31a3d9775161c9b Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> --- .../wizards/plaincppapp/cmake/wizard.xml | 43 ------- .../wizards/plaincppapp/common/console.png | Bin 567 -> 0 bytes .../wizards/plaincppapp/qbs/wizard.xml | 43 ------- .../wizards/plaincppapp/qmake/wizard.xml | 50 -------- .../plaincpp}/CMakeLists.txt | 2 +- .../plaincpp/file.pro} | 2 +- .../plaincpp/file.qbs} | 2 +- .../common => projects/plaincpp}/main.cpp | 1 + .../wizards/projects/plaincpp/wizard.json | 114 ++++++++++++++++++ 9 files changed, 118 insertions(+), 139 deletions(-) delete mode 100644 share/qtcreator/templates/wizards/plaincppapp/cmake/wizard.xml delete mode 100644 share/qtcreator/templates/wizards/plaincppapp/common/console.png delete mode 100644 share/qtcreator/templates/wizards/plaincppapp/qbs/wizard.xml delete mode 100644 share/qtcreator/templates/wizards/plaincppapp/qmake/wizard.xml rename share/qtcreator/templates/wizards/{plaincppapp/cmake => projects/plaincpp}/CMakeLists.txt (82%) rename share/qtcreator/templates/wizards/{plaincppapp/qmake/project.pro => projects/plaincpp/file.pro} (68%) rename share/qtcreator/templates/wizards/{plaincppapp/qbs/project.qbs => projects/plaincpp/file.qbs} (87%) rename share/qtcreator/templates/wizards/{plaincppapp/common => projects/plaincpp}/main.cpp (81%) create mode 100644 share/qtcreator/templates/wizards/projects/plaincpp/wizard.json diff --git a/share/qtcreator/templates/wizards/plaincppapp/cmake/wizard.xml b/share/qtcreator/templates/wizards/plaincppapp/cmake/wizard.xml deleted file mode 100644 index 4bd5e93384f..00000000000 --- a/share/qtcreator/templates/wizards/plaincppapp/cmake/wizard.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ ---> -<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (CMake)" category="I.Projects" - platformIndependent="true" featuresRequired="Plugin.CMakeProjectManager"> - <icon>../common/console.png</icon> - <description>Creates a plain C++ project using CMake, not using the Qt library.</description> - <displayname>Plain C++ Project (CMake Build)</displayname>; - <displaycategory>Non-Qt Project</displaycategory> - <files> - <file source="../common/main.cpp" target="main.%CppSourceSuffix%" openeditor="true"/> - <file source="CMakeLists.txt" openproject="true"/> - </files> -</wizard> diff --git a/share/qtcreator/templates/wizards/plaincppapp/common/console.png b/share/qtcreator/templates/wizards/plaincppapp/common/console.png deleted file mode 100644 index 7569a988f4a09ad0a72d7250b47db99c88471a79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmV-70?7S|P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru)&c_xFagC7Dz5+l03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00EmxL_t(|+U=LUY63wN zh0m-**t^BBpbLUq`UqCRYHJH0BQKCnu(8W4<RMa6nP3r!m5*SlqO9U#F|)<ErV^64 z>WceAz|#%P<$T<^Gn`@jZWl$$K*1^;fd5=H`u%+#rsGzN#R33;=Xt2t>zNo&CKC*Y z!_yrAfWcsJv?(oVt-(3J58*!rP)Z?+qGABH+b!mgb1d`%Qp$V*q?GVIAHh=qzvm<1 zL8=fJ0Zh{bjR<_kp=&yIh>HM*VZhcloQ{(TM4}n6EGsjJ#JAua#4Weus(0W3QGO|- z6qKNA8mg%fhG9McQc46o!1{TOoxKBn5i0K$5K;C32XnvYL)SF;jKhAlK}2ATrIQD) zF?Tu+Y;7adAvT-MQ4JA62yr_=6h$Y^Ez81kxy1BsdQ|7O-9!Kvk01;~sHTcFPd$>w ziHP8QI6wr@h>pyO2yWYrtvjVgzmIXNl?;F}1|bCaCx>a8Fdlw4O$d>w)i({{;SESJ zl-?83=_6RJR!~Z1Vn#%$R;%X${%**%13!N(_f(vhz5&jR!O)`<rhotd002ovPDHLk FV1n8)<aGc5 diff --git a/share/qtcreator/templates/wizards/plaincppapp/qbs/wizard.xml b/share/qtcreator/templates/wizards/plaincppapp/qbs/wizard.xml deleted file mode 100644 index 67a4e4f66b7..00000000000 --- a/share/qtcreator/templates/wizards/plaincppapp/qbs/wizard.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ ---> -<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (Qbs)" category="I.Projects" - platformIndependent="true" featuresRequired="Plugin.QbsProjectManager"> - <icon>../common/console.png</icon> - <description>Creates a plain (non-Qt) C++ project using Qbs.</description> - <displayname>Plain C++ Project (Qbs Build)</displayname>; - <displaycategory>Non-Qt Project</displaycategory> - <files> - <file source="../common/main.cpp" target="main.%CppSourceSuffix%" openeditor="true"/> - <file source="project.qbs" target="%ProjectName%.qbs" openproject="true"/> - </files> -</wizard> diff --git a/share/qtcreator/templates/wizards/plaincppapp/qmake/wizard.xml b/share/qtcreator/templates/wizards/plaincppapp/qmake/wizard.xml deleted file mode 100644 index 466a5a79bc5..00000000000 --- a/share/qtcreator/templates/wizards/plaincppapp/qmake/wizard.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -Custom project wizard configuration example file. Note that by convention, -the project file goes last. -The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and -leave room for the Qt 4 target page. ---> -<wizard version="1" kind="project" - class="qmakeproject" firstpage="10" - id="R.Plain C++" category="I.Projects" - featuresRequired="QtSupport.Wizards.FeatureQt"> - <icon>../common/console.png</icon> - <description>Creates a plain C++ project using qmake, not using the Qt library.</description> - <displayname>Plain C++ Project</displayname>; - <displaycategory>Non-Qt Project</displaycategory> - <files> - <file source="../common/main.cpp" target="main.%CppSourceSuffix%" openeditor="true"/> - <file source="project.pro" target="%ProjectName%.pro" openproject="true"/> - </files> -</wizard> diff --git a/share/qtcreator/templates/wizards/plaincppapp/cmake/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt similarity index 82% rename from share/qtcreator/templates/wizards/plaincppapp/cmake/CMakeLists.txt rename to share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt index aad92e30c3c..9001db70166 100644 --- a/share/qtcreator/templates/wizards/plaincppapp/cmake/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt @@ -1,4 +1,4 @@ -project(%ProjectName%) +project(%{ProjectName}) cmake_minimum_required(VERSION 2.8) aux_source_directory(. SRC_LIST) add_executable(${PROJECT_NAME} ${SRC_LIST}) diff --git a/share/qtcreator/templates/wizards/plaincppapp/qmake/project.pro b/share/qtcreator/templates/wizards/projects/plaincpp/file.pro similarity index 68% rename from share/qtcreator/templates/wizards/plaincppapp/qmake/project.pro rename to share/qtcreator/templates/wizards/projects/plaincpp/file.pro index 3f05c8e3bbf..2aa18858cea 100644 --- a/share/qtcreator/templates/wizards/plaincppapp/qmake/project.pro +++ b/share/qtcreator/templates/wizards/projects/plaincpp/file.pro @@ -3,4 +3,4 @@ CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt -SOURCES += main.%CppSourceSuffix% +SOURCES += %{CppFileName} diff --git a/share/qtcreator/templates/wizards/plaincppapp/qbs/project.qbs b/share/qtcreator/templates/wizards/projects/plaincpp/file.qbs similarity index 87% rename from share/qtcreator/templates/wizards/plaincppapp/qbs/project.qbs rename to share/qtcreator/templates/wizards/projects/plaincpp/file.qbs index e828e26a6d9..257f61dc498 100644 --- a/share/qtcreator/templates/wizards/plaincppapp/qbs/project.qbs +++ b/share/qtcreator/templates/wizards/projects/plaincpp/file.qbs @@ -3,7 +3,7 @@ import qbs CppApplication { type: "application" // To suppress bundle generation on Mac consoleApplication: true - files: "main.%CppSourceSuffix%" + files: "%{CppFileName}" Group { // Properties for the produced executable fileTagsFilter: product.type diff --git a/share/qtcreator/templates/wizards/plaincppapp/common/main.cpp b/share/qtcreator/templates/wizards/projects/plaincpp/main.cpp similarity index 81% rename from share/qtcreator/templates/wizards/plaincppapp/common/main.cpp rename to share/qtcreator/templates/wizards/projects/plaincpp/main.cpp index 3129fb9dd95..0f458918994 100644 --- a/share/qtcreator/templates/wizards/plaincppapp/common/main.cpp +++ b/share/qtcreator/templates/wizards/projects/plaincpp/main.cpp @@ -1,3 +1,4 @@ +%{Cpp:LicenseTemplate}\ #include <iostream> using namespace std; diff --git a/share/qtcreator/templates/wizards/projects/plaincpp/wizard.json b/share/qtcreator/templates/wizards/projects/plaincpp/wizard.json new file mode 100644 index 00000000000..5ec2b6ed317 --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/plaincpp/wizard.json @@ -0,0 +1,114 @@ +{ + "version": 1, + "kind": "project", + "id": "R.Plain Cpp Application", + "category": "I.Projects", + "trDescription": "Creates a simple C++ application using either qmake, CMake, or Qbs to build.", + "trDisplayName": "Plain C++ Application", + "trDisplayCategory": "Non-Qt Project", + "icon": "../../global/consoleapplication.png", + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", + + "options": + [ + { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, + { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, + { "key": "IsTopLevelProject", "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}'}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project" + }, + { + "trDisplayName": "Define Build System", + "trShortTitle": "Build System", + "typeId": "Fields", + "data": + [ + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "data": + { + "index": 0, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "CMake", + "value": "cmake", + "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + } + ] + } + } + ] + }, + + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{IsTopLevelProject}", + "data": { "projectFilePath": "%{ProjectFile}" } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "file.pro", + "target": "%{ProFile}", + "openAsProject": true, + "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + }, + { + "source": "CMakeLists.txt", + "openAsProject": true, + "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + }, + { + "source": "file.qbs", + "target": "%{QbsFile}", + "openAsProject": true, + "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + }, + { + "source": "main.cpp", + "target": "%{CppFileName}", + "openInEditor": true + }, + { + "source": "../git.ignore", + "target": "%{ProjectDirectory}/.gitignore", + "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + } + ] + } + ] +} -- GitLab