Fix WinRT manifest for Visual Studio.

Visual Studio does not like empty dependencies block in manifest XML.
At least my Visual Studio 2013 fails to open visual manifest editor for
XML containing the following block:

    <Dependencies>
    </Dependencies>

If the block is removed or if the block has one or more PackageDependency
entries the editor accepts it.

Moved the <Dependencies> block to prf, so that it is only written when
project really has dependencies. Also <Capabilities> block is moved to prf
for consistency. On Windows Phone, where the <Capabilities> block is
required, it is kept in the output even if it is empty.

Change-Id: I531180d0081e4612f75be54f3813831857f1ed43
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Janne Anttila 2014-02-25 10:19:10 +02:00 committed by The Qt Project
parent 0e69c94222
commit e07684294d
4 changed files with 21 additions and 14 deletions

View File

@ -32,8 +32,6 @@
<SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />
</VisualElements>
</Application>
</Applications>
<Capabilities>$${WINRT_MANIFEST.capabilities}</Capabilities>
<Dependencies>$${WINRT_MANIFEST.dependencies}</Dependencies>
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
</Package>
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. -->

View File

@ -11,8 +11,7 @@
Description=\"$${WINRT_MANIFEST.description}\"
Publisher=\"$${WINRT_MANIFEST.publisher}\"
PublisherID=\"$${WINRT_MANIFEST.publisherid}\">
<IconPath IsRelative=\"true\" IsResource=\"false\">$${WINRT_MANIFEST.logo_medium}</IconPath>
<Capabilities>$${WINRT_MANIFEST.capabilities}</Capabilities>
<IconPath IsRelative=\"true\" IsResource=\"false\">$${WINRT_MANIFEST.logo_medium}</IconPath>$${WINRT_MANIFEST.capabilities}
<Tasks>
<DefaultTask
Name=\"_default\"

View File

@ -37,8 +37,6 @@
<v2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />
</v2:VisualElements>
</Application>
</Applications>
<Capabilities>$${WINRT_MANIFEST.capabilities}</Capabilities>
<Dependencies>$${WINRT_MANIFEST.dependencies}</Dependencies>
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
</Package>
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. -->

View File

@ -92,16 +92,28 @@
winphone: INDENT = "$$escape_expand(\\r\\n) "
else: INDENT = "$$escape_expand(\\r\\n) "
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
for(CAPABILITY, WINRT_MANIFEST.capabilities): \
MANIFEST_CAPABILITIES += " <Capability Name=\"$$CAPABILITY\" />"
WINRT_MANIFEST.capabilities = $$join(MANIFEST_CAPABILITIES, $$INDENT, $$INDENT, $$INDENT)
!isEmpty(WINRT_MANIFEST.capabilities)|winphone {
MANIFEST_CAPABILITIES += "<Capabilities>"
for(CAPABILITY, WINRT_MANIFEST.capabilities): \
MANIFEST_CAPABILITIES += " <Capability Name=\"$$CAPABILITY\" />"
MANIFEST_CAPABILITIES += "</Capabilities>"
WINRT_MANIFEST.capabilities = $$join(MANIFEST_CAPABILITIES, $$INDENT, $$INDENT)
}
# Dependencies are given as a string list. The CRT dependency is added automatically above.
WINRT_MANIFEST.dependencies = $$unique(WINRT_MANIFEST.dependencies)
for(DEPENDENCY, WINRT_MANIFEST.dependencies): \
MANIFEST_DEPENDENCIES += " <PackageDependency Name=\"$$DEPENDENCY\" />"
WINRT_MANIFEST.dependencies = $$join(MANIFEST_DEPENDENCIES, $$INDENT, $$INDENT, $$INDENT)
!isEmpty(WINRT_MANIFEST.dependencies) {
MANIFEST_DEPENDENCIES += "<Dependencies>"
for(DEPENDENCY, WINRT_MANIFEST.dependencies): \
MANIFEST_DEPENDENCIES += " <PackageDependency Name=\"$$DEPENDENCY\" />"
MANIFEST_DEPENDENCIES += "</Dependencies>"
WINRT_MANIFEST.dependencies = $$join(MANIFEST_DEPENDENCIES, $$INDENT, $$INDENT)
}
# Provide default icons where needed
isEmpty(WINRT_ASSETS_PATH): WINRT_ASSETS_PATH = $$[QT_HOST_DATA/get]/mkspecs/common/winrt_winphone/assets