diff options
author | Miguel Costa <miguel.costa@qt.io> | 2020-08-16 15:33:46 +0200 |
---|---|---|
committer | Miguel Costa <miguel.costa@qt.io> | 2020-08-17 08:24:21 +0000 |
commit | 367c8abdca02e45d693d7303fe9e9f83cdce74f3 (patch) | |
tree | e75219d0a0fa9a4fecd19059c9becc931ae4c284 | |
parent | 8b1ca8c4a50bb4cab92c6f4f7d232a3d02247b7f (diff) |
Integrate windeployqt with Qt/MSBuild
The Qt for Windows deployment tool (windeployqt) can now be executed at
the end of a project build. This feature is disabled by default. To
enable it a corresponding flag property must be set in the Qt build
settings property page for the project. A dedicated property page for
windeployqt options will then become available. During the build, after
linking is complete, windeployqt will be called with the options
specified in its property page.
Task-number: QTVSADDINBUG-578
Change-Id: I922ad0e20e899d7ea0c3da2ce65e918e47a98f25
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | src/qtmsbuild/deploy/qtdeploy.props | 33 | ||||
-rw-r--r-- | src/qtmsbuild/deploy/qtdeploy.targets | 311 | ||||
-rw-r--r-- | src/qtmsbuild/deploy/qtdeploy.xml | 366 | ||||
-rw-r--r-- | src/qtmsbuild/qt_settings.xml | 5 | ||||
-rw-r--r-- | src/qtvstools/QtVsTools.csproj | 6 | ||||
-rw-r--r-- | src/qtwizard/Wizards/ProjectWizard/ProjectTemplateWizard.cs | 4 |
6 files changed, 701 insertions, 24 deletions
diff --git a/src/qtmsbuild/deploy/qtdeploy.props b/src/qtmsbuild/deploy/qtdeploy.props index 2b0eab88..35c63a9b 100644 --- a/src/qtmsbuild/deploy/qtdeploy.props +++ b/src/qtmsbuild/deploy/qtdeploy.props @@ -37,4 +37,37 @@ <PropertyGroup> <QtDeploy Condition="'$(QtDeploy)' == ''">false</QtDeploy> </PropertyGroup> + <ItemDefinitionGroup> + <QtDeploy> + <QtDeployFiles>$(TargetPath)</QtDeployFiles> + <QtDeployDir Condition="'$(QtDeployToProjectDir)' == 'true'">$(ProjectDir)</QtDeployDir> + <QtDeployDir Condition="'$(QtDeployToProjectDir)' != 'true'">$(OutDir)</QtDeployDir> + <QtDeployLibDir/> + <QtDeployPluginDir/> + <QtDeployDebugRelease>false</QtDeployDebugRelease> + <QtDeployPdb>false</QtDeployPdb> + <QtDeployForce>false</QtDeployForce> + <QtDeployNoPatchQt>false</QtDeployNoPatchQt> + <QtDeployNoPlugins>false</QtDeployNoPlugins> + <QtDeployNoLibraries>false</QtDeployNoLibraries> + <QtDeployQmlDir/> + <QtDeployQmlImport/> + <QtDeployNoQuickImport>false</QtDeployNoQuickImport> + <QtDeployNoTranslations>false</QtDeployNoTranslations> + <QtDeployNoSystemD3dCompiler>false</QtDeployNoSystemD3dCompiler> + <QtDeployNoVirtualKeyboard>false</QtDeployNoVirtualKeyboard> + <QtDeployCompilerRuntime>false</QtDeployCompilerRuntime> + <QtDeployWebkit2>false</QtDeployWebkit2> + <QtDeployAngle>false</QtDeployAngle> + <QtDeployNoOpenglSw>false</QtDeployNoOpenglSw> + <QtDeployIncludeModules/> + <QtDeployExcludeModules/> + <QtDeployVerbose>false</QtDeployVerbose> + <QtDeployVsContent Condition="'$(QtDeployVsContent)' == 'true'">true</QtDeployVsContent> + <QtDeployVsContent Condition="'$(QtDeployVsContent)' != 'true'">false</QtDeployVsContent> + </QtDeploy> + </ItemDefinitionGroup> + <ItemGroup Condition="'$(QtDeploy)' == 'true'"> + <ProjectTools Include="QtDeploy"/> + </ItemGroup> </Project> diff --git a/src/qtmsbuild/deploy/qtdeploy.targets b/src/qtmsbuild/deploy/qtdeploy.targets index dc8e09e6..530419b9 100644 --- a/src/qtmsbuild/deploy/qtdeploy.targets +++ b/src/qtmsbuild/deploy/qtdeploy.targets @@ -37,41 +37,306 @@ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////// + // Setup property page + // --> + <ItemGroup> + <PropertyPageSchema + Include="$(MSBuildThisFileDirectory)qtdeploy.xml" /> + </ItemGroup> + + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////////// + // Default deploy log location + // --> + <PropertyGroup> + <QtDeployLog Condition="'$(QtDeployLog)' == ''">$(IntDir)windeployqt.log</QtDeployLog> + </PropertyGroup> + + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////////// + // Schedule QtDeploy target to run after Link + // --> + <PropertyGroup Condition="'$(QtDeploy)' == 'true' AND '$(ApplicationType)' != 'Linux'"> + <BuildLinkTargets>$(BuildLinkTargets);QtDeploy</BuildLinkTargets> + </PropertyGroup> + + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////////// // Deploy Qt files // --> <Target Name="QtDeploy" AfterTargets="Link" - DependsOnTargets="QtRunDeploy" - Condition="'$(QtDeploy)' == 'true'"> - <ReadLinesFromFile File="$(TargetName).windeployqt.$(Platform).$(Configuration)"> - <Output TaskParameter="Lines" ItemName="DeploymentItems" /> + Inputs="$(TargetPath)" Outputs="$(QtDeployLog)" + Condition="'$(QtDeploy)' == 'true' AND '$(ApplicationType)' != 'Linux'"> + + <ItemGroup> + <QtDeploy Include="$(TargetPath)"/> + </ItemGroup> + + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Convert string lists in source item properties to lists of items + // --> + <Flatten Items="@(QtDeploy)" + Metadata="QtDeployFiles; + QtDeployDir; + QtDeployLibDir; + QtDeployPluginDir; + QtDeployDebugRelease; + QtDeployPdb; + QtDeployForce; + QtDeployNoPatchQt; + QtDeployNoPlugins; + QtDeployNoLibraries; + QtDeployQmlDir; + QtDeployQmlImport; + QtDeployNoQuickImport; + QtDeployNoTranslations; + QtDeployNoSystemD3dCompiler; + QtDeployNoVirtualKeyboard; + QtDeployCompilerRuntime; + QtDeployWebkit2; + QtDeployAngle; + QtDeployNoOpenglSw; + QtDeployIncludeModules; + QtDeployExcludeModules; + QtDeployVerbose"> + <Output + TaskParameter="Result" ItemName="Options" /> + </Flatten> + + <ItemGroup> + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////// + // Remove quotes from all paths + // --> + <Options> + <Value Condition="( '%(Name)' == 'QtDeployFiles' + OR '%(Name)' == 'QtDeployDir' + OR '%(Name)' == 'QtDeployLibDir' + OR '%(Name)' == 'QtDeployPluginDir' + OR '%(Name)' == 'QtDeployQmlDir' + OR '%(Name)' == 'QtDeployQmlImport' )" + >$([System.String]::Copy('%(Value)').Replace('"', ''))</Value> + </Options> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////// + // Escape trailing back-slash in paths + // --> + <Options> + <Value Condition="( '%(Name)' == 'QtDeployFiles' + OR '%(Name)' == 'QtDeployDir' + OR '%(Name)' == 'QtDeployLibDir' + OR '%(Name)' == 'QtDeployPluginDir' + OR '%(Name)' == 'QtDeployQmlDir' + OR '%(Name)' == 'QtDeployQmlImport' ) + AND $([System.String]::Copy('%(Value)').Contains(' ')) + AND $([System.String]::Copy('%(Value)').EndsWith('\'))" + >%(Value)\</Value> + </Options> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////// + // Add quotes to paths containing spaces + // --> + <Options> + <Value Condition="( '%(Name)' == 'QtDeployFiles' + OR '%(Name)' == 'QtDeployDir' + OR '%(Name)' == 'QtDeployLibDir' + OR '%(Name)' == 'QtDeployPluginDir' + OR '%(Name)' == 'QtDeployQmlDir' + OR '%(Name)' == 'QtDeployQmlImport' ) + AND $([System.String]::Copy('%(Value)').Contains(' '))" + >"%(Value)"</Value> + </Options> + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////// + // Generate tool command line arguments + // --> + <Options> + <!-- [files] Binaries or directory containing the binary. --> + <PosArg Condition="'%(Name)' == 'QtDeployFiles'">%(Value)</PosArg> + </Options> + <Options> + <!-- -dir <directory> Use directory instead of binary directory. --> + <Arg Condition="'%(Name)' == 'QtDeployDir'">--dir %(Value)</Arg> + </Options> + <Options> + <!-- -libdir <path> Copy libraries to path. --> + <Arg Condition="'%(Name)' == 'QtDeployLibDir'">--libdir %(Value)</Arg> + </Options> + <Options> + <!-- -plugindir <path> Copy plugins to path. --> + <Arg Condition="'%(Name)' == 'QtDeployPluginDir'">--plugindir %(Value)</Arg> + </Options> + <Options> + <!-- -debug Assume debug binaries. + -release Assume release binaries.--> + <Arg Condition="'%(Name)' == 'QtDeployDebugRelease' AND '%(Value)' == 'debug'" + >--debug</Arg> + <Arg Condition="'%(Name)' == 'QtDeployDebugRelease' AND '%(Value)' == 'release'" + >--release</Arg> + </Options> + <Options> + <!-- -pdb Deploy .pdb files (MSVC). --> + <Arg Condition="'%(Name)' == 'QtDeployPdb' AND '%(Value)' == 'true'" + >--pdb</Arg> + </Options> + <Options> + <!-- -force Force updating files. --> + <Arg Condition="'%(Name)' == 'QtDeployForce' AND '%(Value)' == 'true'" + >--force</Arg> + </Options> + <Options> + <!-- -no-patchqt Do not patch the Qt5Core library. --> + <Arg Condition="'%(Name)' == 'QtDeployNoPatchQt' AND '%(Value)' == 'true'" + >--no-patchqt</Arg> + </Options> + <Options> + <!-- -no-plugins Skip plugin deployment. --> + <Arg Condition="'%(Name)' == 'QtDeployNoPlugins' AND '%(Value)' == 'true'" + >--no-plugins</Arg> + </Options> + <Options> + <!-- -no-libraries Skip library deployment. --> + <Arg Condition="'%(Name)' == 'QtDeployNoLibraries' AND '%(Value)' == 'true'" + >--no-libraries</Arg> + </Options> + <Options> + <!-- -qmldir <directory> Scan for QML-imports starting from directory. --> + <Arg Condition="'%(Name)' == 'QtDeployQmlDir'">--qmldir %(Value)</Arg> + </Options> + <Options> + <!-- -qmlimport <directory> Add the given path to the QML module search + locations. --> + <Arg Condition="'%(Name)' == 'QtDeployQmlImport'">--qmlimport %(Value)</Arg> + </Options> + <Options> + <!-- -no-quick-import Skip deployment of Qt Quick imports. --> + <Arg Condition="'%(Name)' == 'QtDeployNoQuickImport' AND '%(Value)' == 'true'" + >--no-quick-import</Arg> + </Options> + <Options> + <!-- -no-translations Skip deployment of translations. --> + <Arg Condition="'%(Name)' == 'QtDeployNoTranslations' AND '%(Value)' == 'true'" + >--no-translations</Arg> + </Options> + <Options> + <!-- -no-system-d3d-compiler Skip deployment of the system D3D compiler. --> + <Arg Condition="'%(Name)' == 'QtDeployNoSystemD3dCompiler' AND '%(Value)' == 'true'" + >--no-system-d3d-compiler</Arg> + </Options> + <Options> + <!-- -no-virtualkeyboard Disable deployment of the Virtual Keyboard. --> + <Arg Condition="'%(Name)' == 'QtDeployNoVirtualKeyboard' AND '%(Value)' == 'true'" + >--no-virtualkeyboard</Arg> + </Options> + <Options> + <!-- -compiler-runtime Deploy compiler runtime (Desktop only). + -no-compiler-runtime Do not deploy compiler runtime (Desktop only). --> + <Arg Condition="'%(Name)' == 'QtDeployCompilerRuntime' AND '%(Value)' == 'deploy'" + >--compiler-runtime</Arg> + <Arg Condition="'%(Name)' == 'QtDeployCompilerRuntime' AND '%(Value)' == 'skip'" + >--no-compiler-runtime</Arg> + </Options> + <Options> + <!-- -webkit2 Deployment of WebKit2 (web process). + -no-webkit2 Skip deployment of WebKit2. --> + <Arg Condition="'%(Name)' == 'QtDeployWebkit2' AND '%(Value)' == 'deploy'" + >--webkit2</Arg> + <Arg Condition="'%(Name)' == 'QtDeployWebkit2' AND '%(Value)' == 'skip'" + >--no-webkit2</Arg> + </Options> + <Options> + <!-- -angle Force deployment of ANGLE. + -no-angle Disable deployment of ANGLE. --> + <Arg Condition="'%(Name)' == 'QtDeployAngle' AND '%(Value)' == 'deploy'" + >--angle</Arg> + <Arg Condition="'%(Name)' == 'QtDeployAngle' AND '%(Value)' == 'skip'" + >--no-angle</Arg> + </Options> + <Options> + <!-- -no-opengl-sw Do not deploy the software rasterizer library. --> + <Arg Condition="'%(Name)' == 'QtDeployNoOpenglSw' AND '%(Value)' == 'true'" + >--no-opengl-sw</Arg> + </Options> + <Options> + <!-- Qt libraries can be added by passing their name (-xml) ... --> + <Arg Condition="'%(Name)' == 'QtDeployIncludeModules'">-%(Value)</Arg> + </Options> + <Options> + <!-- ... or removed by passing the name prepended by -no- (-no-xml). --> + <Arg Condition="'%(Name)' == 'QtDeployExcludeModules'">--no-%(Value)</Arg> + </Options> + </ItemGroup> + + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Run windeployqt + // --> + <PropertyGroup> + <Cmd><![CDATA["$(QtToolsPath)\windeployqt.exe"]]></Cmd> + <Cmd>$(Cmd) --list target</Cmd> + <Cmd Condition="'%(Options.Arg)' != ''">$(Cmd) %(Options.Arg)</Cmd> + <Cmd Condition="'%(Options.PosArg)' != ''">$(Cmd) %(Options.PosArg)</Cmd> + </PropertyGroup> + <Message Importance="high" Text="windeployqt: $(Cmd)" /> + <Exec Command="$(Cmd) > "$(QtDeployLog)"" /> + + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Read deploy log into QtDeployed list + // --> + <ReadLinesFromFile File="$(QtDeployLog)"> + <Output TaskParameter="Lines" ItemName="QtDeployed" /> </ReadLinesFromFile> <ItemGroup> - <None Include="@(DeploymentItems)"> + <QtDeployed Remove="@(QtDeployed)" Condition="!Exists('%(Fullpath)')"/> + </ItemGroup> + + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Mark deployed files as source content for VS deployment project + // --> + <ItemGroup> + <None Include="@(QtDeployed)" Condition="'%(QtDeploy.QtDeployVsContent)' == 'true'"> <DeploymentContent>true</DeploymentContent> <RootFolder>$(ProjectDir)</RootFolder> </None> </ItemGroup> - </Target> - <!-- - ///////////////////////////////////////////////////////////////////////////////////////////////// - // Call windeployqt - // --> - <Target Name="QtRunDeploy" - Inputs="$(OutDir)\$(TargetName).exe" - Outputs="$(TargetName).windeployqt.$(Platform).$(Configuration)" - Condition="'$(QtDeploy)' == 'true'"> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Log output files; used by VS on clean and up-to-date check + // --> + <ItemGroup> + <QtDeployLog Include="$(QtDeployLog)"/> + <QtDeployed Include="$(QtDeployLog)"/> + </ItemGroup> + <WriteLinesToFile + File="$(TLogLocation)windeployqt.read.1u.tlog" + Lines="^$(ProjectPath)" + Overwrite="true" Encoding="Unicode"/> + <WriteLinesToFile + File="$(TLogLocation)windeployqt.write.1u.tlog" + Lines="^$(ProjectPath);@(QtDeployLog->'%(Fullpath)')" + Overwrite="true" Encoding="Unicode"/> + <WriteLinesToFile + File="$(TLogLocation)$(ProjectName).write.1u.tlog" + Lines="^$(ProjectFileName);@(QtDeployed->'%(Fullpath)')" + Overwrite="false" Encoding="Unicode"/> + + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Clean-up + // --> <PropertyGroup> - <Cmd>$(QTDIR)\bin\windeployqt.exe</Cmd> - <Cmd>$(Cmd) -qmldir "$(MSBuildProjectDirectory)"</Cmd> - <Cmd>$(Cmd) -list relative</Cmd> - <Cmd>$(Cmd) -dir "$(MSBuildProjectDirectory)"</Cmd> - <Cmd>$(Cmd) "$(OutDir)\$(TargetName).exe"</Cmd> - <Cmd>$(Cmd) > "$(TargetName).windeployqt.$(Platform).$(Configuration)"</Cmd> + <Cmd/> </PropertyGroup> - <Message Importance="high" Text="windeployqt: $(Cmd)" /> - <Exec Command="$(Cmd)" /> + <ItemGroup> + <Options Remove="@(Options)"/> + <QtDeploy Remove="@(QtDeploy)"/> + <QtDeployLog Remove="@(QtDeployLog)"/> + <QtDeployed Remove="@(QtDeployed)"/> + </ItemGroup> </Target> - </Project> diff --git a/src/qtmsbuild/deploy/qtdeploy.xml b/src/qtmsbuild/deploy/qtdeploy.xml new file mode 100644 index 00000000..036d7c52 --- /dev/null +++ b/src/qtmsbuild/deploy/qtdeploy.xml @@ -0,0 +1,366 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt VS Tools. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> + +<!-- +/////////////////////////////////////////////////////////////////////////////////////////////////// +// windeployqt Property Page +// +// --> +<ProjectSchemaDefinitions + xmlns="http://schemas.microsoft.com/build/2009/properties" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:sys="clr-namespace:System;assembly=mscorlib"> + <Rule + Name="QtRule70_Deploy" + PageTemplate="tool" + DisplayName="Qt Deploy Tool" + Order="999"> + <Rule.DataSource> + <DataSource + Persistence="UserFile" + ItemType="QtDeploy" + HasConfigurationCondition="true"/> + </Rule.DataSource> + <Rule.Categories> + <Category Name="General" DisplayName="windeployqt"/> + </Rule.Categories> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Application Binary + // --> + <StringListProperty + Name="QtDeployFiles" DisplayName="Application Binary"> + <StringListProperty.Description> + <sys:String> + <![CDATA[Binaries or directory containing the application binary ( [files] ).]]> + </sys:String> + </StringListProperty.Description> + </StringListProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Deployment Directory + // --> + <StringProperty + Name="QtDeployDir" DisplayName="Deployment Directory"> + <StringProperty.Description> + <sys:String> + <![CDATA[Use directory instead of binary directory ( --dir <directory> ).]]> + </sys:String> + </StringProperty.Description> + </StringProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Library Directory + // --> + <StringProperty + Name="QtDeployLibDir" DisplayName="Library Directory"> + <StringProperty.Description> + <sys:String> + <![CDATA[Copy libraries to path ( --libdir <path> ).]]> + </sys:String> + </StringProperty.Description> + </StringProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Plugin Directory + // --> + <StringProperty + Name="QtDeployPluginDir" DisplayName="Plugin Directory"> + <StringProperty.Description> + <sys:String> + <![CDATA[Copy plugins to path ( --plugindir <path> ).]]> + </sys:String> + </StringProperty.Description> + </StringProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Debug/Release Binaries + // --> + <EnumProperty + Name="QtDeployDebugRelease" DisplayName="Debug/Release Binaries"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Assume debug or release binaries ( --debug | --release ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Default"/> + <EnumValue Name="debug" DisplayName="Debug ( --debug )"/> + <EnumValue Name="release" DisplayName="Release ( --release )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Deploy PDB Files + // --> + <EnumProperty + Name="QtDeployPdb" DisplayName="Deploy PDB Files"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Deploy .pdb files (MSVC) ( --pdb ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --pdb )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // + // --> + <EnumProperty + Name="QtDeployForce" DisplayName="Force Update"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Force updating files ( --force ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --force )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Qt5Core Patch + // --> + <EnumProperty + Name="QtDeployNoPatchQt" DisplayName="Skip Qt5Core Patch"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Do not patch the Qt5Core library ( --no-patchqt ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-patchqt )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Plugins + // --> + <EnumProperty + Name="QtDeployNoPlugins" DisplayName="Skip Plugins"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Skip plugin deployment ( --no-plugins ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-plugins )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Libraries + // --> + <EnumProperty + Name="QtDeployNoLibraries" DisplayName="Skip Libraries"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Skip library deployment ( --no-libraries ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-libraries )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // QML Directories Root + // --> + <StringProperty + Name="QtDeployQmlDir" DisplayName="QML Directories Root"> + <StringProperty.Description> + <sys:String> + <![CDATA[Scan for QML-imports starting from directory ( --qmldir <directory> ).]]> + </sys:String> + </StringProperty.Description> + </StringProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // QML Modules Path + // --> + <StringListProperty + Name="QtDeployQmlImport" DisplayName="QML Modules Path"> + <StringListProperty.Description> + <sys:String> + <![CDATA[Add the given path to the QML module search locations ( --qmlimport <directory> ).]]> + </sys:String> + </StringListProperty.Description> + </StringListProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Qt Quick Imports + // --> + <EnumProperty + Name="QtDeployNoQuickImport" DisplayName="Skip Qt Quick Imports"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Skip deployment of Qt Quick imports ( --no-quick-import ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-quick-import )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Translations + // --> + <EnumProperty + Name="QtDeployNoTranslations" DisplayName="Skip Translations"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Skip deployment of translations ( --no-translations ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-translations )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Direct3D Compiler + // --> + <EnumProperty + Name="QtDeployNoSystemD3dCompiler" DisplayName="Skip Direct3D Compiler"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Skip deployment of the system D3D compiler ( --no-system-d3d-compiler ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-system-d3d-compiler )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Virtual Keyboard + // --> + <EnumProperty + Name="QtDeployNoVirtualKeyboard" DisplayName="Skip Virtual Keyboard"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Disable deployment of the Virtual Keyboard ( --no-virtualkeyboard ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-virtualkeyboard )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Compiler Runtime + // --> + <EnumProperty + Name="QtDeployCompilerRuntime" DisplayName="Compiler Runtime"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Deploy compiler runtime (Desktop only).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Default"/> + <EnumValue Name="deploy" DisplayName="Deploy ( --compiler-runtime )"/> + <EnumValue Name="skip" DisplayName="Do Not Deploy ( --no-compiler-runtime )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // WebKit2 Deployment + // --> + <EnumProperty + Name="QtDeployWebkit2" DisplayName="WebKit2 Deployment"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Deployment of WebKit2 (web process).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Default"/> + <EnumValue Name="deploy" DisplayName="Deploy ( --webkit2 )"/> + <EnumValue Name="skip" DisplayName="Do Not Deploy ( --no-webkit2 )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // ANGLE Deployment + // --> + <EnumProperty + Name="QtDeployAngle" DisplayName="ANGLE Deployment"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Deployment of ANGLE.]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Default"/> + <EnumValue Name="deploy" DisplayName="Deploy ( --angle )"/> + <EnumValue Name="skip" DisplayName="Do Not Deploy ( --no-angle )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Skip Rasterizer Library + // --> + <EnumProperty + Name="QtDeployNoOpenglSw" DisplayName="Skip Rasterizer Library"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Do not deploy the software rasterizer library ( --no-opengl-sw ).]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enabled ( --no-opengl-sw )"/> + </EnumProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Include Qt Libraries + // --> + <StringListProperty + Name="QtDeployIncludeModules" DisplayName="Include Qt Libraries"> + <StringListProperty.Description> + <sys:String> + <![CDATA[Qt libraries can be added by passing their name ( -<name> ).]]> + </sys:String> + </StringListProperty.Description> + </StringListProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Exclude Qt Libraries + // --> + <StringListProperty + Name="QtDeployExcludeModules" DisplayName="Exclude Qt Libraries"> + <StringListProperty.Description> + <sys:String> + <![CDATA[Qt libraries can be removed by passing their prepended by --no- ( --no-<name> ).]]> + </sys:String> + </StringListProperty.Description> + </StringListProperty> + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// + // Set As Solution Deployment Content + // --> + <EnumProperty + Name="QtDeployVsContent" DisplayName="Set As Solution Deployment Content"> + <EnumProperty.Description> + <sys:String> + <![CDATA[Mark deployed files as solution deployment content.]]> + </sys:String> + </EnumProperty.Description> + <EnumValue Name="false" DisplayName="Disabled"/> + <EnumValue Name="true" DisplayName="Enable"/> + </EnumProperty> + </Rule> +</ProjectSchemaDefinitions> diff --git a/src/qtmsbuild/qt_settings.xml b/src/qtmsbuild/qt_settings.xml index aeee4371..e8b53546 100644 --- a/src/qtmsbuild/qt_settings.xml +++ b/src/qtmsbuild/qt_settings.xml @@ -84,6 +84,11 @@ <EnumValue Name="debug" DisplayName="Debug"/> <EnumValue Name="release" DisplayName="Release"/> </EnumProperty> + <BoolProperty + Name="QtDeploy" + Category="QtSettings_01_General" + DisplayName="Run Deployment Tool" + Description="Select whether Qt for Windows Deployment Tool (windeployqt) should be called after build."/> <StringProperty Name="QtPathBinaries" Category="QtSettings_02_Paths" diff --git a/src/qtvstools/QtVsTools.csproj b/src/qtvstools/QtVsTools.csproj index 02bb726d..d4230ddb 100644 --- a/src/qtvstools/QtVsTools.csproj +++ b/src/qtvstools/QtVsTools.csproj @@ -861,6 +861,12 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> <IncludeInVSIX>true</IncludeInVSIX> </Content> + <Content Include="..\qtmsbuild\deploy\qtdeploy.xml"> + <Link>QtMsBuild\deploy\qtdeploy.xml</Link> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + <IncludeInVSIX>true</IncludeInVSIX> + <SubType>Designer</SubType> + </Content> </ItemGroup> <Target Name="CheckT4Templates" BeforeTargets="Build" Inputs="%(T4Template.FullPath);%(T4Template.DependsOn)" Outputs="@(T4Template->'%(OutputFile)')"> <Error Text="T4 template '%(T4Template.FullPath)' out-of-date; update by selecting "Build" > "Transform All T4 Templates"" /> diff --git a/src/qtwizard/Wizards/ProjectWizard/ProjectTemplateWizard.cs b/src/qtwizard/Wizards/ProjectWizard/ProjectTemplateWizard.cs index cf1d5466..ad3a9469 100644 --- a/src/qtwizard/Wizards/ProjectWizard/ProjectTemplateWizard.cs +++ b/src/qtwizard/Wizards/ProjectWizard/ProjectTemplateWizard.cs @@ -470,7 +470,9 @@ namespace QtVsTools.Wizards.ProjectWizard /*{4}*/ c.IsDebug ? "debug" : "release")); if (c.Target.EqualTo(ProjectTargets.WindowsStore)) { xml.AppendLine(@" - <QtDeploy>true</QtDeploy>"); + <QtDeploy>true</QtDeploy> + <QtDeployToProjectDir>true</QtDeployToProjectDir> + <QtDeployVsContent>true</QtDeployVsContent>"); } xml.AppendLine(@" </PropertyGroup>"); |