Enhance the VSIX package creation tool to better support Visual Studio 2013.

FossilOrigin-Name: c1fb04f61eb74d80d1b7607ae6904fe2e1717988
This commit is contained in:
mistachkin 2014-05-06 21:26:34 +00:00
parent 7dd9fb65e2
commit 441aa095ed
3 changed files with 150 additions and 63 deletions

View File

@ -1,5 +1,5 @@
C When\sbuilding\sfor\sWindows\s8.0\susing\sVisual\sStudio\s2013,\smake\ssure\sthe\scross-compilation\snative\slibrary\spath\sis\sset\scorrectly.
D 2014-05-05T22:43:17.621
C Enhance\sthe\sVSIX\spackage\screation\stool\sto\sbetter\ssupport\sVisual\sStudio\s2013.
D 2014-05-06T21:26:34.436
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -1140,7 +1140,7 @@ F tool/mksqlite3c-noext.tcl 1712d3d71256ca1f297046619c89e77a4d7c8f6d
F tool/mksqlite3c.tcl ba274df71f5e6534b0a913c7c48eabfcbd0934b6
F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12
F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1
F tool/mkvsix.tcl 6477fb9dab838b7eea1eed50658ff1cda04850b5
F tool/mkvsix.tcl 924dcdecda86969686833301c08f84cca2600d94
F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97
F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
@ -1168,7 +1168,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 9a06773acc181e981f61f476a8e56417b98beba9
R e91b1cf1dddb5793408fd6de2be74034
P c1ab9092e29bc9d172c1f1a3becbcc83b79f2080
R a58107e75319df920bcb764f3109ea62
U mistachkin
Z b713eaa9517cf3b104e3dc82bdd65124
Z 469c7a319e5e989d73df4c062d995fca

View File

@ -1 +1 @@
c1ab9092e29bc9d172c1f1a3becbcc83b79f2080
c1fb04f61eb74d80d1b7607ae6904fe2e1717988

View File

@ -65,12 +65,15 @@
# argument is optional and if present must contain the name of the directory
# containing the root of the source tree for SQLite. The third argument is
# optional and if present must contain the flavor the VSIX package to build.
# Currently, the only supported package flavors are "WinRT", "WinRT81", and
# "WP80". The fourth argument is optional and if present must be a string
# containing a list of platforms to include in the VSIX package. The format
# of the platform list string is "platform1,platform2,platform3". Typically,
# when on Windows, this script is executed using commands similar to the
# following from a normal Windows command prompt:
# Currently, the only supported package flavors are "WinRT", "WinRT81", "WP80",
# and "Win32". The fourth argument is optional and if present must be a string
# containing a list of platforms to include in the VSIX package. The platform
# list is "platform1,platform2,platform3". The fifth argument is optional and
# if present must contain the version of Visual Studio required by the package.
# Currently, the only supported versions are "2012" and "2013". The package
# flavor "WinRT81" is only supported when the Visual Studio version is "2013".
# Typically, when on Windows, this script is executed using commands similar to
# the following from a normal Windows command prompt:
#
# CD /D C:\dev\sqlite\core
# tclsh85 tool\mkvsix.tcl C:\Temp
@ -100,7 +103,7 @@ proc fail { {error ""} {usage false} } {
puts stdout "usage:\
[file tail [info nameofexecutable]]\
[file tail [info script]] <binaryDirectory> \[sourceDirectory\]\
\[packageFlavor\] \[platformNames\]"
\[packageFlavor\] \[platformNames\] \[vsVersion\]"
exit 1
}
@ -170,13 +173,49 @@ proc writeFile { fileName data } {
return ""
}
proc substFile { fileName } {
proc getMinVsVersionXmlChunk { vsVersion } {
switch -exact $vsVersion {
2012 {
return [appendArgs \
"\r\n " {MinVSVersion="11.0"}]
}
2013 {
return [appendArgs \
"\r\n " {MinVSVersion="12.0"}]
}
default {
return ""
}
}
}
proc getExtraFileListXmlChunk { packageFlavor vsVersion } {
#
# NOTE: Performs all Tcl command, variable, and backslash substitutions in
# the specified file and then rewrites the contents of that same file
# with the substituted data.
# NOTE: Windows Phone 8.0 does not require any extra attributes in its VSIX
# package SDK manifests.
#
return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]]
if {[string equal $packageFlavor WP80]} then {
return ""
}
set appliesTo [expr {[string equal $packageFlavor Win32] ? \
"VisualC" : "WindowsAppContainer"}]
switch -exact $vsVersion {
2012 {
return [appendArgs \
"\r\n " AppliesTo=\" $appliesTo \" \
"\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}]
}
2013 {
return [appendArgs \
"\r\n " AppliesTo=\" $appliesTo \" \
"\r\n " {DependsOn="Microsoft.VCLibs, version=12.0"}]
}
default {
return ""
}
}
}
proc replaceFileNameTokens { fileName name buildName platformName } {
@ -188,6 +227,15 @@ proc replaceFileNameTokens { fileName name buildName platformName } {
<name> $name] $fileName]
}
proc substFile { fileName } {
#
# NOTE: Performs all Tcl command, variable, and backslash substitutions in
# the specified file and then rewrites the contents of that same file
# with the substituted data.
#
return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]]
}
#
# NOTE: This is the entry point for this script.
#
@ -206,7 +254,7 @@ set rootName [file rootname [file tail $script]]
# NOTE: Process and verify all the command line arguments.
#
set argc [llength $argv]
if {$argc < 1 || $argc > 4} then {fail}
if {$argc < 1 || $argc > 5} then {fail}
set binaryDirectory [lindex $argv 0]
@ -251,58 +299,97 @@ if {[string length $packageFlavor] == 0} then {
fail "invalid package flavor"
}
if {[string equal -nocase $packageFlavor WinRT]} then {
set shortName SQLite.WinRT
set displayName "SQLite for Windows Runtime"
set targetPlatformIdentifier Windows
set targetPlatformVersion v8.0
set minVsVersion 11.0
set extraSdkPath ""
set extraFileListAttributes [appendArgs \
"\r\n " {AppliesTo="WindowsAppContainer"} \
"\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}]
} elseif {[string equal -nocase $packageFlavor WinRT81]} then {
set shortName SQLite.WinRT81
set displayName "SQLite for Windows Runtime (Windows 8.1)"
set targetPlatformIdentifier Windows
set targetPlatformVersion v8.1
set minVsVersion 12.0
set extraSdkPath ""
set extraFileListAttributes [appendArgs \
"\r\n " {AppliesTo="WindowsAppContainer"} \
"\r\n " {DependsOn="Microsoft.VCLibs, version=12.0"}]
} elseif {[string equal -nocase $packageFlavor WP80]} then {
set shortName SQLite.WP80
set displayName "SQLite for Windows Phone"
set targetPlatformIdentifier "Windows Phone"
set targetPlatformVersion v8.0
set minVsVersion 11.0
set extraSdkPath "\\..\\$targetPlatformIdentifier"
set extraFileListAttributes ""
} elseif {[string equal -nocase $packageFlavor Win32]} then {
set shortName SQLite.Win32
set displayName "SQLite for Windows"
set targetPlatformIdentifier Windows
set targetPlatformVersion v8.0
set minVsVersion 11.0
set extraSdkPath ""
set extraFileListAttributes [appendArgs \
"\r\n " {AppliesTo="VisualC"} \
"\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}]
} else {
fail "unsupported package flavor, must be one of: WinRT WinRT81 WP80 Win32"
}
if {$argc >= 4} then {
set platformNames [list]
foreach platformName [split [lindex $argv 3] ", "] {
set platformName [string trim $platformName]
if {[string length $platformName] > 0} then {
lappend platformNames $platformName
}
}
}
if {$argc >= 5} then {
set vsVersion [lindex $argv 4]
} else {
set vsVersion 2012
}
if {[string length $vsVersion] == 0} then {
fail "invalid Visual Studio version"
}
if {$vsVersion ne "2012" && $vsVersion ne "2013"} then {
fail [appendArgs \
"unsupported Visual Studio version, must be one of: " \
[list 2012 2013]]
}
set shortNames(WinRT,2012) SQLite.WinRT
set shortNames(WinRT,2013) SQLite.WinRT.2013
set shortNames(WinRT81,2013) SQLite.WinRT81
set shortNames(WP80,2012) SQLite.WP80
set shortNames(WP80,2013) SQLite.WP80.2013
set shortNames(Win32,2012) SQLite.Win32
set shortNames(Win32,2013) SQLite.Win32.2013
set displayNames(WinRT,2012) "SQLite for Windows Runtime"
set displayNames(WinRT,2013) "SQLite for Windows Runtime"
set displayNames(WinRT81,2013) "SQLite for Windows Runtime (Windows 8.1)"
set displayNames(WP80,2012) "SQLite for Windows Phone"
set displayNames(WP80,2013) "SQLite for Windows Phone"
set displayNames(Win32,2012) "SQLite for Windows"
set displayNames(Win32,2013) "SQLite for Windows"
if {[string equal $packageFlavor WinRT]} then {
set shortName $shortNames($packageFlavor,$vsVersion)
set displayName $displayNames($packageFlavor,$vsVersion)
set targetPlatformIdentifier Windows
set targetPlatformVersion v8.0
set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
set extraSdkPath ""
set extraFileListAttributes \
[getExtraFileListXmlChunk $packageFlavor $vsVersion]
} elseif {[string equal $packageFlavor WinRT81]} then {
if {$vsVersion ne "2013"} then {
fail [appendArgs \
"unsupported combination, package flavor " $packageFlavor \
" is only supported with Visual Studio 2013"]
}
set shortName $shortNames($packageFlavor,$vsVersion)
set displayName $displayNames($packageFlavor,$vsVersion)
set targetPlatformIdentifier Windows
set targetPlatformVersion v8.1
set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
set extraSdkPath ""
set extraFileListAttributes \
[getExtraFileListXmlChunk $packageFlavor $vsVersion]
} elseif {[string equal $packageFlavor WP80]} then {
set shortName $shortNames($packageFlavor,$vsVersion)
set displayName $displayNames($packageFlavor,$vsVersion)
set targetPlatformIdentifier "Windows Phone"
set targetPlatformVersion v8.0
set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
set extraSdkPath "\\..\\$targetPlatformIdentifier"
set extraFileListAttributes \
[getExtraFileListXmlChunk $packageFlavor $vsVersion]
} elseif {[string equal $packageFlavor Win32]} then {
set shortName $shortNames($packageFlavor,$vsVersion)
set displayName $displayNames($packageFlavor,$vsVersion)
set targetPlatformIdentifier Windows
set targetPlatformVersion v8.0
set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
set extraSdkPath ""
set extraFileListAttributes \
[getExtraFileListXmlChunk $packageFlavor $vsVersion]
} else {
fail [appendArgs \
"unsupported package flavor, must be one of: " \
[list WinRT WinRT81 WP80 Win32]]
}
###############################################################################
#
@ -490,7 +577,7 @@ if {![info exists buildNames]} then {
# overridden via the command line or the user-specific customizations
# file.
#
if {![info exists platformNames]} then {
if {![info exists platformNames] || [llength $platformNames] == 0} then {
set platformNames [list x86 x64 ARM]
}