/ Check-in [702ebc64]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Modify VSIX build tools in support of an additional package flavor.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | vsixFlavor
Files: files | file ages | folders
SHA1: 702ebc646b43468e6a89322e4e2f4b1ef7858589
User & Date: mistachkin 2012-10-20 08:40:05
Context
2012-10-20
09:35
Modify clean target to handle all VSIX package flavors. check-in: 023217ea user: mistachkin tags: vsixFlavor
08:40
Modify VSIX build tools in support of an additional package flavor. check-in: 702ebc64 user: mistachkin tags: vsixFlavor
2012-10-19
02:10
Make sure substructure elements have proper alignment in the ICU tokenizers of FTS2 and FTS3. check-in: aaa2d9b0 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/build-all-msvc.bat.

   147    147   %_VECHO% Configurations = '%CONFIGURATIONS%'
   148    148   
   149    149   REM
   150    150   REM NOTE: Setup environment variables to translate between the MSVC platform
   151    151   REM       names and the names to be used for the platform-specific binary
   152    152   REM       directories.
   153    153   REM
          154  +SET amd64_NAME=x64
          155  +SET arm_NAME=ARM
          156  +SET x64_NAME=x64
   154    157   SET x86_NAME=x86
   155    158   SET x86_amd64_NAME=x64
   156    159   SET x86_arm_NAME=ARM
          160  +SET x86_x64_NAME=x64
   157    161   
          162  +%_VECHO% amd64_Name = '%amd64_NAME%'
          163  +%_VECHO% arm_Name = '%arm_NAME%'
          164  +%_VECHO% x64_Name = '%x64_NAME%'
   158    165   %_VECHO% x86_Name = '%x86_NAME%'
   159    166   %_VECHO% x86_amd64_Name = '%x86_amd64_NAME%'
   160    167   %_VECHO% x86_arm_Name = '%x86_arm_NAME%'
          168  +%_VECHO% x86_x64_Name = '%x86_x64_NAME%'
   161    169   
   162    170   REM
   163    171   REM NOTE: Check for the external tools needed during the build process ^(i.e.
   164    172   REM       those that do not get compiled as part of the build process itself^)
   165    173   REM       along the PATH.
   166    174   REM
   167    175   FOR %%T IN (gawk.exe tclsh85.exe) DO (
................................................................................
   206    214     IF NOT DEFINED NSDKLIBPATH (
   207    215       SET SET_NSDKLIBPATH=1
   208    216     )
   209    217   ) ELSE (
   210    218     CALL :fn_UnsetVariable SET_NSDKLIBPATH
   211    219   )
   212    220   
          221  +REM
          222  +REM NOTE: Check if this is the Windows Phone SDK.  If so, a different batch
          223  +REM       file is necessary to setup the build environment.  Since the variable
          224  +REM       values involved here may contain parenthesis, using GOTO instead of
          225  +REM       an IF block is required.
          226  +REM
          227  +IF DEFINED WindowsPhoneKitDir GOTO set_vcvarsall_phone
          228  +SET VCVARSALL=%VCINSTALLDIR%\vcvarsall.bat
          229  +GOTO set_vcvarsall_done
          230  +:set_vcvarsall_phone
          231  +SET VCVARSALL=%VCINSTALLDIR%\WPSDK\WP80\vcvarsphoneall.bat
          232  +:set_vcvarsall_done
          233  +
   213    234   REM
   214    235   REM NOTE: This is the outer loop.  There should be exactly one iteration per
   215    236   REM       platform.
   216    237   REM
   217    238   FOR %%P IN (%PLATFORMS%) DO (
   218    239     REM
   219    240     REM NOTE: Using the MSVC platform name, lookup the simpler platform name to
................................................................................
   246    267       CALL :fn_UnsetVariable FSHARPINSTALLDIR
   247    268       CALL :fn_UnsetVariable INCLUDE
   248    269       CALL :fn_UnsetVariable LIB
   249    270       CALL :fn_UnsetVariable LIBPATH
   250    271       CALL :fn_UnsetVariable Platform
   251    272       REM CALL :fn_UnsetVariable VCINSTALLDIR
   252    273       CALL :fn_UnsetVariable VSINSTALLDIR
          274  +    CALL :fn_UnsetVariable WindowsPhoneKitDir
   253    275       CALL :fn_UnsetVariable WindowsSdkDir
   254    276       CALL :fn_UnsetVariable WindowsSdkDir_35
   255    277       CALL :fn_UnsetVariable WindowsSdkDir_old
   256    278   
   257    279       REM
   258    280       REM NOTE: Reset the PATH here to the absolute bare minimum required.
   259    281       REM
................................................................................
   288    310         REM          platform to the platform-specific directory beneath the
   289    311         REM          binary directory.
   290    312         REM
   291    313         "%ComSpec%" /C (
   292    314           REM
   293    315           REM NOTE: Attempt to setup the MSVC environment for this platform.
   294    316           REM
   295         -        %__ECHO3% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P
          317  +        %__ECHO3% CALL "%VCVARSALL%" %%P
   296    318   
   297    319           IF ERRORLEVEL 1 (
   298         -          ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P.
          320  +          ECHO Failed to call "%VCVARSALL%" for platform %%P.
   299    321             GOTO errors
   300    322           )
   301    323   
   302    324           REM
   303    325           REM NOTE: If this batch file is not running in "what-if" mode, check to
   304    326           REM       be sure we were actually able to setup the MSVC environment
   305    327           REM       as current versions of their official batch file do not set
   306    328           REM       the exit code upon failure.
   307    329           REM
   308         -        IF NOT DEFINED __ECHO (
   309         -          IF NOT DEFINED WindowsSdkDir (
   310         -            ECHO Cannot build, Windows SDK not found for platform %%P.
   311         -            GOTO errors
          330  +        IF NOT DEFINED __ECHO3 (
          331  +          IF NOT DEFINED WindowsPhoneKitDir (
          332  +            IF NOT DEFINED WindowsSdkDir (
          333  +              ECHO Cannot build, Windows SDK not found for platform %%P.
          334  +              GOTO errors
          335  +            )
   312    336             )
   313    337           )
   314    338   
   315    339           REM
   316    340           REM NOTE: When using MSVC 2012, the native SDK path cannot simply use
   317    341           REM       the "lib" sub-directory beneath the location specified in the
   318    342           REM       WindowsSdkDir environment variable because that location does
   319    343           REM       not actually contain the necessary library files for x86.
   320    344           REM       This must be done for each iteration because it relies upon
   321    345           REM       the WindowsSdkDir environment variable being set by the batch
   322    346           REM       file used to setup the MSVC environment.
   323    347           REM
   324    348           IF DEFINED SET_NSDKLIBPATH (
   325         -          CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH
   326         -          CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86
          349  +          IF DEFINED WindowsPhoneKitDir (
          350  +            CALL :fn_CopyVariable WindowsPhoneKitDir NSDKLIBPATH
          351  +            CALL :fn_AppendVariable NSDKLIBPATH \lib\x86
          352  +          ) ELSE IF DEFINED WindowsSdkDir (
          353  +            CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH
          354  +            CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86
          355  +          )
   327    356           )
   328    357   
   329    358           REM
   330    359           REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC
   331    360           REM       makefile to clean any stale build output from previous
   332    361           REM       iterations of this loop and/or previous runs of this batch
   333    362           REM       file, etc.

Changes to tool/mkvsix.tcl.

    55     55   #
    56     56   #    The above directory tree organization is performed automatically if the
    57     57   #    "tool\build-all-msvc.bat" batch script is used to build the binary files
    58     58   #    to be packaged.
    59     59   #
    60     60   # USAGE
    61     61   #
    62         -# Typically, when on Windows, this script is executed using commands similar to
    63         -# the following (from a normal Windows command prompt window):
           62  +# The first argument to this script is required and must be the name of the
           63  +# top-level directory containing the directories and files organized into a
           64  +# tree as described in item 6 of the PREREQUISITES section, above.  The second
           65  +# argument is optional and if present must contain the name of the directory
           66  +# containing the root of the source tree for SQLite.  The third argument is
           67  +# optional and if present must contain the flavor the VSIX package to build.
           68  +# Currently, the only supported package flavors are "WinRT" and "WP80".  The
           69  +# fourth argument is optional and if present must be a string containing a list
           70  +# of platforms to include in the VSIX package.  The format of the platform list
           71  +# string is "platform1,platform2,platform3".  Typically, when on Windows, this
           72  +# script is executed using commands similar to the following from a normal
           73  +# Windows command prompt:
    64     74   #
    65     75   #                         CD /D C:\dev\sqlite\core
    66     76   #                         tclsh85 tool\mkvsix.tcl C:\Temp
    67     77   #
    68     78   # In the example above, "C:\dev\sqlite\core" represents the root of the source
    69     79   # tree for SQLite and "C:\Temp" represents the top-level directory containing
    70     80   # the executable and other compiled binary files, organized into a directory
................................................................................
    85     95     if {[string length $error] > 0} then {
    86     96       puts stdout $error
    87     97       if {!$usage} then {exit 1}
    88     98     }
    89     99   
    90    100     puts stdout "usage:\
    91    101   [file tail [info nameofexecutable]]\
    92         -[file tail [info script]] <binaryDirectory> \[sourceDirectory\]"
          102  +[file tail [info script]] <binaryDirectory> \[sourceDirectory\]\
          103  +\[packageFlavor\] \[platformNames\]"
    93    104   
    94    105     exit 1
    95    106   }
          107  +
          108  +proc appendArgs { args } {
          109  +  set result ""; eval append result $args
          110  +}
    96    111   
    97    112   proc getEnvironmentVariable { name } {
    98    113     #
    99    114     # NOTE: Returns the value of the specified environment variable or an empty
   100    115     #       string for environment variables that do not exist in the current
   101    116     #       process environment.
   102    117     #
................................................................................
   158    173     close $file_id
   159    174     return ""
   160    175   }
   161    176   
   162    177   proc substFile { fileName } {
   163    178     #
   164    179     # NOTE: Performs all Tcl command, variable, and backslash substitutions in
   165         -  #       the specified file and then re-writes the contents of that same file
          180  +  #       the specified file and then rewrites the contents of that same file
   166    181     #       with the substituted data.
   167    182     #
   168    183     return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]]
   169    184   }
   170    185   
   171         -proc replaceBuildAndPlatform { fileName buildName platformName } {
          186  +proc replaceFileNameTokens { fileName name buildName platformName } {
   172    187     #
   173    188     # NOTE: Returns the specified file name containing the platform name instead
   174    189     #       of platform placeholder tokens.
   175    190     #
   176         -  return [string map [list <build> $buildName <platform> $platformName] \
   177         -      $fileName]
          191  +  return [string map [list <build> $buildName <platform> $platformName \
          192  +      <name> $name] $fileName]
   178    193   }
   179    194   
          195  +#
          196  +# NOTE: This is the entry point for this script.
          197  +#
   180    198   set script [file normalize [info script]]
   181    199   
   182    200   if {[string length $script] == 0} then {
   183    201     fail "script file currently being evaluated is unknown" true
   184    202   }
   185    203   
   186    204   set path [file dirname $script]
................................................................................
   188    206   
   189    207   ###############################################################################
   190    208   
   191    209   #
   192    210   # NOTE: Process and verify all the command line arguments.
   193    211   #
   194    212   set argc [llength $argv]
   195         -if {$argc != 1 && $argc != 2} then {fail}
          213  +if {$argc < 1 || $argc > 4} then {fail}
   196    214   
   197    215   set binaryDirectory [lindex $argv 0]
   198    216   
   199    217   if {[string length $binaryDirectory] == 0} then {
   200    218     fail "invalid binary directory"
   201    219   }
   202    220   
   203    221   if {![file exists $binaryDirectory] || \
   204    222       ![file isdirectory $binaryDirectory]} then {
   205    223     fail "binary directory does not exist"
   206    224   }
   207    225   
   208         -if {$argc == 2} then {
          226  +if {$argc >= 2} then {
   209    227     set sourceDirectory [lindex $argv 1]
   210    228   } else {
   211    229     #
   212    230     # NOTE: Assume that the source directory is the parent directory of the one
   213    231     #       that contains this script file.
   214    232     #
   215    233     set sourceDirectory [file dirname $path]
................................................................................
   219    237     fail "invalid source directory"
   220    238   }
   221    239   
   222    240   if {![file exists $sourceDirectory] || \
   223    241       ![file isdirectory $sourceDirectory]} then {
   224    242     fail "source directory does not exist"
   225    243   }
          244  +
          245  +if {$argc >= 3} then {
          246  +  set packageFlavor [lindex $argv 2]
          247  +} else {
          248  +  #
          249  +  # NOTE: Assume the package flavor is WinRT.
          250  +  #
          251  +  set packageFlavor WinRT
          252  +}
          253  +
          254  +if {[string length $packageFlavor] == 0} then {
          255  +  fail "invalid package flavor"
          256  +}
          257  +
          258  +if {[string equal -nocase $packageFlavor WinRT]} then {
          259  +  set shortName SQLite.WinRT
          260  +  set displayName "SQLite for Windows Runtime"
          261  +  set targetPlatformIdentifier Windows
          262  +  set extraSdkPath ""
          263  +  set extraFileListAttributes [appendArgs \
          264  +      "\r\n    " {AppliesTo="WindowsAppContainer"} \
          265  +      "\r\n    " {DependsOn="Microsoft.VCLibs, version=11.0"}]
          266  +} elseif {[string equal -nocase $packageFlavor WP80]} then {
          267  +  set shortName SQLite.WP80
          268  +  set displayName "SQLite for Windows Phone"
          269  +  set targetPlatformIdentifier "Windows Phone"
          270  +  set extraSdkPath "\\..\\$targetPlatformIdentifier"
          271  +  set extraFileListAttributes ""
          272  +} else {
          273  +  fail "unsupported package flavor, must be \"WinRT\" or \"WP80\""
          274  +}
          275  +
          276  +if {$argc >= 4} then {
          277  +  set platformNames [list]
          278  +
          279  +  foreach platformName [split [lindex $argv 3] ", "] {
          280  +    if {[string length $platformName] > 0} then {
          281  +      lappend platformNames $platformName
          282  +    }
          283  +  }
          284  +}
   226    285   
   227    286   ###############################################################################
   228    287   
   229    288   #
   230    289   # NOTE: Evaluate the user-specific customizations file, if it exists.
   231    290   #
   232    291   set userFile [file join $path [appendArgs \
................................................................................
   243    302   
   244    303   if {![file exists $templateFile] || \
   245    304       ![file isfile $templateFile]} then {
   246    305     fail [appendArgs "template file \"" $templateFile "\" does not exist"]
   247    306   }
   248    307   
   249    308   set currentDirectory [pwd]
   250         -set outputFile [file join $currentDirectory sqlite-output.vsix]
          309  +set outputFile [file join $currentDirectory sqlite-$packageFlavor-output.vsix]
   251    310   
   252    311   if {[file exists $outputFile]} then {
   253    312     fail [appendArgs "output file \"" $outputFile "\" already exists"]
   254    313   }
   255    314   
   256    315   ###############################################################################
   257    316   
................................................................................
   319    378     fail [appendArgs "cannot locate SQLITE_VERSION value in \"" \
   320    379         [file join $sourceDirectory sqlite3.h] \"]
   321    380   }
   322    381   
   323    382   ###############################################################################
   324    383   
   325    384   #
   326         -# NOTE: Setup all the master file list data.  This includes the source and
   327         -#       destination file names, build-neutral boolean flags, platform-neutral
   328         -#       boolean flags, and the dynamic content (subst) boolean flags.  There
   329         -#       is also one set of boolean flags per build configuration, currently
   330         -#       "Debug" and "Retail", that control which files are skipped for it.
          385  +# NOTE: Setup all the master file list data.  This includes the source file
          386  +#       names, the destination file names, and the file processing flags.  The
          387  +#       possible file processing flags are:
          388  +#
          389  +#       "buildNeutral" -- This flag indicates the file location and content do
          390  +#                         not depend on the build configuration.
          391  +#
          392  +#       "platformNeutral" -- This flag indicates the file location and content
          393  +#                            do not depend on the build platform.
          394  +#
          395  +#       "subst" -- This flag indicates that the file contains dynamic textual
          396  +#                  content that needs to be processed using [subst] prior to
          397  +#                  packaging the file into the final VSIX package.  The primary
          398  +#                  use of this flag is to insert the name of the VSIX package,
          399  +#                  some package flavor-specific value, or the SQLite version
          400  +#                  into a file.
          401  +#
          402  +#       "noDebug" -- This flag indicates that the file should be skipped when
          403  +#                    processing the debug build.
          404  +#
          405  +#       "noRetail" -- This flag indicates that the file should be skipped when
          406  +#                     processing the retail build.
          407  +#
          408  +#       "move" -- This flag indicates that the file should be moved from the
          409  +#                 source to the destination instead of being copied.
          410  +#
          411  +#       This file metadata may be overridden, either in whole or in part, via
          412  +#       the user-specific customizations file.
   331    413   #
   332    414   if {![info exists fileNames(source)]} then {
   333         -  set fileNames(source) [list "" "" "" \
   334         -      [file join $sourceDirectory sqlite3.h] \
   335         -      [file join $binaryDirectory <build> <platform> sqlite3.lib] \
   336         -      [file join $binaryDirectory <build> <platform> sqlite3.dll]]
          415  +  set fileNames(source) [list "" "" \
          416  +    [file join $stagingDirectory DesignTime <build> <platform> sqlite3.props] \
          417  +    [file join $sourceDirectory sqlite3.h] \
          418  +    [file join $binaryDirectory <build> <platform> sqlite3.lib] \
          419  +    [file join $binaryDirectory <build> <platform> sqlite3.dll]]
   337    420   
   338    421     if {![info exists no(symbols)]} then {
   339    422       lappend fileNames(source) \
   340    423           [file join $binaryDirectory <build> <platform> sqlite3.pdb]
   341    424     }
   342    425   }
   343    426   
   344    427   if {![info exists fileNames(destination)]} then {
   345    428     set fileNames(destination) [list \
   346         -      [file join $stagingDirectory extension.vsixmanifest] \
   347         -      [file join $stagingDirectory SDKManifest.xml] \
   348         -      [file join $stagingDirectory DesignTime <build> <platform> \
   349         -          SQLite.WinRT.props] \
   350         -      [file join $stagingDirectory DesignTime <build> <platform> sqlite3.h] \
   351         -      [file join $stagingDirectory DesignTime <build> <platform> sqlite3.lib] \
   352         -      [file join $stagingDirectory Redist <build> <platform> sqlite3.dll]]
          429  +    [file join $stagingDirectory extension.vsixmanifest] \
          430  +    [file join $stagingDirectory SDKManifest.xml] \
          431  +    [file join $stagingDirectory DesignTime <build> <platform> <name>.props] \
          432  +    [file join $stagingDirectory DesignTime <build> <platform> sqlite3.h] \
          433  +    [file join $stagingDirectory DesignTime <build> <platform> sqlite3.lib] \
          434  +    [file join $stagingDirectory Redist <build> <platform> sqlite3.dll]]
   353    435   
   354    436     if {![info exists no(symbols)]} then {
   355    437       lappend fileNames(destination) \
   356    438           [file join $stagingDirectory Redist <build> <platform> sqlite3.pdb]
   357    439     }
   358    440   }
   359    441   
   360         -if {![info exists fileNames(buildNeutral)]} then {
   361         -  set fileNames(buildNeutral) [list 1 1 1 1 0 0]
   362         -
   363         -  if {![info exists no(symbols)]} then {
   364         -    lappend fileNames(buildNeutral) 0
   365         -  }
   366         -}
   367         -
   368         -if {![info exists fileNames(platformNeutral)]} then {
   369         -  set fileNames(platformNeutral) [list 1 1 1 1 0 0]
          442  +if {![info exists fileNames(flags)]} then {
          443  +  set fileNames(flags) [list \
          444  +      [list buildNeutral platformNeutral subst] \
          445  +      [list buildNeutral platformNeutral subst] \
          446  +      [list buildNeutral platformNeutral subst move] \
          447  +      [list buildNeutral platformNeutral] \
          448  +      [list] [list] [list noRetail]]
   370    449   
   371    450     if {![info exists no(symbols)]} then {
   372         -    lappend fileNames(platformNeutral) 0
   373         -  }
   374         -}
   375         -
   376         -if {![info exists fileNames(subst)]} then {
   377         -  set fileNames(subst) [list 1 1 1 0 0 0]
   378         -
   379         -  if {![info exists no(symbols)]} then {
   380         -    lappend fileNames(subst) 0
   381         -  }
   382         -}
   383         -
   384         -if {![info exists fileNames(noDebug)]} then {
   385         -  set fileNames(noDebug) [list 0 0 0 0 0 0]
   386         -
   387         -  if {![info exists no(symbols)]} then {
   388         -    lappend fileNames(noDebug) 0
   389         -  }
   390         -}
   391         -
   392         -if {![info exists fileNames(noRetail)]} then {
   393         -  set fileNames(noRetail) [list 0 0 0 0 0 0]
   394         -
   395         -  if {![info exists no(symbols)]} then {
   396         -    lappend fileNames(noRetail) 1
          451  +    lappend fileNames(flags) [list noRetail]
   397    452     }
   398    453   }
   399    454   
   400    455   ###############################################################################
   401    456   
   402    457   #
   403         -# NOTE: Setup the list of builds supported by this script.
          458  +# NOTE: Setup the list of builds supported by this script.  These may be
          459  +#       overridden via the user-specific customizations file.
   404    460   #
   405    461   if {![info exists buildNames]} then {
   406    462     set buildNames [list Debug Retail]
   407    463   }
   408    464   
   409    465   ###############################################################################
   410    466   
   411    467   #
   412         -# NOTE: Setup the list of platforms supported by this script.
          468  +# NOTE: Setup the list of platforms supported by this script.  These may be
          469  +#       overridden via the command line or the user-specific customizations
          470  +#       file.
   413    471   #
   414    472   if {![info exists platformNames]} then {
   415    473     set platformNames [list x86 x64 ARM]
   416    474   }
   417    475   
   418    476   ###############################################################################
   419    477   
   420    478   #
   421    479   # NOTE: Make sure the staging directory exists, creating it if necessary.
   422    480   #
   423    481   file mkdir $stagingDirectory
   424    482   
   425    483   #
   426         -# NOTE: Build the Tcl command used to extract the template package to the
   427         -#       staging directory.
          484  +# NOTE: Build the Tcl command used to extract the template VSIX package to
          485  +#       the staging directory.
   428    486   #
   429    487   set extractCommand [list exec -- $unzip $templateFile -d $stagingDirectory]
   430    488   
   431    489   #
   432         -# NOTE: Extract the template package to the staging directory.
          490  +# NOTE: Extract the template VSIX package to the staging directory.
   433    491   #
   434    492   eval $extractCommand
   435    493   
   436    494   ###############################################################################
   437    495   
   438    496   #
   439         -# NOTE: Process each file in the master file list.  There are actually seven
          497  +# NOTE: Process each file in the master file list.  There are actually three
   440    498   #       parallel lists that contain the source file names, the destination file
   441         -#       names, the build-neutral flags, the platform-neutral flags, the
   442         -#       use-subst flags, the no-debug flags, and the no-retail flags.  If the
   443         -#       platform-neutral flag is non-zero, the file is not platform-specific.
   444         -#       If the build-neutral flag is non-zero, the file is not build-specific.
   445         -#       If the use-subst flag is non-zero, the file is considered to be a text
   446         -#       file that may contain Tcl variable and/or command replacements, to be
   447         -#       dynamically replaced during processing.  If the no-debug flag is
   448         -#       non-zero, the file will be skipped when processing for the debug build.
   449         -#       If the no-retail flag is non-zero, the file will be skipped when
   450         -#       processing for the retail build.  If the source file name is an empty
   451         -#       string, then the destination file name will be assumed to already exist
   452         -#       in the staging directory and will not be copied; however, dynamic
   453         -#       replacements may still be performed on the destination file prior to
   454         -#       the package being re-zipped.
          499  +#       names, and the file processing flags. If the "buildNeutral" flag is
          500  +#       present, the file location and content do not depend on the build
          501  +#       configuration and "CommonConfiguration" will be used in place of the
          502  +#       build configuration name.  If the "platformNeutral" flag is present,
          503  +#       the file location and content do not depend on the build platform and
          504  +#       "neutral" will be used in place of the build platform name.  If the
          505  +#       "subst" flag is present, the file is assumed to be a text file that may
          506  +#       contain Tcl variable, command, and backslash replacements, to be
          507  +#       dynamically replaced during processing using the Tcl [subst] command.
          508  +#       If the "noDebug" flag is present, the file will be skipped when
          509  +#       processing for the debug build.  If the "noRetail" flag is present, the
          510  +#       file will be skipped when processing for the retail build.  If the
          511  +#       "move" flag is present, the source file will be deleted after it is
          512  +#       copied to the destination file.  If the source file name is an empty
          513  +#       string, the destination file name will be assumed to already exist in
          514  +#       the staging directory and will not be copied; however, Tcl variable,
          515  +#       command, and backslash replacements may still be performed on the
          516  +#       destination file prior to the final VSIX package being built if the
          517  +#       "subst" flag is present.
   455    518   #
   456    519   foreach sourceFileName      $fileNames(source) \
   457    520           destinationFileName $fileNames(destination) \
   458         -        buildNeutral        $fileNames(buildNeutral) \
   459         -        platformNeutral     $fileNames(platformNeutral) \
   460         -        useSubst            $fileNames(subst) \
   461         -        noDebug             $fileNames(noDebug) \
   462         -        noRetail            $fileNames(noRetail) {
          521  +        fileFlags           $fileNames(flags) {
          522  +  #
          523  +  # NOTE: Process the file flags into separate boolean variables that may be
          524  +  #       used within the loop.
          525  +  #
          526  +  set isBuildNeutral [expr {[lsearch $fileFlags buildNeutral] != -1}]
          527  +  set isPlatformNeutral [expr {[lsearch $fileFlags platformNeutral] != -1}]
          528  +  set isMove [expr {[lsearch $fileFlags move] != -1}]
          529  +  set useSubst [expr {[lsearch $fileFlags subst] != -1}]
          530  +
   463    531     #
   464    532     # NOTE: If the current file is build-neutral, then only one build will
   465    533     #       be processed for it, namely "CommonConfiguration"; otherwise, each
   466    534     #       supported build will be processed for it individually.
   467    535     #
   468    536     foreach buildName \
   469         -      [expr {$buildNeutral ? [list CommonConfiguration] : $buildNames}] {
          537  +      [expr {$isBuildNeutral ? [list CommonConfiguration] : $buildNames}] {
   470    538       #
   471    539       # NOTE: Should the current file be skipped for this build?
   472    540       #
   473         -    if {[info exists no${buildName}] && [set no${buildName}]} then {
          541  +    if {[lsearch $fileFlags no${buildName}] != -1} then {
   474    542         continue
   475    543       }
   476    544   
   477    545       #
   478    546       # NOTE: If the current file is platform-neutral, then only one platform
   479    547       #       will be processed for it, namely "neutral"; otherwise, each
   480    548       #       supported platform will be processed for it individually.
   481    549       #
   482    550       foreach platformName \
   483         -        [expr {$platformNeutral ? [list neutral] : $platformNames}] {
          551  +        [expr {$isPlatformNeutral ? [list neutral] : $platformNames}] {
   484    552         #
   485    553         # NOTE: Use the actual platform name in the destination file name.
   486    554         #
   487         -      set newDestinationFileName [replaceBuildAndPlatform \
   488         -          $destinationFileName $buildName $platformName]
          555  +      set newDestinationFileName [replaceFileNameTokens $destinationFileName \
          556  +          $shortName $buildName $platformName]
   489    557   
   490    558         #
   491    559         # NOTE: Does the source file need to be copied to the destination file?
   492    560         #
   493    561         if {[string length $sourceFileName] > 0} then {
   494    562           #
   495    563           # NOTE: First, make sure the destination directory exists.
   496    564           #
   497    565           file mkdir [file dirname $newDestinationFileName]
   498    566   
   499    567           #
   500    568           # NOTE: Then, copy the source file to the destination file verbatim.
   501    569           #
   502         -        file copy [replaceBuildAndPlatform $sourceFileName $buildName \
   503         -            $platformName] $newDestinationFileName
          570  +        set newSourceFileName [replaceFileNameTokens $sourceFileName \
          571  +            $shortName $buildName $platformName]
          572  +
          573  +        file copy $newSourceFileName $newDestinationFileName
          574  +
          575  +        #
          576  +        # NOTE: If this is a move instead of a copy, delete the source file
          577  +        #       now.
          578  +        #
          579  +        if {$isMove} then {
          580  +          file delete $newSourceFileName
          581  +        }
   504    582         }
   505    583   
   506    584         #
   507    585         # NOTE: Does the destination file contain dynamic replacements that must
   508    586         #       be processed now?
   509    587         #
   510    588         if {$useSubst} then {
................................................................................
   524    602   # NOTE: Change the current directory to the staging directory so that the
   525    603   #       external archive building tool can pickup the necessary files using
   526    604   #       relative paths.
   527    605   #
   528    606   cd $stagingDirectory
   529    607   
   530    608   #
   531         -# NOTE: Build the Tcl command used to archive the final package in the
          609  +# NOTE: Build the Tcl command used to archive the final VSIX package in the
   532    610   #       output directory.
   533    611   #
   534    612   set archiveCommand [list exec -- $zip -r $outputFile *]
   535    613   
   536    614   #
   537         -# NOTE: Build the final package archive in the output directory.
          615  +# NOTE: Build the final VSIX package archive in the output directory.
   538    616   #
   539    617   eval $archiveCommand
   540    618   
   541    619   #
   542    620   # NOTE: Change back to the previously saved current directory.
   543    621   #
   544    622   cd $currentDirectory

Changes to tool/win/sqlite.vsix.

cannot compute difference between binary files