update source file banners

This commit is contained in:
xieguigang 2021-01-12 20:24:38 +08:00
parent 7178beac27
commit 83cf4cec8d
17 changed files with 238 additions and 46 deletions

View File

@ -1595,6 +1595,7 @@
<Compile Include="ApplicationServices\Terminal\xConsole\Comparer.vb" />
<Compile Include="ApplicationServices\Terminal\xConsole\Spinner.vb" />
<Compile Include="ApplicationServices\Terminal\xConsole\CoolWriteSettings.vb" />
<Compile Include="ApplicationServices\VBDev\deps.json.vb" />
<Compile Include="CommandLine\CLI\ProcessEx.vb" />
<Compile Include="CommandLine\Parsers\CommandLineTokenlizer.vb" />
<Compile Include="CommandLine\Parsers\CliArgumentParsers.vb" />

View File

@ -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

View File

@ -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
<Extension>
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
<Extension>
Public Sub DeleteItems(zip As ZipArchive, itemNames As Index(Of String))
For Each file As ZipArchiveEntry In zip.Entries.ToArray

View File

@ -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

View File

@ -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 <http://www.gnu.org/licenses/>.
' /********************************************************************************/
' 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
''' <summary>
''' read deps.json for .net 5 assembly
''' </summary>
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)
''' <summary>
''' get list of project reference name
''' </summary>
''' <returns></returns>
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

View File

@ -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

View File

@ -14,6 +14,8 @@
<RepositoryUrl>https://github.com/xieguigang/sciBASIC</RepositoryUrl>
<Platforms>AnyCPU;x64</Platforms>
<Configurations>Debug;Release;Rsharp_app_release;LipidSearch</Configurations>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -56,7 +58,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DocumentationFile>Microsoft.VisualBasic.Core.xml</DocumentationFile>
<DefineConstants>netcore5=1</DefineConstants>
<DefineConstants>netcore5=1,UNIX=1</DefineConstants>
<RemoveIntegerChecks>true</RemoveIntegerChecks>
<Optimize>false</Optimize>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>false</DefineDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rsharp_app_release|x64'">

View File

@ -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
'

View File

@ -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

View File

@ -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

View File

@ -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:
'

View File

@ -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
'
'
' /********************************************************************************/

View File

@ -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

View File

@ -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

View File

@ -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)

54
test/devTest.vb Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
' /********************************************************************************/
' 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

View File

@ -6,7 +6,7 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8CDE6B49-9B2B-4A0E-8954-5A46E9AECB88}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>test.wgetTest</StartupObject>
<StartupObject>test.devTest</StartupObject>
<RootNamespace>test</RootNamespace>
<AssemblyName>test</AssemblyName>
<FileAlignment>512</FileAlignment>
@ -124,6 +124,7 @@
<Compile Include="LinqExpressiontest.vb" />
<Compile Include="indexTest.vb" />
<Compile Include="lapplyTest.vb" />
<Compile Include="devTest.vb" />
<Compile Include="sqltest.vb" />
<Compile Include="objToStringTest.vb" />
<Compile Include="wmfTest.vb" />