mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Refactor VSIX package creation tool to better support Visual Studio 2013.
FossilOrigin-Name: 8be166af239cbdaff3937c4003a6dc6e8a96e53a
This commit is contained in:
250
tool/mkvsix.tcl
250
tool/mkvsix.tcl
@ -66,11 +66,15 @@
|
||||
# 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:
|
||||
# "WP80", "WP81", 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 flavors "WinRT81" and "WP81" are 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 +104,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 +174,50 @@ 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: Neither Windows Phone 8.0 nor Windows Phone 8.1 require any extra
|
||||
# attributes in their VSIX package SDK manifests.
|
||||
#
|
||||
return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]]
|
||||
if {[string equal $packageFlavor WP80] || \
|
||||
[string equal $packageFlavor WP81]} 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 +229,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 +256,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,93 +301,113 @@ 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 [appendArgs \
|
||||
"\r\n " {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 WinRT_2013]} then {
|
||||
set shortName SQLite.WinRT.2013
|
||||
set displayName "SQLite for Windows Runtime (2013)"
|
||||
set targetPlatformIdentifier Windows
|
||||
set targetPlatformVersion v8.0
|
||||
set minVsVersion [appendArgs \
|
||||
"\r\n " {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 WinRT81]} then {
|
||||
set shortName SQLite.WinRT81
|
||||
set displayName "SQLite for Windows Runtime (Windows 8.1)"
|
||||
set targetPlatformIdentifier Windows
|
||||
set targetPlatformVersion v8.1
|
||||
set minVsVersion [appendArgs \
|
||||
"\r\n " {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 [appendArgs \
|
||||
"\r\n " {MinVSVersion="11.0"}]
|
||||
set extraSdkPath "\\..\\$targetPlatformIdentifier"
|
||||
set extraFileListAttributes ""
|
||||
} elseif {[string equal -nocase $packageFlavor WP80_2013]} then {
|
||||
set shortName SQLite.WP80.2013
|
||||
set displayName "SQLite for Windows Phone (2013)"
|
||||
set targetPlatformIdentifier "Windows Phone"
|
||||
set targetPlatformVersion v8.0
|
||||
set minVsVersion [appendArgs \
|
||||
"\r\n " {MinVSVersion="12.0"}]
|
||||
set extraSdkPath "\\..\\$targetPlatformIdentifier"
|
||||
set extraFileListAttributes ""
|
||||
} elseif {[string equal -nocase $packageFlavor WP81]} then {
|
||||
set shortName SQLite.WP81
|
||||
set displayName "SQLite for Windows Phone 8.1"
|
||||
set targetPlatformIdentifier "WindowsPhoneApp"
|
||||
set targetPlatformVersion v8.1
|
||||
set minVsVersion [appendArgs \
|
||||
"\r\n " {MinVSVersion="12.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 [appendArgs \
|
||||
"\r\n " {MinVSVersion="11.0"}]
|
||||
set extraSdkPath ""
|
||||
set extraFileListAttributes [appendArgs \
|
||||
"\r\n " {AppliesTo="VisualC"} \
|
||||
"\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}]
|
||||
} else {
|
||||
fail [appendArgs \
|
||||
"unsupported package flavor, must be one of: " \
|
||||
"WinRT WinRT_2013 WinRT81 WP80 WP80_2013 WP81 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(WP81,2013) SQLite.WP81
|
||||
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(WP81,2013) "SQLite for Windows Phone 8.1"
|
||||
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 WP81]} 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 WindowsPhoneApp
|
||||
set targetPlatformVersion v8.1
|
||||
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 WP81 Win32]]
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
#
|
||||
@ -525,7 +595,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]
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user