diff --git a/src/47-dotnet_Microsoft.VisualBasic.vbproj b/src/47-dotnet_Microsoft.VisualBasic.vbproj index c777fd67..a5ca5093 100644 --- a/src/47-dotnet_Microsoft.VisualBasic.vbproj +++ b/src/47-dotnet_Microsoft.VisualBasic.vbproj @@ -1595,6 +1595,7 @@ + diff --git a/src/ApplicationServices/Tools/Zip/UnZip.vb b/src/ApplicationServices/Tools/Zip/UnZip.vb index aa6e6d38..3950324f 100644 --- a/src/ApplicationServices/Tools/Zip/UnZip.vb +++ b/src/ApplicationServices/Tools/Zip/UnZip.vb @@ -58,7 +58,7 @@ Namespace ApplicationServices.Zip Private Sub ExtractToFileInternal(file As ZipArchiveEntry, destinationPath$, overwriteMethod As Overwrite, overridesFullName$) ' Gets the complete path for the destination file, including any ' relative paths that were in the zip file - Dim destinationFileName As String = Path.Combine(destinationPath, overridesFullName Or file.FullName.AsDefault) + Dim destinationFileName As String = Path.Combine(destinationPath, overridesFullName Or file.FullName.AsDefault).Replace("\", "/") ' Gets just the new path, minus the file name so we can create the ' directory if it does not exist diff --git a/src/ApplicationServices/Tools/Zip/ZipLib.vb b/src/ApplicationServices/Tools/Zip/ZipLib.vb index 3c969a7a..ba764fd4 100644 --- a/src/ApplicationServices/Tools/Zip/ZipLib.vb +++ b/src/ApplicationServices/Tools/Zip/ZipLib.vb @@ -185,7 +185,7 @@ Namespace ApplicationServices.Zip action:=action, fileOverwrite:=fileOverwrite, compression:=compression, - relativeDIR:=rel.Replace("/"c, "\"c).Trim("\"c) + relativeDir:=rel.Replace("/"c, "\"c).Trim("\"c) ) End Sub @@ -212,7 +212,7 @@ Namespace ApplicationServices.Zip Optional action As ArchiveAction = ArchiveAction.Replace, Optional fileOverwrite As Overwrite = Overwrite.IfNewer, Optional compression As CompressionLevel = CompressionLevel.Optimal, - Optional relativeDIR$ = Nothing) + Optional relativeDir$ = Nothing) 'Identifies the mode we will be using - the default is Create Dim mode As ZipArchiveMode = ZipArchiveMode.Create @@ -255,33 +255,46 @@ Namespace ApplicationServices.Zip 'Opens the zip file in the mode we specified Using zipFile As ZipArchive = IO.Compression.ZipFile.Open(archiveFullName, mode) - - 'This is a bit of a hack and should be refactored - I am - 'doing a similar foreach loop for both modes, but for Create - 'I am doing very little work while Update gets a lot of - 'code. This also does not handle any other mode (of - 'which there currently wouldn't be one since we don't - 'use Read here). - - If mode = ZipArchiveMode.Create Then - Dim entryName$ - - For Each path As String In files - ' Adds the file to the archive - If relativeDIR.StringEmpty Then - entryName = IO.Path.GetFileName(path) - Else - entryName = RelativePath(relativeDIR, path, appendParent:=False, fixZipPath:=True) - End If - - Call zipFile.CreateEntryFromFile(path, entryName, compression) - Next - Else - Call zipFile.AppendZip(files, fileOverwrite, compression) - End If + Call zipFile.WriteFiles(files, mode, fileOverwrite, compression, relativeDir) End Using End Sub + + Public Sub WriteFiles(zipFile As ZipArchive, files As String(), mode As ZipArchiveMode, + Optional fileOverwrite As Overwrite = Overwrite.IfNewer, + Optional compression As CompressionLevel = CompressionLevel.Optimal, + Optional relativeDir$ = Nothing, + Optional parent$ = "") + Dim entryName$ + Dim appendParent As Boolean = Not parent.StringEmpty + + 'This is a bit of a hack and should be refactored - I am + 'doing a similar foreach loop for both modes, but for Create + 'I am doing very little work while Update gets a lot of + 'code. This also does not handle any other mode (of + 'which there currently wouldn't be one since we don't + 'use Read here). + + If mode = ZipArchiveMode.Create Then + For Each path As String In files + ' Adds the file to the archive + If relativeDir.StringEmpty Then + entryName = IO.Path.GetFileName(path) + Else + entryName = RelativePath(relativeDir, path, appendParent:=False, fixZipPath:=True) + End If + + If appendParent Then + entryName = $"{parent}/{entryName}" + End If + + Call zipFile.CreateEntryFromFile(path, entryName, compression) + Next + Else + Call zipFile.AppendZip(files, fileOverwrite, compression) + End If + End Sub + Public Sub DeleteItems(zip As ZipArchive, itemNames As Index(Of String)) For Each file As ZipArchiveEntry In zip.Entries.ToArray diff --git a/src/ApplicationServices/VBDev/XmlDoc/Serialization/APIExtensions.vb b/src/ApplicationServices/VBDev/XmlDoc/Serialization/APIExtensions.vb index 16f1c3c2..c163534a 100644 --- a/src/ApplicationServices/VBDev/XmlDoc/Serialization/APIExtensions.vb +++ b/src/ApplicationServices/VBDev/XmlDoc/Serialization/APIExtensions.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::7298a9a30a05a1c83524147a5d214f5c, Microsoft.VisualBasic.Core\src\ApplicationServices\VBDev\XmlDoc\Serialization\APIExtensions.vb" +#Region "Microsoft.VisualBasic::fb72f54eaa8ba4e9e7131b990fac8694, Microsoft.VisualBasic.Core\src\ApplicationServices\VBDev\XmlDoc\Serialization\APIExtensions.vb" ' Author: ' @@ -78,7 +78,7 @@ Namespace ApplicationServices.Development.XmlDoc.Serialization Return path.LoadXml(Of Doc)(preprocess:=AddressOf TrimAssemblyDoc) Catch ex As Exception Call ex.PrintException - Throw ex + Throw End Try End Function diff --git a/src/ApplicationServices/VBDev/deps.json.vb b/src/ApplicationServices/VBDev/deps.json.vb new file mode 100644 index 00000000..76eab8e0 --- /dev/null +++ b/src/ApplicationServices/VBDev/deps.json.vb @@ -0,0 +1,109 @@ +#Region "Microsoft.VisualBasic::e907db9dccd723690dcf9bf8583b1c28, Microsoft.VisualBasic.Core\src\ApplicationServices\VBDev\deps.json.vb" + + ' Author: + ' + ' asuka (amethyst.asuka@gcmodeller.org) + ' xie (genetics@smrucc.org) + ' xieguigang (xie.guigang@live.com) + ' + ' Copyright (c) 2018 GPL3 Licensed + ' + ' + ' GNU GENERAL PUBLIC LICENSE (GPL3) + ' + ' + ' This program is free software: you can redistribute it and/or modify + ' it under the terms of the GNU General Public License as published by + ' the Free Software Foundation, either version 3 of the License, or + ' (at your option) any later version. + ' + ' This program is distributed in the hope that it will be useful, + ' but WITHOUT ANY WARRANTY; without even the implied warranty of + ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ' GNU General Public License for more details. + ' + ' You should have received a copy of the GNU General Public License + ' along with this program. If not, see . + + + + ' /********************************************************************************/ + + ' Summaries: + + ' Class deps + ' + ' Properties: compilationOptions, libraries, runtimeTarget, targets + ' + ' Function: GetReferenceProject + ' + ' Class target + ' + ' Properties: dependencies + ' + ' Class library + ' + ' Properties: hashPath, path, serviceable, sha512, type + ' + ' Class runtimeTarget + ' + ' Properties: name, signature + ' + ' Class compilationOptions + ' + ' + ' + ' + ' /********************************************************************************/ + +#End Region + +Namespace ApplicationServices.Development.NetCore5 + + ''' + ''' read deps.json for .net 5 assembly + ''' + Public Class deps + + Public Property runtimeTarget As runtimeTarget + Public Property compilationOptions As compilationOptions + Public Property targets As Dictionary(Of String, target) + Public Property libraries As Dictionary(Of String, library) + + ''' + ''' get list of project reference name + ''' + ''' + Public Function GetReferenceProject() As IEnumerable(Of String) + Return From entry As KeyValuePair(Of String, library) + In libraries + Let ref As library = entry.Value + Where ref.type = "project" + Select entry.Key.StringReplace("/\d+(\.\d+)+", "") + End Function + + End Class + + Public Class target + Public Property dependencies As Dictionary(Of String, String) + End Class + + Public Class library + Public Property type As String + Public Property serviceable As Boolean + Public Property sha512 As String + Public Property path As String + Public Property hashPath As String + End Class + + Public Class runtimeTarget + + Public Property name As String + Public Property signature As String + + End Class + + Public Class compilationOptions + + End Class +End Namespace diff --git a/src/CommandLine/Interpreters/Interpreter.vb b/src/CommandLine/Interpreters/Interpreter.vb index e8867da3..44c53fbf 100644 --- a/src/CommandLine/Interpreters/Interpreter.vb +++ b/src/CommandLine/Interpreters/Interpreter.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::4c046aa8570517f14bf0a1cf75656c15, Microsoft.VisualBasic.Core\src\CommandLine\Interpreters\Interpreter.vb" +#Region "Microsoft.VisualBasic::42c52a38848c2e10f4917161f505b1a9, Microsoft.VisualBasic.Core\src\CommandLine\Interpreters\Interpreter.vb" ' Author: ' @@ -165,6 +165,7 @@ Namespace CommandLine Catch ex As Exception Call App.LogException(ex) Call ex.PrintException + Call VBDebugger.WaitOutput() End Try #End If Return -100 diff --git a/src/Core.vbproj b/src/Core.vbproj index 1f703d61..501b3824 100644 --- a/src/Core.vbproj +++ b/src/Core.vbproj @@ -14,6 +14,8 @@ https://github.com/xieguigang/sciBASIC AnyCPU;x64 Debug;Release;Rsharp_app_release;LipidSearch + true + true @@ -56,7 +58,12 @@ Microsoft.VisualBasic.Core.xml - netcore5=1 + netcore5=1,UNIX=1 + true + false + true + full + false diff --git a/src/Extensions/Collection/Vector.vb b/src/Extensions/Collection/Vector.vb index 5bb554c0..1da1ff1f 100644 --- a/src/Extensions/Collection/Vector.vb +++ b/src/Extensions/Collection/Vector.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::098f1fd4fd20ce9c5885feff37043f7b, Microsoft.VisualBasic.Core\src\Extensions\Collection\Vector.vb" +#Region "Microsoft.VisualBasic::d11c1fee9f48da20a6ce6a913714ff23, Microsoft.VisualBasic.Core\src\Extensions\Collection\Vector.vb" ' Author: ' @@ -35,8 +35,8 @@ ' ' Function: (+2 Overloads) After, Append, Coalesce, (+3 Overloads) Delete, (+2 Overloads) Fill ' GetRange, IndexOf, Last, LoadAsNumericVector, MappingData - ' Midv, RepeatCalls, Replicate, SetValue, (+3 Overloads) Sort - ' Split, VectorShadows + ' Midv, PadLeft, RepeatCalls, Replicate, SetValue + ' (+3 Overloads) Sort, Split, VectorShadows ' ' Sub: (+4 Overloads) Add, InsertAt, (+2 Overloads) Memset ' diff --git a/src/Extensions/Doc/Text.vb b/src/Extensions/Doc/Text.vb index 1833f08f..5446a269 100644 --- a/src/Extensions/Doc/Text.vb +++ b/src/Extensions/Doc/Text.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::86bcb0110e10fb0520ceec29ecf382aa, Microsoft.VisualBasic.Core\src\Extensions\Doc\Text.vb" +#Region "Microsoft.VisualBasic::12eaaed1ab188b35efd09db49282f209, Microsoft.VisualBasic.Core\src\Extensions\Doc\Text.vb" ' Author: ' @@ -85,7 +85,7 @@ Public Module TextDoc Call App.LogException(New Exception(file.ToFileURL, ex)) If ThrowEx Then - Throw ex + Throw Else #If DEBUG Then Call ex.PrintException diff --git a/src/Extensions/IO/Extensions/PathExtensions.vb b/src/Extensions/IO/Extensions/PathExtensions.vb index 12b4893e..c4369f97 100644 --- a/src/Extensions/IO/Extensions/PathExtensions.vb +++ b/src/Extensions/IO/Extensions/PathExtensions.vb @@ -201,6 +201,8 @@ Public Module PathExtensions DIR = App.CurrentDirectory End If + DIR = DIR.Replace("\", "/") + Try Call FileIO.FileSystem.CreateDirectory(DIR) Catch ex As Exception diff --git a/src/Language/Value/Numeric/i32.vb b/src/Language/Value/Numeric/i32.vb index a46990c9..3ca15635 100644 --- a/src/Language/Value/Numeric/i32.vb +++ b/src/Language/Value/Numeric/i32.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::ee2ff91b50a4f6d0128e842c8fb9e689, Microsoft.VisualBasic.Core\src\Language\Value\Numeric\i32.vb" +#Region "Microsoft.VisualBasic::f85820ebea1d0c0fdc30b6a9ccf0a105, Microsoft.VisualBasic.Core\src\Language\Value\Numeric\i32.vb" ' Author: ' diff --git a/src/My/UNIX/LinuxRunHelper.vb b/src/My/UNIX/LinuxRunHelper.vb index 819bb4fc..7d3ba446 100644 --- a/src/My/UNIX/LinuxRunHelper.vb +++ b/src/My/UNIX/LinuxRunHelper.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::2d42fca8ee586f2cce1638dfe047aa7e, Microsoft.VisualBasic.Core\src\My\UNIX\LinuxRunHelper.vb" +#Region "Microsoft.VisualBasic::21638f79f2036bed92e6d7eb25b55352, Microsoft.VisualBasic.Core\src\My\UNIX\LinuxRunHelper.vb" ' Author: ' @@ -33,7 +33,8 @@ ' Module LinuxRunHelper ' - ' Function: BashRun, BashShell, GetLocationHelper, MonoRun, Shell + ' Function: BashRun, BashShell, GetLocationHelper, getRunnerBash, MonoRun + ' Shell ' ' ' /********************************************************************************/ diff --git a/src/Scripting/MetaData/Type.vb b/src/Scripting/MetaData/Type.vb index d2b663d0..3d5f7acb 100644 --- a/src/Scripting/MetaData/Type.vb +++ b/src/Scripting/MetaData/Type.vb @@ -125,8 +125,11 @@ Namespace Scripting.MetaData Dim path As Value(Of String) = "" Dim assm As Assembly = Nothing - For Each directory As String In searchPath.SafeQuery.JoinIterates(App.HOME) - If (path = $"{directory}/{Me.assembly}").FileExists Then + For Each filepath As String In searchPath.SafeQuery.JoinIterates(App.HOME) + If filepath.FileLength > 0 Then + assm = System.Reflection.Assembly.LoadFile(path) + Exit For + ElseIf (path = $"{filepath}/{Me.assembly}").FileExists Then assm = System.Reflection.Assembly.LoadFile(path) Exit For End If diff --git a/src/Text/ASCII.vb b/src/Text/ASCII.vb index c39f1cc7..3f88cae8 100644 --- a/src/Text/ASCII.vb +++ b/src/Text/ASCII.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::c22bffca1ea42371e306387a2c1426c3, Microsoft.VisualBasic.Core\src\Text\ASCII.vb" +#Region "Microsoft.VisualBasic::881e6714e9bf7f6ac8b9213348101130, Microsoft.VisualBasic.Core\src\Text\ASCII.vb" ' Author: ' @@ -35,7 +35,7 @@ ' ' Properties: AlphaNumericTable, Nonprintings, Symbols ' - ' Function: IsAsciiChar, IsASCIIString, IsNonPrinting, ReplaceQuot, TrimNonPrintings + ' Function: (+2 Overloads) IsAsciiChar, IsASCIIString, IsNonPrinting, ReplaceQuot, TrimNonPrintings ' Class [Byte] ' ' Function: GetASCIISymbols diff --git a/src/Text/Parser/HtmlParser/HtmlStrips.vb b/src/Text/Parser/HtmlParser/HtmlStrips.vb index fe344aa2..2aa27cec 100644 --- a/src/Text/Parser/HtmlParser/HtmlStrips.vb +++ b/src/Text/Parser/HtmlParser/HtmlStrips.vb @@ -1,4 +1,4 @@ -#Region "Microsoft.VisualBasic::3263a5aaebb0967d4032bb7151d75a3c, Microsoft.VisualBasic.Core\src\Text\Parser\HtmlParser\HtmlStrips.vb" +#Region "Microsoft.VisualBasic::450dd0eb3e616839e96d8fd2c0df00fb, Microsoft.VisualBasic.Core\src\Text\Parser\HtmlParser\HtmlStrips.vb" ' Author: ' @@ -390,7 +390,7 @@ Namespace Text.Parser.HtmlParser Catch ex As Exception When TypeOf ex Is TimeoutException Call App.LogException(ex, tags.GetJson) Catch ex As Exception - Throw ex + Throw End Try html = r.Replace(html, $"<{tag}.*?>", "", RegexICSng) diff --git a/test/devTest.vb b/test/devTest.vb new file mode 100644 index 00000000..0e886cfb --- /dev/null +++ b/test/devTest.vb @@ -0,0 +1,54 @@ +#Region "Microsoft.VisualBasic::4f293f9ee69b27a30f114327c367f006, Microsoft.VisualBasic.Core\test\devTest.vb" + + ' Author: + ' + ' asuka (amethyst.asuka@gcmodeller.org) + ' xie (genetics@smrucc.org) + ' xieguigang (xie.guigang@live.com) + ' + ' Copyright (c) 2018 GPL3 Licensed + ' + ' + ' GNU GENERAL PUBLIC LICENSE (GPL3) + ' + ' + ' This program is free software: you can redistribute it and/or modify + ' it under the terms of the GNU General Public License as published by + ' the Free Software Foundation, either version 3 of the License, or + ' (at your option) any later version. + ' + ' This program is distributed in the hope that it will be useful, + ' but WITHOUT ANY WARRANTY; without even the implied warranty of + ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ' GNU General Public License for more details. + ' + ' You should have received a copy of the GNU General Public License + ' along with this program. If not, see . + + + + ' /********************************************************************************/ + + ' Summaries: + + ' Module devTest + ' + ' Sub: Main + ' + ' /********************************************************************************/ + +#End Region + +Imports Microsoft.VisualBasic.ApplicationServices.Development.NetCore5 +Imports Microsoft.VisualBasic.Serialization.JSON + +Module devTest + + Sub Main() + Dim deps = "D:\GCModeller\src\R-sharp\App\net5.0\base.deps.json".LoadJsonFile(Of deps) + Dim ref = deps.GetReferenceProject.ToArray + + Pause() + End Sub +End Module + diff --git a/test/test.vbproj b/test/test.vbproj index 2de0ad65..755f6ac8 100644 --- a/test/test.vbproj +++ b/test/test.vbproj @@ -6,7 +6,7 @@ AnyCPU {8CDE6B49-9B2B-4A0E-8954-5A46E9AECB88} Exe - test.wgetTest + test.devTest test test 512 @@ -124,6 +124,7 @@ +