aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-02-01 13:40:10 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-02-06 11:26:34 +0100
commitc4131d68d102220546b8316dc1f19234778d5933 (patch)
tree90578c09c6a75f7bd9dad43af9827ff60a91cf01
parentf73b25ced7f2f63ba72f2cee579cbf81a2bfe4fc (diff)
out of process pri file reader
Remove the q5makewrapper COM component and replace it with the command line tool qmakefilereader. Qmakefilereader reads a .pro/.pri file and outputs its evaluated content as XML on stdout. Change-Id: I89cc268d18072d8211944e136f095f3cb1a3764b Reviewed-by: Ismo Haataja <ismo.haataja@digia.com>
-rw-r--r--Qt4VS2003/ComWrappers/QMake/QMake.pro11
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/.gitignore2
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/axfactory.cpp48
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.cpp89
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.def8
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.h32
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.icobin5974 -> 0 bytes
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.pro28
-rw-r--r--Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.rc2
-rw-r--r--Qt4VS2003/Qt4VSAddin/Connect.cs46
-rw-r--r--Qt4VS2003/Qt4VSAddin/ExtLoader.cs1
-rw-r--r--Qt4VS2003/Qt4VSAddin/QMakeWrapper.cs160
-rw-r--r--Qt4VS2003/Qt4VSAddin/Qt5VSAddin2008.csproj11
-rw-r--r--Qt4VS2003/Qt4VSAddin/Qt5VSAddin2010.csproj12
-rw-r--r--Qt4VS2003/Qt4VSAddin/Qt5VSAddin2012.csproj12
-rw-r--r--tools/qmakefilereader/evalhandler.cpp (renamed from Qt4VS2003/ComWrappers/QMake/evalhandler.cpp)0
-rw-r--r--tools/qmakefilereader/evalhandler.h (renamed from Qt4VS2003/ComWrappers/QMake/evalhandler.h)0
-rw-r--r--tools/qmakefilereader/evaluator/README (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/README)0
-rw-r--r--tools/qmakefilereader/evaluator/ioutils.cpp (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/ioutils.cpp)0
-rw-r--r--tools/qmakefilereader/evaluator/ioutils.h (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/ioutils.h)0
-rw-r--r--tools/qmakefilereader/evaluator/proitems.cpp (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/proitems.cpp)0
-rw-r--r--tools/qmakefilereader/evaluator/proitems.h (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/proitems.h)0
-rw-r--r--tools/qmakefilereader/evaluator/qmake_global.h (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmake_global.h)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakebuiltins.cpp (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakebuiltins.cpp)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakeevaluator.cpp (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator.cpp)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakeevaluator.h (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator.h)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakeevaluator_p.h (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator_p.h)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakeglobals.cpp (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakeglobals.cpp)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakeglobals.h (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakeglobals.h)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakeparser.cpp (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakeparser.cpp)0
-rw-r--r--tools/qmakefilereader/evaluator/qmakeparser.h (renamed from Qt4VS2003/ComWrappers/QMake/evaluator/qmakeparser.h)0
-rw-r--r--tools/qmakefilereader/main.cpp (renamed from Qt4VS2003/ComWrappers/QMake/demo.cpp)58
-rw-r--r--tools/qmakefilereader/qmakedataprovider.cpp (renamed from Qt4VS2003/ComWrappers/QMake/qmakedataprovider.cpp)0
-rw-r--r--tools/qmakefilereader/qmakedataprovider.h (renamed from Qt4VS2003/ComWrappers/QMake/qmakedataprovider.h)0
-rw-r--r--tools/qmakefilereader/qmakefilereader.pri (renamed from Qt4VS2003/ComWrappers/QMake/QMake.pri)0
-rw-r--r--tools/qmakefilereader/qmakefilereader.pro16
-rw-r--r--tools/tools.pro5
37 files changed, 258 insertions, 283 deletions
diff --git a/Qt4VS2003/ComWrappers/QMake/QMake.pro b/Qt4VS2003/ComWrappers/QMake/QMake.pro
deleted file mode 100644
index 406bb0ef..00000000
--- a/Qt4VS2003/ComWrappers/QMake/QMake.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-include(QMake.pri)
-
-CONFIG += \
- console \
- debug \
-
-TARGET = demo
-
-SOURCES += \
- demo.cpp
-
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/.gitignore b/Qt4VS2003/ComWrappers/qmakewrapper/.gitignore
deleted file mode 100644
index 3bf95158..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.sln
-*.vcproj
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/axfactory.cpp b/Qt4VS2003/ComWrappers/qmakewrapper/axfactory.cpp
deleted file mode 100644
index 8278ad33..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/axfactory.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt VS Add-in.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmakewrapper.h"
-#include <qaxfactory.h>
-
-QAXFACTORY_BEGIN("{C9750D9B-554C-4828-AFDC-A8352E600344}", "{78AD00CA-1D68-4D4D-82FF-82850A633417}")
- QAXCLASS(Q5MakeWrapper)
-QAXFACTORY_END()
-
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.cpp b/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.cpp
deleted file mode 100644
index 3ee2aeb7..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt VS Add-in.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmakewrapper.h"
-#include "qmakedataprovider.h"
-
-Q5MakeWrapper::Q5MakeWrapper(QWidget *parent)
- : QWidget(parent)
-{
- m_qmakeDataProvider = new QMakeDataProvider();
-}
-
-bool Q5MakeWrapper::readFile(const QString &fileName)
-{
- return m_qmakeDataProvider->readFile(fileName);
-}
-
-void Q5MakeWrapper::setQtDir(const QString& qtdir)
-{
- m_qmakeDataProvider->setQtDir(qtdir);
-}
-
-QStringList Q5MakeWrapper::sourceFiles() const
-{
- return m_qmakeDataProvider->getSourceFiles();
-}
-
-QStringList Q5MakeWrapper::headerFiles() const
-{
- return m_qmakeDataProvider->getHeaderFiles();
-}
-
-QStringList Q5MakeWrapper::formFiles() const
-{
- return m_qmakeDataProvider->getFormFiles();
-}
-
-QStringList Q5MakeWrapper::resourceFiles() const
-{
- return m_qmakeDataProvider->getResourceFiles();
-}
-
-bool Q5MakeWrapper::isValid() const
-{
- return m_qmakeDataProvider->isValid();
-}
-
-bool Q5MakeWrapper::isFlat() const
-{
- return m_qmakeDataProvider->isFlat();
-}
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.def b/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.def
deleted file mode 100644
index 5d824910..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.def
+++ /dev/null
@@ -1,8 +0,0 @@
-; mfc_test.def : Declares the module parameters.
-
-EXPORTS
- DllCanUnloadNow PRIVATE
- DllGetClassObject PRIVATE
- DllRegisterServer PRIVATE
- DllUnregisterServer PRIVATE
- DumpIDL PRIVATE
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.h b/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.h
deleted file mode 100644
index 22618580..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef QMAKEWRAPPER_H
-#define QMAKEWRAPPER_H
-
-#include <QtWidgets/QWidget>
-
-class QMakeDataProvider;
-
-class Q5MakeWrapper : public QWidget
-{
- Q_OBJECT
- Q_CLASSINFO("ClassID", "{33BE6C6F-E878-4F76-9676-9D78C44C4086}")
- Q_CLASSINFO("InterfaceID", "{7BE63374-3234-44CC-9A68-F68E01D3BAF1}")
- Q_CLASSINFO("EventsID", "{CA15864E-AE89-409F-BE96-F212931383A9}")
-
-public:
- Q5MakeWrapper(QWidget *parent = 0);
-
-public slots:
- bool readFile(const QString &fileName);
- void setQtDir(const QString&);
- QStringList sourceFiles() const;
- QStringList headerFiles() const;
- QStringList formFiles() const;
- QStringList resourceFiles() const;
- bool isValid() const;
- bool isFlat() const;
-
-private:
- QMakeDataProvider *m_qmakeDataProvider;
-};
-
-#endif
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.ico b/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.ico
deleted file mode 100644
index 26425ea5..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.ico
+++ /dev/null
Binary files differ
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.pro b/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.pro
deleted file mode 100644
index 99f66009..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.pro
+++ /dev/null
@@ -1,28 +0,0 @@
-TEMPLATE = lib
-
-QT += axserver
-CONFIG += qaxserver_no_postlink release
-TARGET = q5makewrapper
-DESTDIR = ./
-VERSION = 1.0.0
-DEF_FILE = qmakewrapper.def
-RC_FILE = qmakewrapper.rc
-
-NEWLINE = $$escape_expand(\\n\\t)
-
-!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$NEWLINE
-QMAKE_POST_LINK += $$quote(idc q5makewrapper1.dll /idl q5makewrapper.idl -version 1.0.0$$NEWLINE)
-QMAKE_POST_LINK += $$quote(midl q5makewrapper.idl /nologo /tlb q5makewrapper.tlb$$NEWLINE)
-QMAKE_POST_LINK += $$quote(idc q5makewrapper1.dll /tlb q5makewrapper.tlb$$NEWLINE)
-QMAKE_POST_LINK += $$quote(idc q5makewrapper1.dll /regserver$$NEWLINE)
-QMAKE_POST_LINK += $$quote(aximp q5makewrapper1.dll)
-QMAKE_CLEAN += q5makewrapper.idl q5makewrapper.tlb
-
-INCLUDEPATH += ../qmake
-
-HEADERS = qmakewrapper.h
-
-SOURCES = qmakewrapper.cpp \
- axfactory.cpp
-
-include(../qmake/qmake.pri)
diff --git a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.rc b/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.rc
deleted file mode 100644
index 1f7bc634..00000000
--- a/Qt4VS2003/ComWrappers/qmakewrapper/qmakewrapper.rc
+++ /dev/null
@@ -1,2 +0,0 @@
-1 TYPELIB "qmakewrapper.rc"
-1 ICON DISCARDABLE "qmakewrapper.ico"
diff --git a/Qt4VS2003/Qt4VSAddin/Connect.cs b/Qt4VS2003/Qt4VSAddin/Connect.cs
index b2937d65..6718698b 100644
--- a/Qt4VS2003/Qt4VSAddin/Connect.cs
+++ b/Qt4VS2003/Qt4VSAddin/Connect.cs
@@ -69,6 +69,7 @@ namespace Qt5VSAddin
private FormProjectQtSettings formProjectQtSettings = null;
private string installationDir = null;
private string appWrapperPath = null;
+ private string qmakeFileReaderPath = null;
private bool commandLine = false;
public static Connect Instance()
@@ -94,26 +95,39 @@ namespace Qt5VSAddin
get
{
if (appWrapperPath == null)
- {
- string exeName = "qt5appwrapper.exe";
- appWrapperPath = installationDir + exeName;
- if (!File.Exists(appWrapperPath))
- {
- appWrapperPath = installationDir;
- if (appWrapperPath.EndsWith("\\"))
- appWrapperPath = appWrapperPath.Remove(appWrapperPath.Length - 1);
- int idx = appWrapperPath.LastIndexOf('\\');
- if (idx >= 0 && idx < appWrapperPath.Length - 1)
- appWrapperPath = appWrapperPath.Remove(idx + 1);
- appWrapperPath += exeName;
- if (!File.Exists(appWrapperPath))
- appWrapperPath = null;
- }
- }
+ appWrapperPath = locateHelperExecutable("qt5appwrapper.exe");
return appWrapperPath;
}
}
+ public string QMakeFileReaderPath
+ {
+ get
+ {
+ if (qmakeFileReaderPath == null)
+ qmakeFileReaderPath = locateHelperExecutable("qmakefilereader.exe");
+ return qmakeFileReaderPath;
+ }
+ }
+
+ private string locateHelperExecutable(string exeName)
+ {
+ string filePath = installationDir + exeName;
+ if (!File.Exists(filePath))
+ {
+ filePath = installationDir;
+ if (filePath.EndsWith("\\"))
+ filePath = filePath.Remove(filePath.Length - 1);
+ int idx = filePath.LastIndexOf('\\');
+ if (idx >= 0 && idx < filePath.Length - 1)
+ filePath = filePath.Remove(idx + 1);
+ filePath += exeName;
+ if (!File.Exists(filePath))
+ filePath = null;
+ }
+ return filePath;
+ }
+
/// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
/// <param term='application'>Root object of the host application.</param>
/// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
diff --git a/Qt4VS2003/Qt4VSAddin/ExtLoader.cs b/Qt4VS2003/Qt4VSAddin/ExtLoader.cs
index 3918af92..dd05f46c 100644
--- a/Qt4VS2003/Qt4VSAddin/ExtLoader.cs
+++ b/Qt4VS2003/Qt4VSAddin/ExtLoader.cs
@@ -47,7 +47,6 @@ using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.VCProjectEngine;
-using q5makewrapper1Lib;
using System.Collections;
using System.Net.Sockets;
using System.Collections.Generic;
diff --git a/Qt4VS2003/Qt4VSAddin/QMakeWrapper.cs b/Qt4VS2003/Qt4VSAddin/QMakeWrapper.cs
new file mode 100644
index 00000000..5cdadf85
--- /dev/null
+++ b/Qt4VS2003/Qt4VSAddin/QMakeWrapper.cs
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt VS Add-in.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Xml;
+
+namespace Qt5VSAddin
+{
+ public class QMakeWrapper
+ {
+ private string qtdir;
+ private bool valid;
+ private bool flat;
+ private string[] sources;
+ private string[] headers;
+ private string[] resources;
+ private string[] forms;
+
+ public QMakeWrapper()
+ {
+ }
+
+ public void setQtDir(string path)
+ {
+ qtdir = path;
+ }
+
+ public bool readFile(string filePath)
+ {
+ string output;
+ try
+ {
+ string exeFilePath = Connect.Instance().QMakeFileReaderPath;
+ if (!System.IO.File.Exists(exeFilePath))
+ return false;
+
+ Process process = new Process();
+ process.StartInfo.CreateNoWindow = true;
+ process.StartInfo.FileName = exeFilePath;
+ process.StartInfo.Arguments = shellQuote(qtdir) + ' ' + shellQuote(filePath);
+ process.StartInfo.UseShellExecute = false;
+ process.StartInfo.RedirectStandardOutput = true;
+ if (!process.Start())
+ return false;
+ output = process.StandardOutput.ReadToEnd();
+ process.WaitForExit();
+
+ XmlReader reader = new XmlTextReader(new System.IO.StringReader(output));
+ reader.ReadToFollowing("content");
+ valid = stringToBool(reader.GetAttribute("valid"));
+ flat = stringToBool(reader.GetAttribute("flat"));
+ sources = readFileElements(reader, "SOURCES");
+ headers = readFileElements(reader, "HEADERS");
+ resources = readFileElements(reader, "RESOURCES");
+ forms = readFileElements(reader, "FORMS");
+ }
+ catch
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public bool isValid()
+ {
+ return valid;
+ }
+
+ public bool isFlat()
+ {
+ return flat;
+ }
+
+ public string[] sourceFiles()
+ {
+ return sources;
+ }
+
+ public string[] headerFiles()
+ {
+ return headers;
+ }
+
+ public string[] resourceFiles()
+ {
+ return resources;
+ }
+
+ public string[] formFiles()
+ {
+ return forms;
+ }
+
+ private bool stringToBool(string str)
+ {
+ return str == "true";
+ }
+
+ private string[] readFileElements(XmlReader reader, string tag)
+ {
+ List<string> fileNames = new List<string>();
+ if (reader.ReadToFollowing(tag)) {
+ if (reader.ReadToDescendant("file")) {
+ do {
+ string fname = reader.ReadString();
+ fileNames.Add(fname);
+ } while (reader.ReadToNextSibling("file"));
+ }
+ }
+ return fileNames.ToArray();
+ }
+
+ private string shellQuote(string filePath)
+ {
+ return filePath.Contains(" ")
+ ? ('"' + filePath + '"')
+ : filePath;
+ }
+ }
+}
diff --git a/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2008.csproj b/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2008.csproj
index d6d49612..967e994f 100644
--- a/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2008.csproj
+++ b/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2008.csproj
@@ -2,7 +2,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21022</ProductVersion>
+ <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{459BD34A-235E-45D5-A1A7-D2AAE2F1D98D}</ProjectGuid>
<OutputType>Library</OutputType>
@@ -85,6 +85,7 @@
<Compile Include="FormVSQtSettings.Designer.cs">
<DependentUpon>FormVSQtSettings.cs</DependentUpon>
</Compile>
+ <Compile Include="QMakeWrapper.cs" />
<Compile Include="QtSettings.cs">
<SubType>Code</SubType>
</Compile>
@@ -150,14 +151,6 @@
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
- <COMReference Include="q5makewrapper1Lib">
- <Guid>{C9750D9B-554C-4828-AFDC-A8352E600344}</Guid>
- <VersionMajor>1</VersionMajor>
- <VersionMinor>0</VersionMinor>
- <Lcid>0</Lcid>
- <WrapperTool>tlbimp</WrapperTool>
- <Isolated>False</Isolated>
- </COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>
diff --git a/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2010.csproj b/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2010.csproj
index aeace630..52cb984c 100644
--- a/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2010.csproj
+++ b/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2010.csproj
@@ -108,6 +108,7 @@
<DependentUpon>FormVSQtSettings.cs</DependentUpon>
</Compile>
<Compile Include="QtDefaultEditorsHelper.cs" />
+ <Compile Include="QMakeWrapper.cs" />
<Compile Include="QtSettings.cs">
<SubType>Code</SubType>
</Compile>
@@ -171,15 +172,6 @@
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
- <COMReference Include="q5makewrapper1Lib">
- <Guid>{C9750D9B-554C-4828-AFDC-A8352E600344}</Guid>
- <VersionMajor>1</VersionMajor>
- <VersionMinor>0</VersionMinor>
- <Lcid>0</Lcid>
- <WrapperTool>tlbimp</WrapperTool>
- <Isolated>False</Isolated>
- <EmbedInteropTypes>True</EmbedInteropTypes>
- </COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>
@@ -243,4 +235,4 @@ if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)
<VisualStudio>
</VisualStudio>
</ProjectExtensions>
-</Project> \ No newline at end of file
+</Project>
diff --git a/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2012.csproj b/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2012.csproj
index 057c39a7..05c55408 100644
--- a/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2012.csproj
+++ b/Qt4VS2003/Qt4VSAddin/Qt5VSAddin2012.csproj
@@ -109,6 +109,7 @@
<Compile Include="FormVSQtSettings.Designer.cs">
<DependentUpon>FormVSQtSettings.cs</DependentUpon>
</Compile>
+ <Compile Include="QMakeWrapper.cs" />
<Compile Include="QtSettings.cs">
<SubType>Code</SubType>
</Compile>
@@ -172,15 +173,6 @@
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
- <COMReference Include="q5makewrapper1Lib">
- <Guid>{C9750D9B-554C-4828-AFDC-A8352E600344}</Guid>
- <VersionMajor>1</VersionMajor>
- <VersionMinor>0</VersionMinor>
- <Lcid>0</Lcid>
- <WrapperTool>tlbimp</WrapperTool>
- <Isolated>False</Isolated>
- <EmbedInteropTypes>True</EmbedInteropTypes>
- </COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>
@@ -244,4 +236,4 @@ if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)
<VisualStudio>
</VisualStudio>
</ProjectExtensions>
-</Project> \ No newline at end of file
+</Project>
diff --git a/Qt4VS2003/ComWrappers/QMake/evalhandler.cpp b/tools/qmakefilereader/evalhandler.cpp
index 573b601f..573b601f 100644
--- a/Qt4VS2003/ComWrappers/QMake/evalhandler.cpp
+++ b/tools/qmakefilereader/evalhandler.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/evalhandler.h b/tools/qmakefilereader/evalhandler.h
index 34719023..34719023 100644
--- a/Qt4VS2003/ComWrappers/QMake/evalhandler.h
+++ b/tools/qmakefilereader/evalhandler.h
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/README b/tools/qmakefilereader/evaluator/README
index 67994c5c..67994c5c 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/README
+++ b/tools/qmakefilereader/evaluator/README
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/ioutils.cpp b/tools/qmakefilereader/evaluator/ioutils.cpp
index 94d69a68..94d69a68 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/ioutils.cpp
+++ b/tools/qmakefilereader/evaluator/ioutils.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/ioutils.h b/tools/qmakefilereader/evaluator/ioutils.h
index 21fa32c3..21fa32c3 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/ioutils.h
+++ b/tools/qmakefilereader/evaluator/ioutils.h
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/proitems.cpp b/tools/qmakefilereader/evaluator/proitems.cpp
index 523a683f..523a683f 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/proitems.cpp
+++ b/tools/qmakefilereader/evaluator/proitems.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/proitems.h b/tools/qmakefilereader/evaluator/proitems.h
index cb6a7dfc..cb6a7dfc 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/proitems.h
+++ b/tools/qmakefilereader/evaluator/proitems.h
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmake_global.h b/tools/qmakefilereader/evaluator/qmake_global.h
index 3adf2e3b..3adf2e3b 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmake_global.h
+++ b/tools/qmakefilereader/evaluator/qmake_global.h
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakebuiltins.cpp b/tools/qmakefilereader/evaluator/qmakebuiltins.cpp
index bafa867f..bafa867f 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakebuiltins.cpp
+++ b/tools/qmakefilereader/evaluator/qmakebuiltins.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator.cpp b/tools/qmakefilereader/evaluator/qmakeevaluator.cpp
index 8f10066d..8f10066d 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator.cpp
+++ b/tools/qmakefilereader/evaluator/qmakeevaluator.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator.h b/tools/qmakefilereader/evaluator/qmakeevaluator.h
index 2284a671..2284a671 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator.h
+++ b/tools/qmakefilereader/evaluator/qmakeevaluator.h
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator_p.h b/tools/qmakefilereader/evaluator/qmakeevaluator_p.h
index e1cfc833..e1cfc833 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeevaluator_p.h
+++ b/tools/qmakefilereader/evaluator/qmakeevaluator_p.h
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeglobals.cpp b/tools/qmakefilereader/evaluator/qmakeglobals.cpp
index b1d79b07..b1d79b07 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeglobals.cpp
+++ b/tools/qmakefilereader/evaluator/qmakeglobals.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeglobals.h b/tools/qmakefilereader/evaluator/qmakeglobals.h
index 1e0be76e..1e0be76e 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeglobals.h
+++ b/tools/qmakefilereader/evaluator/qmakeglobals.h
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeparser.cpp b/tools/qmakefilereader/evaluator/qmakeparser.cpp
index 9bf716a8..9bf716a8 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeparser.cpp
+++ b/tools/qmakefilereader/evaluator/qmakeparser.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeparser.h b/tools/qmakefilereader/evaluator/qmakeparser.h
index 0bab5eea..0bab5eea 100644
--- a/Qt4VS2003/ComWrappers/QMake/evaluator/qmakeparser.h
+++ b/tools/qmakefilereader/evaluator/qmakeparser.h
diff --git a/Qt4VS2003/ComWrappers/QMake/demo.cpp b/tools/qmakefilereader/main.cpp
index 9297d20d..190a34db 100644
--- a/Qt4VS2003/ComWrappers/QMake/demo.cpp
+++ b/tools/qmakefilereader/main.cpp
@@ -40,37 +40,61 @@
****************************************************************************/
#include "qmakedataprovider.h"
-#include <QDebug>
+#include <QCoreApplication>
#include <QStringList>
#include <QFileInfo>
+#include <QXmlStreamWriter>
-void printList(const QString section, const QStringList values)
+QString toString(bool b)
{
- qDebug() << section;
- foreach(const QString i, values) {
- qDebug() << " *" << i;
- }
+ return b ? QStringLiteral("true") : QStringLiteral("false");
}
int main(int argc, char *argv[])
{
- if (argc < 2) {
- fputs("Please provide a filename as argument.\n", stderr);
+ if (argc < 3) {
+ fputs("Usage: qmakefilereader <QtDir> <filePath>\n", stderr);
return -1;
}
- QMakeDataProvider dataProvider;
- dataProvider.readFile(QFileInfo(QString::fromLocal8Bit(argv[1])).absoluteFilePath());
+ QCoreApplication app(argc, argv);
+ const QStringList args = app.arguments();
+ const QString qtDir = args.at(1);
+ const QString filePath = QFileInfo(args.at(2)).absoluteFilePath();
- qDebug() << "valid ==" << dataProvider.isValid();
- qDebug() << "flat ==" << dataProvider.isFlat();
- qDebug() << "";
+ QMakeDataProvider dataProvider;
+ dataProvider.setQtDir(qtDir);
+ if (!dataProvider.readFile(filePath))
+ return 1;
- printList("Source files", dataProvider.getSourceFiles());
- printList("Header files", dataProvider.getHeaderFiles());
- printList("Resource files", dataProvider.getResourceFiles());
- printList("Form files", dataProvider.getFormFiles());
+ QFile fout;
+ if (!fout.open(stdout, QFile::WriteOnly))
+ return 2;
+ QXmlStreamWriter stream(&fout);
+ stream.setAutoFormatting(true);
+ stream.writeStartDocument();
+ stream.writeStartElement("content");
+ stream.writeAttribute("valid", toString(dataProvider.isValid()));
+ stream.writeAttribute("flat", toString(dataProvider.isFlat()));
+ stream.writeStartElement("SOURCES");
+ foreach (const QString &str, dataProvider.getSourceFiles())
+ stream.writeTextElement("file", str);
+ stream.writeEndElement();
+ stream.writeStartElement("HEADERS");
+ foreach (const QString &str, dataProvider.getHeaderFiles())
+ stream.writeTextElement("file", str);
+ stream.writeEndElement();
+ stream.writeStartElement("RESOURCES");
+ foreach (const QString &str, dataProvider.getResourceFiles())
+ stream.writeTextElement("file", str);
+ stream.writeEndElement();
+ stream.writeStartElement("FORMS");
+ foreach (const QString &str, dataProvider.getFormFiles())
+ stream.writeTextElement("file", str);
+ stream.writeEndElement();
+ stream.writeEndElement(); // content
+ stream.writeEndDocument();
return 0;
}
diff --git a/Qt4VS2003/ComWrappers/QMake/qmakedataprovider.cpp b/tools/qmakefilereader/qmakedataprovider.cpp
index 5e6f2247..5e6f2247 100644
--- a/Qt4VS2003/ComWrappers/QMake/qmakedataprovider.cpp
+++ b/tools/qmakefilereader/qmakedataprovider.cpp
diff --git a/Qt4VS2003/ComWrappers/QMake/qmakedataprovider.h b/tools/qmakefilereader/qmakedataprovider.h
index dc6d7576..dc6d7576 100644
--- a/Qt4VS2003/ComWrappers/QMake/qmakedataprovider.h
+++ b/tools/qmakefilereader/qmakedataprovider.h
diff --git a/Qt4VS2003/ComWrappers/QMake/QMake.pri b/tools/qmakefilereader/qmakefilereader.pri
index 350c7703..350c7703 100644
--- a/Qt4VS2003/ComWrappers/QMake/QMake.pri
+++ b/tools/qmakefilereader/qmakefilereader.pri
diff --git a/tools/qmakefilereader/qmakefilereader.pro b/tools/qmakefilereader/qmakefilereader.pro
new file mode 100644
index 00000000..5aeb9b5b
--- /dev/null
+++ b/tools/qmakefilereader/qmakefilereader.pro
@@ -0,0 +1,16 @@
+QT -= gui
+CONFIG += console
+TARGET = qmakefilereader
+
+CONFIG(debug, debug|release) {
+ DESTDIR = ../../Qt4VS2003/Qt4VSAddin/Debug
+}
+
+CONFIG(release, debug|release) {
+ DESTDIR = ../../Qt4VS2003/Qt4VSAddin/Release
+}
+
+SOURCES += \
+ main.cpp
+
+include(qmakefilereader.pri)
diff --git a/tools/tools.pro b/tools/tools.pro
new file mode 100644
index 00000000..0c3c7fb7
--- /dev/null
+++ b/tools/tools.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ qmakefilereader \
+ qrceditor
+