Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Pickup changes to Eagle script library in externals. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | netStandard20 |
Files: | files | file ages | folders |
SHA1: |
6aad7b515dd240b165377c01eef38365 |
User & Date: | mistachkin 2018-04-23 02:09:17.888 |
Context
2018-04-23
| ||
02:28 | When building with .NET Core, always use the 'Build' target to avoid issues with the final output file being superfluously deleted. check-in: 23f04e9da0 user: mistachkin tags: netStandard20 | |
02:09 | Pickup changes to Eagle script library in externals. check-in: 6aad7b515d user: mistachkin tags: netStandard20 | |
2018-04-18
| ||
15:59 | Merge updates from trunk. check-in: 5c1ed740db user: mistachkin tags: netStandard20 | |
Changes
Changes to Externals/Eagle/lib/Eagle1.0/csharp.eagle.
︙ | ︙ | |||
41 42 43 44 45 46 47 | # # NOTE: This procedure is used to determine the fully qualified path to the # directory containing the reference assemblies for the .NET Standard # 2.0. An empty string will be returned to indicate an error. This # procedure should not raise script errors. # proc getDotNetStandardReferencePath { | | | | > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > | > > > > | | < > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | # # NOTE: This procedure is used to determine the fully qualified path to the # directory containing the reference assemblies for the .NET Standard # 2.0. An empty string will be returned to indicate an error. This # procedure should not raise script errors. # proc getDotNetStandardReferencePath { {packageVersion ""} {standardVersion netstandard2.0} } { set path [getDotNetCoreSdkPath] if {[string length $path] > 0} then { set libraryDirectory [file normalize [file join \ [file dirname $path] NuGetFallbackFolder netstandard.library]] set buildReferenceSubDirectory [file join build $standardVersion ref] if {[string length $packageVersion] > 0} then { set assemblyDirectory [file normalize [file join \ $libraryDirectory $packageVersion $buildReferenceSubDirectory]] if {[file exists $assemblyDirectory]} then { return $assemblyDirectory } } else { set globPathPattern [file join $libraryDirectory *] set maybeVersions [lsort -decreasing -command [list package vsort] \ [lmap directory [glob -nocomplain -types {d} $globPathPattern] \ { file tail $directory }]] foreach maybeVersion $maybeVersions { set assemblyDirectory [file normalize [file join \ $libraryDirectory $maybeVersion $buildReferenceSubDirectory]] if {[file exists $assemblyDirectory]} then { return $assemblyDirectory } } } } return "" } # # NOTE: This procedure is used to obtain a test program for use with the # C# compiler. Upon success, the return value will be a list with # two elements. The first element will be the name of the C# class # to be compiled. The second element will be the C# program text. # Upon failure, the return value will be an empty list. # proc getCSharpTestProgram { {name ""} } { set prefix Test set id [object invoke Interpreter.GetActive NextId] set className [appendArgs \ $prefix Namespace $id [object invoke Type Delimiter] \ $prefix Class $id] return [list $className [subst { using System; namespace ${prefix}Namespace${id} { public static class ${prefix}Class${id} { public static Int32 Main(String\[\] args) { return 0; } } } }]] } # # NOTE: This procedure is used to determine whether the C# compiler appears # to work when invoked via the interfaces defined in this script file. # Non-zero is returned to indicate success. This procedure should not # raise script errors. # proc doesCompileCSharpWork { {name ""} } { if {[catch {getCSharpTestProgram $name} program]} then { return false } if {[llength $program] < 2} then { return false } unset -nocomplain results errors if {[catch { compileCSharp [lindex $program 1] true true true results errors } code]} then { return false } if {$code ne "Ok"} then { return false } if {[catch { object invoke [lindex $program 0] Main null } exitCode]} then { return false } if {$exitCode ne "0"} then { return false } return true } # # NOTE: This procedure is used to determine the command line arguments that # are required to invoke the .NET Core SDK compiler for C#. An empty # list will be returned if the arguments cannot be determined for some # reason -OR- the C# compiler cannot be found. This procedure should # not raise script errors. # proc getDotNetCoreCSharpCommandArgs {} { set path [getDotNetCoreSdkPath] if {[string length $path] > 0} then { set compilerFileName [file normalize [file join \ $path Roslyn bincore csc.dll]] if {[file exists $compilerFileName]} then { return [list dotnet exec [appendArgs \ \" [file nativename $compilerFileName] \"]] } } return [list] } # # NOTE: This procedure is used to format an option to the C# compiler. It |
︙ | ︙ | |||
103 104 105 106 107 108 109 | } # # NOTE: This procedure is used to translate a name/value pair into zero or # more options to the C# compiler. This procedure should not raise # script errors. # | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | } # # NOTE: This procedure is used to translate a name/value pair into zero or # more options to the C# compiler. This procedure should not raise # script errors. # proc compilerParameterToArguments { name {value ""} {outputAssemblyVarName ""} } { switch -exact -nocase -- $name { WarningLevel { set name -warn } TreatWarningsAsErrors { set name -warnaserror } OutputAssembly { if {[string length $outputAssemblyVarName] > 0} then { # # HACK: This compiler parameter is handled by our caller; however, # we want to honor the value specified via the OutputAssembly # property. Therefore, reset the specified variable from the # caller to the new value. # upvar 1 $outputAssemblyVarName outputAssembly # # NOTE: Use the file name value specified by the caller verbatim. # set outputAssembly $value # # HACK: Also, make sure that we do not handle this parameter again, # below. # set name ""; set value "" } else { # # BUGBUG: Translate the compiler parameter; however, this may not # actually work, depending on how our caller handles its # output assembly file name. At the time this block was # originally written (2018-04-09), the only caller (i.e. # [compileViaDotNetCoreCSharp]) always passed the output # assembly variable name, making this a non-issue. This # convention should also be followed by future callers of # this procedure. # set name -out } } ReferencedAssemblies.Add { set name -reference if {[file pathtype $value] ne "absolute"} then { set value [file nativename [file normalize \ [file join [getDotNetStandardReferencePath] \ |
︙ | ︙ | |||
246 247 248 249 250 251 252 253 254 255 256 257 258 259 | foreach char [split $value ""] { append result \\u [format %04X [string ordinal $char 0]] } return $result } # # NOTE: This procedure is used to extract the C# compiler error messages # from its results. An empty list will be returned if the errors # cannot be determined for some reason. This procedure should not # raise script errors. # | > > > > > > > > > > > > | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | foreach char [split $value ""] { append result \\u [format %04X [string ordinal $char 0]] } return $result } # # NOTE: This procedure is used to execute the C# compiler and returns its # platform normalized results. # proc runDotNetCSharpCommand { command } { # # NOTE: Evaluate the [exec] command constructed by our caller, in their # context, and return the results, with line-endings normalized. # return [string map [list \r\n \n] [uplevel 1 $command]] } # # NOTE: This procedure is used to extract the C# compiler error messages # from its results. An empty list will be returned if the errors # cannot be determined for some reason. This procedure should not # raise script errors. # |
︙ | ︙ | |||
497 498 499 500 501 502 503 | if {[string length $errorsVarName] > 0} then { upvar 1 $errorsVarName local_errors } # # NOTE: Append to the list of errors. # | | < < < < < < < > > > > > > > > > > > > | 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | if {[string length $errorsVarName] > 0} then { upvar 1 $errorsVarName local_errors } # # NOTE: Append to the list of errors. # lappend local_errors "cannot compile, C# compiler was not found" # # NOTE: Return the overall result to the caller. # return $code } # # NOTE: Insert the [exec] command before the command line arguments. # The -success option is not used here because we want to handle # errors (only) by processing the compiler output. # set command [linsert $command 0 exec --] # # NOTE: Start out the compiler options with the pre-existing defaults # for the compiler followed by those necessary for the platform. # append command " " [getCSharpCompilerOptions "" true true -] # # NOTE: Allocate a couple temporary file names, one to hold the source # code to compile and one to hold the generated assembly. # set sourceFileName [appendArgs [file tempname] .cs] set outputFileName [appendArgs [file tempname] .dll] # # NOTE: Process extra compiler settings the caller may have provided. # foreach {name value} $args { set nameValueArguments \ [compilerParameterToArguments $name $value outputFileName] if {[llength $nameValueArguments] > 0} then { eval lappend command $nameValueArguments } } try { # # NOTE: Make the compiler output a little quieter. This is needed # to maintain compatibility with the results generated by the # [compileViaCSharpCodeProvider] procedure. # |
︙ | ︙ | |||
587 588 589 590 591 592 593 | # # NOTE: Attempt to compile the temporary file as C# and capture the # results into the variable provided by the caller. Since the # results are text, normalize line endings before extracting # the compiler errors and/or warnings. # | | | 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | # # NOTE: Attempt to compile the temporary file as C# and capture the # results into the variable provided by the caller. Since the # results are text, normalize line endings before extracting # the compiler errors and/or warnings. # set local_results [runDotNetCSharpCommand $command] # # NOTE: Extract the compiler errors (which may be empty). # set errors [extractCSharpErrors $sourceFileName $local_results] # |
︙ | ︙ |
Changes to Externals/Eagle/lib/Eagle1.0/test.eagle.
︙ | ︙ | |||
3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 | "---- StringOps cleanup results: " $result \n] catch {uplevel 1 [list object invoke -flags +NonPublic \ Eagle._Comparers.FileName ClearCache]} result tputs $channel [appendArgs \ "---- Comparers.FileName cleanup results: " $result \n] } proc evalWithTimeout { script {milliseconds 2000} {resultVarName ""} } { # # NOTE: Verify that the number of milliseconds requested is greater than # zero. # | > > > > > > > > > > > > | 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 | "---- StringOps cleanup results: " $result \n] catch {uplevel 1 [list object invoke -flags +NonPublic \ Eagle._Comparers.FileName ClearCache]} result tputs $channel [appendArgs \ "---- Comparers.FileName cleanup results: " $result \n] catch {uplevel 1 [list object invoke -flags +NonPublic \ Eagle._Components.Private.HashOps Cleanup]} result tputs $channel [appendArgs \ "---- HashOps cleanup results: " $result \n] catch {uplevel 1 [list object invoke -flags +NonPublic \ Eagle._Components.Private.FactoryOps Cleanup]} result tputs $channel [appendArgs \ "---- FactoryOps cleanup results: " $result \n] } proc evalWithTimeout { script {milliseconds 2000} {resultVarName ""} } { # # NOTE: Verify that the number of milliseconds requested is greater than # zero. # |
︙ | ︙ |
Changes to Externals/Eagle/lib/Test1.0/constraints.eagle.
︙ | ︙ | |||
2944 2945 2946 2947 2948 2949 2950 | tputs $channel no\n } } proc checkForCompileCSharp { channel } { tputs $channel "---- checking for test use of C# compiler... " | | > | 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 | tputs $channel no\n } } proc checkForCompileCSharp { channel } { tputs $channel "---- checking for test use of C# compiler... " if {![info exists ::no(compileCSharp)] && \ [doesCompileCSharpWork]} then { addConstraint compileCSharp tputs $channel yes\n } else { tputs $channel no\n } } |
︙ | ︙ |
Changes to Externals/Eagle/lib/Test1.0/prologue.eagle.
︙ | ︙ | |||
184 185 186 187 188 189 190 | # the shell) and then into the "lib" directory just # beneath that. # set lib_path [file normalize [file join [file dirname $bin_path] lib]] } # | | | | < | | | < < < < < < < < < < < < < < < < < < < < < | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | # the shell) and then into the "lib" directory just # beneath that. # set lib_path [file normalize [file join [file dirname $bin_path] lib]] } # # NOTE: Set the location of the Eagle core library -OR- Tcl core # library file is located. This may be different than the # location of the (shell?) executable file. # if {![info exists core_bin_path]} then { # # NOTE: Attempt to obtain the information for the Eagle core # library assembly. This will not work for native Tcl. # if {[catch {info assembly} bin_dir] == 0} then { # # NOTE: Grab the directory for the core library assembly. # set core_bin_path [file dirname [lindex $bin_dir end]] } else { # # NOTE: This is native Tcl. There is no way to query the # path for the Tcl core library itself (e.g. "tcl*.dll", # "libtcl*.so", etc); however, using [info library] is # close enough. # set core_bin_path [file dirname [info library]] } unset bin_dir } # # NOTE: Set the location of the [non-script] library directory # (i.e. the directory where the plugins are located), if # necessary. This variant is based on where the Eagle # core library -OR- Tcl core library file is located. # if {![info exists core_lib_path]} then { # # NOTE: Start with the directory for the core library assembly. # set core_lib_path $core_bin_path # # NOTE: Perform a check for the .NET Core output directories # (e.g. "netcoreapp2.0", etc), which must be removed # if present, prior to further checks. # if {![info exists no(dotNetCoreLibPath)] && \ [string match net* [file tail $core_lib_path]]} then { # # NOTE: Remove the .NET Core output directory name. # set core_lib_path [file dirname $core_lib_path] } # # NOTE: Go up one level, to remove the "bin" directory and # then append the "lib" directory. This gives us the # final path we need. # set core_lib_path [file normalize \ [file join [file dirname $core_lib_path] lib]] } # # NOTE: Set the web host to test against, if necessary. # if {![info exists test_host]} then { set test_host eagle.to |
︙ | ︙ | |||
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 | $root_path \"\n] tputs $test_channel [appendArgs "---- binary path: \"" \ $bin_path \"\n] tputs $test_channel [appendArgs "---- library path: \"" \ $lib_path \"\n] tputs $test_channel [appendArgs "---- core library path: \"" \ $core_lib_path \"\n] tputs $test_channel [appendArgs "---- test suite files located in: \"" \ $test_all_path \"\n] | > > > | 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | $root_path \"\n] tputs $test_channel [appendArgs "---- binary path: \"" \ $bin_path \"\n] tputs $test_channel [appendArgs "---- library path: \"" \ $lib_path \"\n] tputs $test_channel [appendArgs "---- core binary path: \"" \ $core_bin_path \"\n] tputs $test_channel [appendArgs "---- core library path: \"" \ $core_lib_path \"\n] tputs $test_channel [appendArgs "---- test suite files located in: \"" \ $test_all_path \"\n] |
︙ | ︙ | |||
3203 3204 3205 3206 3207 3208 3209 | Plugin1.0] Plugin.dll] } # # NOTE: For test "object-6.1". # if {![info exists no(Sample.exe)]} then { | | | | | | | | | | > | 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 | Plugin1.0] Plugin.dll] } # # NOTE: For test "object-6.1". # if {![info exists no(Sample.exe)]} then { checkForFile $test_channel [file join $core_bin_path Sample.exe] } # # NOTE: For test "object-4.8". # if {![info exists no(EagleCmdlets.dll)]} then { checkForFile $test_channel [file join $core_bin_path EagleCmdlets.dll] } # # NOTE: For test "object-4.10". # if {![info exists no(EagleExtensions.dll)]} then { checkForFile $test_channel [file join $core_bin_path EagleExtensions.dll] } # # NOTE: For test "object-4.10". # if {![info exists no(test.wxs)]} then { checkForFile $test_channel [file join $base_path Installer Tests test.wxs] } # # NOTE: For tests "sql-1.2", "sql-1.4", "sql-1.5", "sql-1.6", "sql-1.7", # "sql-1.8", and "sql-1.9". # if {![info exists no(sqlite3.dll)]} then { checkForFile $test_channel [file join $core_bin_path sqlite3.dll] # # NOTE: Did we manage to find the native SQLite library? If not, do we # at least know the machine type? # if {![haveConstraint file_sqlite3.dll]} then { # # NOTE: Ok, now try to check for the machine specific native SQLite # library. # checkForFile $test_channel [file join $core_bin_path \ [machineToPlatform $test_machine true] sqlite3.dll] # # NOTE: Did we manage to find the native SQLite library yet? # if {![haveConstraint file_sqlite3.dll]} then { # # NOTE: Ok, now try to check for the platform specific native SQLite # library. # checkForFile $test_channel [file join $core_bin_path \ [machineToPlatform $test_machine false] sqlite3.dll] } } } if {![info exists no(System.Data.SQLite.dll)]} then { checkForFile $test_channel [file join $core_bin_path \ System.Data.SQLite.dll] } if {![info exists no(test.sqlite3)]} then { checkForFile $test_channel [file join $test_data_path test.sqlite3] } } |
︙ | ︙ |