From f7c75326292c6fa3ae6f7ed1e610db3ffd12f8c1 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 7 Dec 2012 04:46:53 +0000 Subject: [PATCH] Backport VSIX tooling and packaging fixes and enhancements. FossilOrigin-Name: e890bcde34370079f4da011da39e4ba8224ffab4 --- Makefile.msc | 6 +- manifest | 20 +-- manifest.uuid | 2 +- tool/build-all-msvc.bat | 126 +++++++++++++-- tool/mkvsix.tcl | 338 +++++++++++++++++++++++++++++----------- tool/win/sqlite.vsix | Bin 32806 -> 32816 bytes 6 files changed, 381 insertions(+), 111 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index db997fd34b..d12e5d0ec1 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -829,8 +829,8 @@ sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl -sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl - $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl +sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl + $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl # Rule to build the amalgamation # @@ -1247,7 +1247,7 @@ clean: del /Q sqlite3.c del /Q sqlite3rc.h del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c - del /Q sqlite-output.vsix + del /Q sqlite-*-output.vsix # Dynamic link library section. # diff --git a/manifest b/manifest index 772b7d45e3..a7e15030a2 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Backport\sthe\s[/timeline?r=shared-cache-fix\s|\sshared-cache-fix]\sbranch. -D 2012-10-26T13:34:05.437 +C Backport\sVSIX\stooling\sand\spackaging\sfixes\sand\senhancements. +D 2012-12-07T04:46:53.606 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in abd5c10d21d1395f140d9e50ea999df8fa4d6376 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 1d8a5d3cf33b8b8d3247c99367a37af384cc7ebd +F Makefile.msc 5a3b6f34d263b01f8b798c291fac1529fd650308 F Makefile.vxworks 879f034a64062a364b21000266bbd5bc6e0c19b9 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6 F VERSION 9694dff497fc7e53037a5890f30ab069c26e8ab7 @@ -972,7 +972,7 @@ F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31 F test/win32lock.test b2a539e85ae6b2d78475e016a9636b4451dc7fb9 F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F test/zerodamage.test 0de750389990b1078bab203c712dc3fefd1d8b82 -F tool/build-all-msvc.bat 76b835e0ab91e30f22d8aa48db9dea4d2dc59e9f x +F tool/build-all-msvc.bat 74fb6e5cca66ebdb6c9bbafb2f8b802f08146d38 x F tool/build-shell.sh b64a481901fc9ffe5ca8812a2a9255b6cfb77381 F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b @@ -990,7 +990,7 @@ F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02 F tool/mksqlite3c.tcl 589c7f44e990be1b8443cfe4808dce392b0327fa F tool/mksqlite3h.tcl 78013ad79a5e492e5f764f3c7a8ef834255061f8 F tool/mksqlite3internalh.tcl 3dca7bb5374cee003379b8cbac73714f610ef795 -F tool/mkvsix.tcl a27951f30bb39c3504196610f17f687fc0b1c94d +F tool/mkvsix.tcl 0be7f7a591f1e83f9199cb82911b66668ca484c9 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c @@ -1014,8 +1014,8 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -F tool/win/sqlite.vsix bc91332e37e980c20575e087b368922f93673f1b -P cbfd1b120ada30ee98403af8d95cfbd590353365 -R cec8d9ad420249b78e42ff233036b95b -U drh -Z f05ff88a3dfee3e1a7e5cb1a864f2163 +F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac +P 325364a984e9a5c0825810bf50f57e026ff3b8dd +R b6cebc4c5e41527b0959f9cee96db5b7 +U mistachkin +Z b5160dec06b175ffc06bc0e43cb2677f diff --git a/manifest.uuid b/manifest.uuid index b5826c41ad..e0693b7ddf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -325364a984e9a5c0825810bf50f57e026ff3b8dd \ No newline at end of file +e890bcde34370079f4da011da39e4ba8224ffab4 \ No newline at end of file diff --git a/tool/build-all-msvc.bat b/tool/build-all-msvc.bat index 989a2af795..758036fb75 100755 --- a/tool/build-all-msvc.bat +++ b/tool/build-all-msvc.bat @@ -6,6 +6,49 @@ :: Multi-Platform Build Tool for MSVC :: +REM +REM This batch script is used to build the SQLite DLL for multiple platforms +REM and configurations using MSVC. The built SQLite DLLs, their associated +REM import libraries, and optionally their symbols files, are placed within +REM the directory specified on the command line, in sub-directories named for +REM their respective platforms and configurations. This batch script must be +REM run from inside a Visual Studio Command Prompt for the desired version of +REM Visual Studio ^(the initial platform configured for the command prompt does +REM not really matter^). Exactly one command line argument is required, the +REM name of an existing directory to be used as the final destination directory +REM for the generated output files, which will be placed in sub-directories +REM created therein. Ideally, the directory specified should be empty. +REM +REM Example: +REM +REM CD /D C:\dev\sqlite\core +REM tool\build-all-msvc.bat C:\Temp +REM +REM In the example above, "C:\dev\sqlite\core" represents the root of the +REM source tree for SQLite and "C:\Temp" represents the final destination +REM directory for the generated output files. +REM +REM There are several environment variables that may be set to modify the +REM behavior of this batch script and its associated Makefile. The list of +REM platforms to build may be overriden by using the PLATFORMS environment +REM variable, which should contain a list of platforms ^(e.g. x86 x86_amd64 +REM x86_arm^). All platforms must be supported by the version of Visual Studio +REM being used. The list of configurations to build may be overridden by +REM setting the CONFIGURATIONS environment variable, which should contain a +REM list of configurations to build ^(e.g. Debug Retail^). Neither of these +REM variable values may contain any double quotes, surrounding or embedded. +REM Finally, the NCRTLIBPATH and NSDKLIBPATH environment variables may be set +REM to specify the location of the CRT and SDK, respectively, needed to compile +REM executables native to the architecture of the build machine during any +REM cross-compilation that may be necessary, depending on the platforms to be +REM built. These values in these two variables should be surrounded by double +REM quotes if they contain spaces. +REM +REM Please note that the SQLite build process performed by the Makefile +REM associated with this batch script requires both Gawk ^(gawk.exe^) and Tcl +REM 8.5 ^(tclsh85.exe^) to be present in a directory contained in the PATH +REM environment variable unless a pre-existing amalgamation file is used. +REM SETLOCAL REM SET __ECHO=ECHO @@ -93,18 +136,36 @@ IF NOT DEFINED PLATFORMS ( %_VECHO% Platforms = '%PLATFORMS%' +REM +REM NOTE: If the list of configurations is not already set, use the default +REM list. +REM +IF NOT DEFINED CONFIGURATIONS ( + SET CONFIGURATIONS=Debug Retail +) + +%_VECHO% Configurations = '%CONFIGURATIONS%' + REM REM NOTE: Setup environment variables to translate between the MSVC platform REM names and the names to be used for the platform-specific binary REM directories. REM +SET amd64_NAME=x64 +SET arm_NAME=ARM +SET x64_NAME=x64 SET x86_NAME=x86 SET x86_amd64_NAME=x64 SET x86_arm_NAME=ARM +SET x86_x64_NAME=x64 +%_VECHO% amd64_Name = '%amd64_NAME%' +%_VECHO% arm_Name = '%arm_NAME%' +%_VECHO% x64_Name = '%x64_NAME%' %_VECHO% x86_Name = '%x86_NAME%' %_VECHO% x86_amd64_Name = '%x86_amd64_NAME%' %_VECHO% x86_arm_Name = '%x86_arm_NAME%' +%_VECHO% x86_x64_Name = '%x86_x64_NAME%' REM REM NOTE: Check for the external tools needed during the build process ^(i.e. @@ -115,6 +176,24 @@ FOR %%T IN (gawk.exe tclsh85.exe) DO ( SET %%T_PATH=%%~dp$PATH:T ) +REM +REM NOTE: The Gawk executable "gawk.exe" is required during the SQLite build +REM process unless a pre-existing amalgamation file is used. +REM +IF NOT DEFINED gawk.exe_PATH ( + ECHO The Gawk executable "gawk.exe" is required to be in the PATH. + GOTO errors +) + +REM +REM NOTE: The Tcl 8.5 executable "tclsh85.exe" is required during the SQLite +REM build process unless a pre-existing amalgamation file is used. +REM +IF NOT DEFINED tclsh85.exe_PATH ( + ECHO The Tcl 8.5 executable "tclsh85.exe" is required to be in the PATH. + GOTO errors +) + REM REM NOTE: Set the TOOLPATH variable to contain all the directories where the REM external tools were found in the search above. @@ -128,11 +207,30 @@ REM NOTE: Check for MSVC 2012 because the Windows SDK directory handling is REM slightly different for that version. REM IF "%VisualStudioVersion%" == "11.0" ( - SET SET_NSDKLIBPATH=1 + REM + REM NOTE: If the Windows SDK library path has already been set, do not set + REM it to something else later on. + REM + IF NOT DEFINED NSDKLIBPATH ( + SET SET_NSDKLIBPATH=1 + ) ) ELSE ( CALL :fn_UnsetVariable SET_NSDKLIBPATH ) +REM +REM NOTE: Check if this is the Windows Phone SDK. If so, a different batch +REM file is necessary to setup the build environment. Since the variable +REM values involved here may contain parenthesis, using GOTO instead of +REM an IF block is required. +REM +IF DEFINED WindowsPhoneKitDir GOTO set_vcvarsall_phone +SET VCVARSALL=%VCINSTALLDIR%\vcvarsall.bat +GOTO set_vcvarsall_done +:set_vcvarsall_phone +SET VCVARSALL=%VCINSTALLDIR%\WPSDK\WP80\vcvarsphoneall.bat +:set_vcvarsall_done + REM REM NOTE: This is the outer loop. There should be exactly one iteration per REM platform. @@ -173,6 +271,7 @@ FOR %%P IN (%PLATFORMS%) DO ( CALL :fn_UnsetVariable Platform REM CALL :fn_UnsetVariable VCINSTALLDIR CALL :fn_UnsetVariable VSINSTALLDIR + CALL :fn_UnsetVariable WindowsPhoneKitDir CALL :fn_UnsetVariable WindowsSdkDir CALL :fn_UnsetVariable WindowsSdkDir_35 CALL :fn_UnsetVariable WindowsSdkDir_old @@ -182,7 +281,7 @@ FOR %%P IN (%PLATFORMS%) DO ( REM SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot% - FOR %%B IN (Debug Retail) DO ( + FOR %%B IN (%CONFIGURATIONS%) DO ( REM REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG REM environment variables to be picked up by the MSVC makefile @@ -215,10 +314,10 @@ FOR %%P IN (%PLATFORMS%) DO ( REM REM NOTE: Attempt to setup the MSVC environment for this platform. REM - %__ECHO3% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P + %__ECHO3% CALL "%VCVARSALL%" %%P IF ERRORLEVEL 1 ( - ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P. + ECHO Failed to call "%VCVARSALL%" for platform %%P. GOTO errors ) @@ -228,10 +327,12 @@ FOR %%P IN (%PLATFORMS%) DO ( REM as current versions of their official batch file do not set REM the exit code upon failure. REM - IF NOT DEFINED __ECHO ( - IF NOT DEFINED WindowsSdkDir ( - ECHO Cannot build, Windows SDK not found for platform %%P. - GOTO errors + IF NOT DEFINED __ECHO3 ( + IF NOT DEFINED WindowsPhoneKitDir ( + IF NOT DEFINED WindowsSdkDir ( + ECHO Cannot build, Windows SDK not found for platform %%P. + GOTO errors + ) ) ) @@ -245,8 +346,13 @@ FOR %%P IN (%PLATFORMS%) DO ( REM file used to setup the MSVC environment. REM IF DEFINED SET_NSDKLIBPATH ( - CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH - CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86 + IF DEFINED WindowsPhoneKitDir ( + CALL :fn_CopyVariable WindowsPhoneKitDir NSDKLIBPATH + CALL :fn_AppendVariable NSDKLIBPATH \lib\x86 + ) ELSE IF DEFINED WindowsSdkDir ( + CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH + CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86 + ) ) REM diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index 6a84758cc8..e9f1f818da 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -2,7 +2,95 @@ # # This script is used to generate a VSIX (Visual Studio Extension) file for # SQLite usable by Visual Studio. - +# +# PREREQUISITES +# +# 1. Tcl 8.4 and later are supported, earlier versions have not been tested. +# +# 2. The "sqlite3.h" file is assumed to exist in the parent directory of the +# directory containing this script. The [optional] second command line +# argument to this script may be used to specify an alternate location. +# This script also assumes that the "sqlite3.h" file corresponds with the +# version of the binaries to be packaged. This assumption is not verified +# by this script. +# +# 3. The temporary directory specified in the TEMP or TMP environment variables +# must refer to an existing directory writable by the current user. +# +# 4. The "zip" and "unzip" command line tools must be located either in a +# directory contained in the PATH environment variable or specified as the +# exact file names to execute in the "ZipTool" and "UnZipTool" environment +# variables, respectively. +# +# 5. The template VSIX file (which is basically a zip file) must be located in +# a "win" directory inside the directory containing this script. It should +# not contain any executable binaries. It should only contain dynamic +# textual content files to be processed using [subst] and/or static content +# files to be copied verbatim. +# +# 6. The executable and other compiled binary files to be packaged into the +# final VSIX file (e.g. DLLs, LIBs, and PDBs) must be located in a single +# directory tree. The top-level directory of the tree must be specified as +# the first command line argument to this script. The second level +# sub-directory names must match those of the build configuration (e.g. +# "Debug" or "Retail"). The third level sub-directory names must match +# those of the platform (e.g. "x86", "x64", and "ARM"). For example, the +# binary files to be packaged would need to be organized as follows when +# packaging the "Debug" and "Retail" build configurations for the "x86" and +# "x64" platforms (in this example, "C:\temp" is the top-level directory as +# specified in the first command line argument): +# +# C:\Temp\Debug\x86\sqlite3.lib +# C:\Temp\Debug\x86\sqlite3.dll +# C:\Temp\Debug\x86\sqlite3.pdb +# C:\Temp\Debug\x64\sqlite3.lib +# C:\Temp\Debug\x64\sqlite3.dll +# C:\Temp\Debug\x64\sqlite3.pdb +# C:\Temp\Retail\x86\sqlite3.lib +# C:\Temp\Retail\x86\sqlite3.dll +# C:\Temp\Retail\x86\sqlite3.pdb +# C:\Temp\Retail\x64\sqlite3.lib +# C:\Temp\Retail\x64\sqlite3.dll +# C:\Temp\Retail\x64\sqlite3.pdb +# +# The above directory tree organization is performed automatically if the +# "tool\build-all-msvc.bat" batch script is used to build the binary files +# to be packaged. +# +# USAGE +# +# The first argument to this script is required and must be the name of the +# top-level directory containing the directories and files organized into a +# tree as described in item 6 of the PREREQUISITES section, above. The second +# 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" 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: +# +# CD /D C:\dev\sqlite\core +# tclsh85 tool\mkvsix.tcl C:\Temp +# +# In the example above, "C:\dev\sqlite\core" represents the root of the source +# tree for SQLite and "C:\Temp" represents the top-level directory containing +# the executable and other compiled binary files, organized into a directory +# tree as described in item 6 of the PREREQUISITES section, above. +# +# This script should work on non-Windows platforms as well, provided that all +# the requirements listed in the PREREQUISITES section are met. +# +# NOTES +# +# The temporary directory is used as a staging area for the final VSIX file. +# The template VSIX file is extracted, its contents processed, and then the +# resulting files are packaged into the final VSIX file. +# +package require Tcl 8.4 + proc fail { {error ""} {usage false} } { if {[string length $error] > 0} then { puts stdout $error @@ -11,7 +99,8 @@ proc fail { {error ""} {usage false} } { puts stdout "usage:\ [file tail [info nameofexecutable]]\ -[file tail [info script]] \[sourceDirectory\]" +[file tail [info script]] \[sourceDirectory\]\ +\[packageFlavor\] \[platformNames\]" exit 1 } @@ -84,21 +173,24 @@ proc writeFile { fileName data } { proc substFile { fileName } { # # NOTE: Performs all Tcl command, variable, and backslash substitutions in - # the specified file and then re-writes the contents of that same file + # 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]]]] } -proc replaceBuildAndPlatform { fileName buildName platformName } { +proc replaceFileNameTokens { fileName name buildName platformName } { # # NOTE: Returns the specified file name containing the platform name instead # of platform placeholder tokens. # - return [string map [list $buildName $platformName] \ - $fileName] + return [string map [list $buildName $platformName \ + $name] $fileName] } +# +# NOTE: This is the entry point for this script. +# set script [file normalize [info script]] if {[string length $script] == 0} then { @@ -114,7 +206,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 != 2} then {fail} +if {$argc < 1 || $argc > 4} then {fail} set binaryDirectory [lindex $argv 0] @@ -127,7 +219,7 @@ if {![file exists $binaryDirectory] || \ fail "binary directory does not exist" } -if {$argc == 2} then { +if {$argc >= 2} then { set sourceDirectory [lindex $argv 1] } else { # @@ -146,6 +238,47 @@ if {![file exists $sourceDirectory] || \ fail "source directory does not exist" } +if {$argc >= 3} then { + set packageFlavor [lindex $argv 2] +} else { + # + # NOTE: Assume the package flavor is WinRT. + # + set packageFlavor WinRT +} + +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 extraSdkPath "" + set extraFileListAttributes [appendArgs \ + "\r\n " {AppliesTo="WindowsAppContainer"} \ + "\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}] +} elseif {[string equal -nocase $packageFlavor WP80]} then { + set shortName SQLite.WP80 + set displayName "SQLite for Windows Phone" + set targetPlatformIdentifier "Windows Phone" + set extraSdkPath "\\..\\$targetPlatformIdentifier" + set extraFileListAttributes "" +} else { + fail "unsupported package flavor, must be \"WinRT\" or \"WP80\"" +} + +if {$argc >= 4} then { + set platformNames [list] + + foreach platformName [split [lindex $argv 3] ", "] { + if {[string length $platformName] > 0} then { + lappend platformNames $platformName + } + } +} + ############################################################################### # @@ -169,7 +302,8 @@ if {![file exists $templateFile] || \ } set currentDirectory [pwd] -set outputFile [file join $currentDirectory sqlite-output.vsix] +set outputFile [file join $currentDirectory [appendArgs sqlite- \ + $packageFlavor -output.vsix]] if {[file exists $outputFile]} then { fail [appendArgs "output file \"" $outputFile "\" already exists"] @@ -245,13 +379,41 @@ if {![regexp -line -- $pattern $data dummy version]} then { ############################################################################### # -# NOTE: Setup the master file list data, including the necessary flags. +# NOTE: Setup all the master file list data. This includes the source file +# names, the destination file names, and the file processing flags. The +# possible file processing flags are: +# +# "buildNeutral" -- This flag indicates the file location and content do +# not depend on the build configuration. +# +# "platformNeutral" -- This flag indicates the file location and content +# do not depend on the build platform. +# +# "subst" -- This flag indicates that the file contains dynamic textual +# content that needs to be processed using [subst] prior to +# packaging the file into the final VSIX package. The primary +# use of this flag is to insert the name of the VSIX package, +# some package flavor-specific value, or the SQLite version +# into a file. +# +# "noDebug" -- This flag indicates that the file should be skipped when +# processing the debug build. +# +# "noRetail" -- This flag indicates that the file should be skipped when +# processing the retail build. +# +# "move" -- This flag indicates that the file should be moved from the +# source to the destination instead of being copied. +# +# This file metadata may be overridden, either in whole or in part, via +# the user-specific customizations file. # if {![info exists fileNames(source)]} then { - set fileNames(source) [list "" "" "" \ - [file join $sourceDirectory sqlite3.h] \ - [file join $binaryDirectory sqlite3.lib] \ - [file join $binaryDirectory sqlite3.dll]] + set fileNames(source) [list "" "" \ + [file join $stagingDirectory DesignTime sqlite3.props] \ + [file join $sourceDirectory sqlite3.h] \ + [file join $binaryDirectory sqlite3.lib] \ + [file join $binaryDirectory sqlite3.dll]] if {![info exists no(symbols)]} then { lappend fileNames(source) \ @@ -261,13 +423,12 @@ if {![info exists fileNames(source)]} then { if {![info exists fileNames(destination)]} then { set fileNames(destination) [list \ - [file join $stagingDirectory extension.vsixmanifest] \ - [file join $stagingDirectory SDKManifest.xml] \ - [file join $stagingDirectory DesignTime \ - SQLite.WinRT.props] \ - [file join $stagingDirectory DesignTime sqlite3.h] \ - [file join $stagingDirectory DesignTime sqlite3.lib] \ - [file join $stagingDirectory Redist sqlite3.dll]] + [file join $stagingDirectory extension.vsixmanifest] \ + [file join $stagingDirectory SDKManifest.xml] \ + [file join $stagingDirectory DesignTime .props] \ + [file join $stagingDirectory DesignTime sqlite3.h] \ + [file join $stagingDirectory DesignTime sqlite3.lib] \ + [file join $stagingDirectory Redist sqlite3.dll]] if {![info exists no(symbols)]} then { lappend fileNames(destination) \ @@ -275,50 +436,24 @@ if {![info exists fileNames(destination)]} then { } } -if {![info exists fileNames(buildNeutral)]} then { - set fileNames(buildNeutral) [list 1 1 1 1 0 0] +if {![info exists fileNames(flags)]} then { + set fileNames(flags) [list \ + [list buildNeutral platformNeutral subst] \ + [list buildNeutral platformNeutral subst] \ + [list buildNeutral platformNeutral subst move] \ + [list buildNeutral platformNeutral] \ + [list] [list] [list noRetail]] if {![info exists no(symbols)]} then { - lappend fileNames(buildNeutral) 0 - } -} - -if {![info exists fileNames(platformNeutral)]} then { - set fileNames(platformNeutral) [list 1 1 1 1 0 0] - - if {![info exists no(symbols)]} then { - lappend fileNames(platformNeutral) 0 - } -} - -if {![info exists fileNames(subst)]} then { - set fileNames(subst) [list 1 1 1 0 0 0] - - if {![info exists no(symbols)]} then { - lappend fileNames(subst) 0 - } -} - -if {![info exists fileNames(noDebug)]} then { - set fileNames(noDebug) [list 0 0 0 0 0 0] - - if {![info exists no(symbols)]} then { - lappend fileNames(noDebug) 0 - } -} - -if {![info exists fileNames(noRetail)]} then { - set fileNames(noRetail) [list 0 0 0 0 0 0] - - if {![info exists no(symbols)]} then { - lappend fileNames(noRetail) 1 + lappend fileNames(flags) [list noRetail] } } ############################################################################### # -# NOTE: Setup the list of builds supported by this script. +# NOTE: Setup the list of builds supported by this script. These may be +# overridden via the user-specific customizations file. # if {![info exists buildNames]} then { set buildNames [list Debug Retail] @@ -327,7 +462,9 @@ if {![info exists buildNames]} then { ############################################################################### # -# NOTE: Setup the list of platforms supported by this script. +# NOTE: Setup the list of platforms supported by this script. These may be +# overridden via the command line or the user-specific customizations +# file. # if {![info exists platformNames]} then { set platformNames [list x86 x64 ARM] @@ -341,47 +478,64 @@ if {![info exists platformNames]} then { file mkdir $stagingDirectory # -# NOTE: Build the Tcl command used to extract the template package to the -# staging directory. +# NOTE: Build the Tcl command used to extract the template VSIX package to +# the staging directory. # set extractCommand [list exec -- $unzip $templateFile -d $stagingDirectory] # -# NOTE: Extract the template package to the staging directory. +# NOTE: Extract the template VSIX package to the staging directory. # eval $extractCommand ############################################################################### # -# NOTE: Process each file in the master file list. There are actually four -# parallel lists that contain the source file names, destination file -# names, the platform-neutral flags, and the use-subst flags. When the -# platform-neutral flag is non-zero, the file is not platform-specific. -# When the use-subst flag is non-zero, the file is considered to be a -# text file that may contain Tcl variable and/or command replacements, -# to be dynamically replaced during processing. If the source file name -# is an empty string, then the destination file name will be assumed to -# already exist in the staging directory and will not be copied; however, -# dynamic replacements may still be performed on the destination file -# prior to the package being re-zipped. -# -foreach sourceFileName $fileNames(source) \ - destinationFileName $fileNames(destination) \ - buildNeutral $fileNames(buildNeutral) platformNeutral \ - $fileNames(platformNeutral) useSubst $fileNames(subst) \ - noDebug $fileNames(noDebug) noRetail $fileNames(noRetail) { +# NOTE: Process each file in the master file list. There are actually three +# parallel lists that contain the source file names, the destination file +# names, and the file processing flags. If the "buildNeutral" flag is +# present, the file location and content do not depend on the build +# configuration and "CommonConfiguration" will be used in place of the +# build configuration name. If the "platformNeutral" flag is present, +# the file location and content do not depend on the build platform and +# "neutral" will be used in place of the build platform name. If the +# "subst" flag is present, the file is assumed to be a text file that may +# contain Tcl variable, command, and backslash replacements, to be +# dynamically replaced during processing using the Tcl [subst] command. +# If the "noDebug" flag is present, the file will be skipped when +# processing for the debug build. If the "noRetail" flag is present, the +# file will be skipped when processing for the retail build. If the +# "move" flag is present, the source file will be deleted after it is +# copied to the destination file. If the source file name is an empty +# string, the destination file name will be assumed to already exist in +# the staging directory and will not be copied; however, Tcl variable, +# command, and backslash replacements may still be performed on the +# destination file prior to the final VSIX package being built if the +# "subst" flag is present. +# +foreach sourceFileName $fileNames(source) \ + destinationFileName $fileNames(destination) \ + fileFlags $fileNames(flags) { + # + # NOTE: Process the file flags into separate boolean variables that may be + # used within the loop. + # + set isBuildNeutral [expr {[lsearch $fileFlags buildNeutral] != -1}] + set isPlatformNeutral [expr {[lsearch $fileFlags platformNeutral] != -1}] + set isMove [expr {[lsearch $fileFlags move] != -1}] + set useSubst [expr {[lsearch $fileFlags subst] != -1}] + # # NOTE: If the current file is build-neutral, then only one build will # be processed for it, namely "CommonConfiguration"; otherwise, each # supported build will be processed for it individually. # foreach buildName \ - [expr {$buildNeutral ? [list CommonConfiguration] : $buildNames}] { + [expr {$isBuildNeutral ? [list CommonConfiguration] : $buildNames}] { # # NOTE: Should the current file be skipped for this build? # - if {[info exists no${buildName}] && [set no${buildName}]} then { + if {[lsearch $fileFlags no${buildName}] != -1} then { continue } @@ -391,12 +545,12 @@ foreach sourceFileName $fileNames(source) \ # supported platform will be processed for it individually. # foreach platformName \ - [expr {$platformNeutral ? [list neutral] : $platformNames}] { + [expr {$isPlatformNeutral ? [list neutral] : $platformNames}] { # # NOTE: Use the actual platform name in the destination file name. # - set newDestinationFileName [replaceBuildAndPlatform \ - $destinationFileName $buildName $platformName] + set newDestinationFileName [replaceFileNameTokens $destinationFileName \ + $shortName $buildName $platformName] # # NOTE: Does the source file need to be copied to the destination file? @@ -410,8 +564,18 @@ foreach sourceFileName $fileNames(source) \ # # NOTE: Then, copy the source file to the destination file verbatim. # - file copy [replaceBuildAndPlatform $sourceFileName $buildName \ - $platformName] $newDestinationFileName + set newSourceFileName [replaceFileNameTokens $sourceFileName \ + $shortName $buildName $platformName] + + file copy $newSourceFileName $newDestinationFileName + + # + # NOTE: If this is a move instead of a copy, delete the source file + # now. + # + if {$isMove} then { + file delete $newSourceFileName + } } # @@ -439,13 +603,13 @@ foreach sourceFileName $fileNames(source) \ cd $stagingDirectory # -# NOTE: Build the Tcl command used to archive the final package in the +# NOTE: Build the Tcl command used to archive the final VSIX package in the # output directory. # set archiveCommand [list exec -- $zip -r $outputFile *] # -# NOTE: Build the final package archive in the output directory. +# NOTE: Build the final VSIX package archive in the output directory. # eval $archiveCommand diff --git a/tool/win/sqlite.vsix b/tool/win/sqlite.vsix index af79956e8b3a0888f4919890780d106d966faef3..93eefac2dbbd9da8a901fc215cc94629002b5723 100644 GIT binary patch delta 1560 zc-m!@dpOez7{`BG=9)v4mSHI)DwInuiN%N|*_hmOSt3lPRWAKloE;*UpEI;dQqu*s z<}xI?%;g~EA$Bk#$s{SFTsl1GpW`{-f8WdVdEV#!e%bNxr}6NN@-0>jH|#QYrtS$0 z0DQ#&z%VmG2c(`44UQrk=te|RBB-@4j!pws^0jUv@Ra*Q`u(>ori@O7bJBoxg1m#t zXL3OLG-k<<)}p>;w2o_RE0y(*K4Q$JEDKqJ*=8*ircJq6(N?Rz>#UOe>niQU(yTlD zuPx3ISyxsReBG&=Oci`fy%l=?=%hG!`&=E>CG4sMoAVS32lsfqRK6Gdk}%FJ$v~_a zu~fxx|1R&;qt08QI1bF&4XJmzJ*N{3@y_MU!i(0iB*{;4j)M0i2;>R-tc*#+V+N-x zT#vUPh3!HjSlpzd5h39d_*-jItTo?ysW2wsMvz%f7|cy&s%L7I>s5b?^B6}va!A~| z`R-XTQVvxX>s(y@OrrU%-J4WS9ZGCyn*QWMs^e$xuzfz!bcQZUiQlrr#Ch^uK|F_8 znEggi#egPNGLh3Fe0e)xpB*FMzLVjU4Tf8GKJ7!IsEdimuHWZ~ZVX84e^N#+%gSyR zlqL)r?F#`q63=N2)6}}-EQi}(IUV<1dOuI9IbwZsNA}SL^WIH0Fp(>IL6AQhJk9I4 z1M^-)d&J|1O14TeGPkymQ6$E2FKW+^xF`Qc@HPqG!*29^H)eMdze#K>005GJk`oad z82MgN>f#RQ8;70y6XWE+ zN}3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