]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Refactor VSIX package creation tool to better support Visual Studio 2013.
authormistachkin <mistachkin@noemail.net>
Tue, 6 May 2014 00:09:46 +0000 (00:09 +0000)
committermistachkin <mistachkin@noemail.net>
Tue, 6 May 2014 00:09:46 +0000 (00:09 +0000)
FossilOrigin-Name: 8be166af239cbdaff3937c4003a6dc6e8a96e53a

manifest
manifest.uuid
tool/mkvsix.tcl

index 44f50d85ea2887cf3d92273294e112bbcf182ecf..eb814f0314f7facf66879615c8f1b4530dd379dd 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Merge\supdates\sfrom\strunk.
-D 2014-05-05T22:50:19.792
+C Refactor\sVSIX\spackage\screation\stool\sto\sbetter\ssupport\sVisual\sStudio\s2013.
+D 2014-05-06T00:09:46.488
 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 0d439bb042d0f889210afa91674fe7bf07131d39
+F tool/mkvsix.tcl ee6cf791d22baeac5d488a30bac156e5098fabb9
 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 a94fb9b1b1ef06efc2898975cdfcfa9643731f5e
-P eaa8fc810fcff8171b6c5cff8c661a6faf0e023b c1ab9092e29bc9d172c1f1a3becbcc83b79f2080
-R 6e2bd0951e32bcb3346844cc25759e20
+P 668ed76ac6cfd5810aea7319c752d77fafaab319
+R 5812195e1a7ed7ccc7cd4024eddb3bfc
 U mistachkin
-Z 072e655b0f9d22e16552a74286be445f
+Z add6d3433971df64a412a72ae0f72bd9
index 78722cf280975b7704dd2bfa209facb475f88709..8b91267341cc527950f3ab27f105ae5aa22cdde4 100644 (file)
@@ -1 +1 @@
-668ed76ac6cfd5810aea7319c752d77fafaab319
\ No newline at end of file
+8be166af239cbdaff3937c4003a6dc6e8a96e53a
\ No newline at end of file
index 787326f0f1ff6bce16c814ee5551707694053a8e..feb1bcefd9dabbfbcc96cdecb6f1e33fb99cda03 100644 (file)
 # 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 ""
 }
 \f
-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 ""
+    }
+  }
+}
+\f
+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 ""
+    }
+  }
 }
 \f
 proc replaceFileNameTokens { fileName name buildName platformName } {
@@ -188,6 +229,15 @@ proc replaceFileNameTokens { fileName name buildName platformName } {
       <name> $name] $fileName]
 }
 \f
+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]]]]
+}
+\f
 #
 # 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,91 +301,111 @@ 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)"
+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 [appendArgs \
-      "\r\n    " {MinVSVersion="12.0"}]
+  set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
   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 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 [appendArgs \
-      "\r\n    " {MinVSVersion="12.0"}]
+  set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
   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 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 [appendArgs \
-      "\r\n    " {MinVSVersion="12.0"}]
+  set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
   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 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 [appendArgs \
-      "\r\n    " {MinVSVersion="12.0"}]
+  set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
   set extraSdkPath "\\..\\$targetPlatformIdentifier"
-  set extraFileListAttributes ""
-} elseif {[string equal -nocase $packageFlavor Win32]} then {
-  set shortName SQLite.Win32
-  set displayName "SQLite for Windows"
+  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 [appendArgs \
-      "\r\n    " {MinVSVersion="11.0"}]
+  set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
   set extraSdkPath ""
-  set extraFileListAttributes [appendArgs \
-      "\r\n    " {AppliesTo="VisualC"} \
-      "\r\n    " {DependsOn="Microsoft.VCLibs, version=11.0"}]
+  set extraFileListAttributes \
+      [getExtraFileListXmlChunk $packageFlavor $vsVersion]
 } 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] ", "] {
-    if {[string length $platformName] > 0} then {
-      lappend platformNames $platformName
-    }
-  }
+      [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]
 }