Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@@ -60,7 +60,7 @@ System.Runtime.Numerics System.Xml.XDocument System.Reflection.Extensions System
System.Diagnostics.FileVersionInfo System.Security.Cryptography.Primitives System.Security.Cryptography.Algorithms System.ValueTuple \
System.Text.Encoding.CodePages
build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS)
build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS) System.Text.RegularExpressions System.Diagnostics.Contracts
monodroid_SUBDIRS = $(monotouch_SUBDIRS)
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)

View File

@@ -1,25 +1 @@
The MIT X11 License covers most of the class libraries in the Mono
project. Some third party libraries come from different projects, and
are licensed under their own terms.
Copyright (c) 2001, 2002, 2003 The Mono Project
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
See LICENSE file in the project root for full license information.

View File

@@ -381,8 +381,7 @@ DISTFILES = \
MicrosoftAjaxLibrary/License.htm \
test-helpers/NetworkHelpers.cs \
test-helpers/SocketResponder.cs \
lib/$(monolite_dir)/mcs.exe \
$(monolite_files)
$(foreach HOST_PLATFORM,darwin linux win32,lib/$(monolite_dir)/mcs.exe $(monolite_files))
.PHONY: all-local $(STD_TARGETS:=-local)
all-local $(STD_TARGETS:=-local):
@@ -390,7 +389,7 @@ all-local $(STD_TARGETS:=-local):
all-local-aot:
monolite_dir := monolite/$(MONO_CORLIB_VERSION)
monolite_dir = monolite-$(HOST_PLATFORM)/$(MONO_CORLIB_VERSION)
# Files needed to bootstrap C# compiler
build_files = mscorlib.dll System.dll System.Xml.dll Mono.Security.dll System.Core.dll System.Security.dll System.Configuration.dll \
@@ -413,24 +412,42 @@ lib/$(monolite_dir)/Facades:
$(monolite_files): | lib/$(monolite_dir)
$(monolite_files): | lib/$(monolite_dir)/Facades
$(monolite_files): lib/$(monolite_dir)/%: lib/build/%
$(monolite_files): lib/$(monolite_dir)/%: lib/build-$(HOST_PLATFORM)/%
cp -p $< $@
lib/$(monolite_dir)/mcs.exe:
$(MAKE) -C ../mcs PROFILE=build
cp -p lib/build/mcs.exe lib/$(monolite_dir)
cp -p lib/build-$(HOST_PLATFORM)/mcs.exe lib/$(monolite_dir)
$(build_files:%=lib/build/%):
$(build_files:%=lib/build-$(HOST_PLATFORM)/%):
cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
dist-monolite: $(monolite_files) lib/$(monolite_dir)/mcs.exe
dist-monolite-all-platforms:
$(MAKE) dist-monolite HOST_PLATFORM=darwin
$(MAKE) dist-monolite HOST_PLATFORM=linux
$(MAKE) dist-monolite HOST_PLATFORM=win32
package-monolite-latest:
MONOLITE=monolite-$(MONO_CORLIB_VERSION)-latest; \
MONOLITE=monolite-$(HOST_PLATFORM)-$(MONO_CORLIB_VERSION)-latest; \
$(MAKE) dist-monolite monolite_dir=$$MONOLITE; \
tar zcvpf $$MONOLITE.tar.gz --directory=lib $$MONOLITE/
dist-default: dist-monolite
package-monolite-latest-all-platforms:
$(MAKE) package-monolite-latest HOST_PLATFORM=darwin
$(MAKE) package-monolite-latest HOST_PLATFORM=linux
$(MAKE) package-monolite-latest HOST_PLATFORM=win32
monolite_url = https://download.mono-project.com/monolite/monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest.tar.gz
get-monolite-latest:
-rm -fr lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
-mkdir -p lib/monolite-$(BUILD_PLATFORM)
cd lib && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
cd lib && mv -f monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
dist-default: dist-monolite-all-platforms
dist-local: dist-default

View File

@@ -4,6 +4,7 @@ Assembly/AssemblyInfo.cs
corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ArgumentObject.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Binder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderHelper.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpArgumentInfo.cs
@@ -36,6 +37,7 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/MessageID.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/UserStringBuilder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ExpressionTreeCallRewriter.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ICSharpBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ICSharpInvokeOrInvokeMemberBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ResetBindException.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinder.cs
@@ -45,22 +47,17 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderInternalCompilerException.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Binding/Better.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Binding/ErrorReporting.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BindingContextBase.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BindingContexts.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BindingContext.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BindingFlag.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BinOpArgInfo.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BinOpKind.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BinOpSig.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/CandidateFunctionMember.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ConstVal.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ConstValFactory.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversion.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversions.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/COperators.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/AggregateDeclaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/Declaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/GlobalAttributeDeclaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/NamespaceDeclaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExplicitConversion.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionKind.cs
@@ -74,20 +71,15 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinderResult.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ImplicitConversion.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/InputFile.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ITypeOrNamespace.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/LangCompiler.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MetadataToken.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodKind.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodTypeInferrer.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/NameGenerator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Nullable.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/NullableLift.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Operators.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/OriginalExpressions.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/PredefinedAttributes.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/PredefinedMembers.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/SemanticChecker.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/SubstitutionContext.cs
@@ -96,7 +88,6 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/EventSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/IndexerSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LabelSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LocalVariableSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodOrPropertySymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodSymbol.cs
@@ -114,13 +105,11 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolTable.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactory.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactoryBase.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TransparentIdentifierMemberSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TypeParameterSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/UnresolvedAggregateSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/VariableSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayIndex.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayInitialization.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayLength.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Assignment.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/BinaryOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Block.cs
@@ -130,14 +119,17 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Class.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/CompoundOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Concatenate.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ConditionalOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Constant.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Event.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/EXPR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExpressionIterator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExprOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExprWithType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Field.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/FieldInfo.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/HoistedLocal.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/IExprWithArgs.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/IExprWithObject.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/List.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/LocalVariable.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/MemberGroup.cs
@@ -149,10 +141,8 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Return.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Statement.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Temporary.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/This.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeArguments.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeOf.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeOrNamespace.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UnaryOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UnboundAnonymousFunction.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UserDefinedConversion.cs
@@ -186,7 +176,6 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/WithType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/SpecialNames.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/SymbolTable.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/KnownName.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/NameManager.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/Names.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/NameTable.cs

View File

@@ -20,9 +20,10 @@ TEST_LIB_REFS = System.Core
LIB_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
BUILT_SOURCES = $(PROFILE)-parser.cs
$(PROFILE)-parser.cs: $(topdir)/mcs/cs-parser.jay $(topdir)/jay/skeleton.cs
$(topdir)/jay/jay -c < $(topdir)/jay/skeleton.cs $< > $(PROFILE)-jay-tmp.out && mv $(PROFILE)-jay-tmp.out $@
include ../../build/library.make
$(topdir)/mcs/cs-parser.cs:
$(MAKE) -C $(topdir)/mcs cs-parser.cs
$(the_lib): $(topdir)/mcs/cs-parser.cs

View File

@@ -56,4 +56,3 @@ aot.cs
../../class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs
../../build/common/Consts.cs
../../tools/monop/outline.cs
../../mcs/cs-parser.cs

View File

@@ -1555,8 +1555,10 @@ namespace Mono.Data.Sqlite
while (rdIndexes.Read())
{
if (rdIndexes.IsDBNull(4) == false)
{
row["INDEX_DEFINITION"] = rdIndexes.GetString(4);
break;
break;
}
}
}

View File

@@ -1236,6 +1236,8 @@ namespace Mono.Debugger.Soft
bool res = ReceivePacket ();
if (!res)
break;
} catch (ThreadAbortException) {
break;
} catch (Exception ex) {
if (!closed) {
Console.WriteLine (ex);

View File

@@ -250,8 +250,8 @@ commands: Use `commands help` for usage.
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CommandSet (string suite, Converter&lt;string,string&gt; localizer = null, System.IO.TextWriter output = null, System.IO.TextWriter error = null);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string suite, class System.Converter`2&lt;string, string&gt; localizer, class System.IO.TextWriter output, class System.IO.TextWriter error) cil managed" />
<MemberSignature Language="C#" Value="public CommandSet (string suite, Converter&lt;string,string&gt; localizer = null);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string suite, class System.Converter`2&lt;string, string&gt; localizer) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
@@ -259,8 +259,6 @@ commands: Use `commands help` for usage.
<Parameters>
<Parameter Name="suite" Type="System.String" />
<Parameter Name="localizer" Type="System.Converter&lt;System.String,System.String&gt;" />
<Parameter Name="output" Type="System.IO.TextWriter" />
<Parameter Name="error" Type="System.IO.TextWriter" />
</Parameters>
<Docs>
<param name="suite">
@@ -272,15 +270,57 @@ commands: Use `commands help` for usage.
instance that will be used to translate strings.
If <see langword="null" />, then no localization is performed.
</param>
<summary>
Creates and initializes a new <c>CommandSet</c> instance.
</summary>
<remarks>
<para>
This constructor initializes
the <see cref="P:Mono.Options.CommandSet.Suite" /> property
of the new instance using <paramref name="suite" />,
the <see cref="P:Mono.Options.CommandSet.MessageLocalizer" /> property
of the new instance using <paramref name="localizer" />,
the <see cref="P:Mono.Options.CommandSet.Out" /> property
to <see cref="P:System.Console.Out" />, and
the <see cref="P:Mono.Options.CommandSet.Error" /> property
to <see cref="P:System.Console.Error" />.
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="suite" /> is <see langword="null" />.
</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CommandSet (string suite, System.IO.TextWriter output, System.IO.TextWriter error, Converter&lt;string,string&gt; localizer = null);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string suite, class System.IO.TextWriter output, class System.IO.TextWriter error, class System.Converter`2&lt;string, string&gt; localizer) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="suite" Type="System.String" />
<Parameter Name="output" Type="System.IO.TextWriter" />
<Parameter Name="error" Type="System.IO.TextWriter" />
<Parameter Name="localizer" Type="System.Converter&lt;System.String,System.String&gt;" />
</Parameters>
<Docs>
<param name="suite">
A <see cref="T:System.String" /> containing the name of the suite.
This value is used in default <c>help</c> text output.
</param>
<param name="output">
A <see cref="T:System.IO.TextWriter" /> where output messages will be
written to. If <see langword="null" />, then the
<see cref="P:System.Console.Out" /> property will be used.
written to.
</param>
<param name="error">
A <see cref="T:System.IO.TextWriter" /> where error messages will be
written to. If <see langword="null" />, then the
<see cref="P:System.Console.Error" /> property will be used.
written to.
</param>
<param name="localizer">
A <see cref="T:System.Converter{System.String,System.String}" />
instance that will be used to translate strings.
If <see langword="null" />, then no localization is performed.
</param>
<summary>
Creates and initializes a new <c>CommandSet</c> instance.
@@ -301,6 +341,12 @@ commands: Use `commands help` for usage.
<exception cref="T:System.ArgumentNullException">
<paramref name="suite" /> is <see langword="null" />.
</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="output" /> is <see langword="null" />.
</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="error" /> is <see langword="null" />.
</exception>
</Docs>
</Member>
<Member MemberName="Add">

View File

@@ -162,10 +162,10 @@ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Runtime.Serialization;
#if PCL
using System.Reflection;
#else
using System.Runtime.Serialization;
using System.Security.Permissions;
#endif
using System.Text;
@@ -634,7 +634,7 @@ namespace Mono.Options
public abstract string Description { get; }
public abstract bool GetArguments (string value, out IEnumerable<string> replacement);
#if !PCL
#if !PCL || NETSTANDARD1_3
public static IEnumerable<string> GetArgumentsFromFile (string file)
{
return GetArguments (File.OpenText (file), true);
@@ -690,7 +690,7 @@ namespace Mono.Options
}
}
#if !PCL
#if !PCL || NETSTANDARD1_3
public class ResponseFileSource : ArgumentSource {
public override string[] GetNames ()
@@ -1586,14 +1586,26 @@ namespace Mono.Options
internal OptionSet Options => options;
public CommandSet (string suite, MessageLocalizerConverter localizer = null, TextWriter output = null, TextWriter error = null)
#if !PCL || NETSTANDARD1_3
public CommandSet(string suite, MessageLocalizerConverter localizer = null)
: this(suite, Console.Out, Console.Error, localizer)
{
}
#endif
public CommandSet (string suite, TextWriter output, TextWriter error, MessageLocalizerConverter localizer = null)
{
if (suite == null)
throw new ArgumentNullException (nameof (suite));
if (output == null)
throw new ArgumentNullException (nameof (output));
if (error == null)
throw new ArgumentNullException (nameof (error));
this.suite = suite;
options = new CommandOptionSet (this, localizer);
outWriter = output ?? Console.Out;
errorWriter = error ?? Console.Error;
outWriter = output;
errorWriter = error;
}
public string Suite => suite;

View File

@@ -228,7 +228,7 @@ namespace MonoTests.Mono.Options
e.Run = (args) => e.CommandSet.Out.WriteLine (string.Join (" ", args));
var o = new StringWriter ();
var c = new CommandSet ("set", output:o) {
var c = new CommandSet ("set", output:o, error: Console.Error) {
e,
};
Assert.AreEqual (0, c.Run (new [] { "help", "echo" }));

View File

@@ -56,7 +56,7 @@ namespace MonoTests.Mono.Options
c, v => { string ignore = v.OptionValues [0]; });
c.Option = p [0];
Utils.AssertException (typeof(ArgumentOutOfRangeException),
"Specified argument was out of the range of valid values.\nParameter name: index",
$"Specified argument was out of the range of valid values.{Environment.NewLine}Parameter name: index",
c, v => { string ignore = v.OptionValues [2]; });
c.OptionName = "-a";
Utils.AssertException (typeof(OptionException),

View File

@@ -374,10 +374,10 @@ namespace MonoTests.Mono.Options
p, v => { v.Parse (_("-a", "-b")); });
Assert.AreEqual (a, "-b");
Utils.AssertException (typeof(ArgumentNullException),
"Value cannot be null.\nParameter name: option",
$"Value cannot be null.{Environment.NewLine}Parameter name: option",
p, v => { v.Add ((Option) null); });
Utils.AssertException (typeof(ArgumentNullException),
"Value cannot be null.\nParameter name: header",
$"Value cannot be null.{Environment.NewLine}Parameter name: header",
p, v => { v.Add ((string) null); });
// bad type
@@ -394,10 +394,10 @@ namespace MonoTests.Mono.Options
p, v => { v.Parse (_("-cz", "extra")); });
Utils.AssertException (typeof(ArgumentNullException),
"Value cannot be null.\nParameter name: action",
$"Value cannot be null.{Environment.NewLine}Parameter name: action",
p, v => { v.Add ("foo", (Action<string>) null); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide maxValueCount of 2 for OptionValueType.None.\nParameter name: maxValueCount",
$"Cannot provide maxValueCount of 2 for OptionValueType.None.{Environment.NewLine}Parameter name: maxValueCount",
p, v => { v.Add ("foo", (k, val) => {/* ignore */}); });
}
@@ -772,7 +772,7 @@ namespace MonoTests.Mono.Options
Utils.AssertException (typeof(ArgumentException), "prototypes must be null!",
p, v => { v.Add ("N|NUM=", (int n) => {}); });
Utils.AssertException (typeof(ArgumentNullException),
"Value cannot be null.\nParameter name: option",
$"Value cannot be null.{Environment.NewLine}Parameter name: option",
p, v => { v.GetOptionForName (null); });
}

View File

@@ -66,60 +66,60 @@ namespace MonoTests.Mono.Options
{
object p = null;
Utils.AssertException (typeof(ArgumentNullException),
"Value cannot be null.\nParameter name: prototype",
$"Value cannot be null.{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption (null, null); });
Utils.AssertException (typeof(ArgumentException),
"Cannot be the empty string.\nParameter name: prototype",
$"Cannot be the empty string.{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("", null); });
Utils.AssertException (typeof(ArgumentException),
"Empty option names are not supported.\nParameter name: prototype",
$"Empty option names are not supported.{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("a|b||c=", null); });
Utils.AssertException (typeof(ArgumentException),
"Conflicting option types: '=' vs. ':'.\nParameter name: prototype",
$"Conflicting option types: '=' vs. ':'.{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("a=|b:", null); });
Utils.AssertException (typeof(ArgumentException),
"The default option handler '<>' cannot require values.\nParameter name: prototype",
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("<>=", null); });
Utils.AssertException (typeof(ArgumentException),
"The default option handler '<>' cannot require values.\nParameter name: prototype",
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("<>:", null); });
Utils.AssertException (null, null,
p, v => { new DefaultOption ("t|<>=", null, 1); });
Utils.AssertException (typeof(ArgumentException),
"The default option handler '<>' cannot require values.\nParameter name: prototype",
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("t|<>=", null, 2); });
Utils.AssertException (null, null,
p, v => { new DefaultOption ("a|b=", null, 2); });
Utils.AssertException (typeof(ArgumentOutOfRangeException),
"Specified argument was out of the range of valid values.\nParameter name: maxValueCount",
$"Specified argument was out of the range of valid values.{Environment.NewLine}Parameter name: maxValueCount",
p, v => { new DefaultOption ("a", null, -1); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
"OptionValueType.Optional.\nParameter name: maxValueCount",
$"OptionValueType.Optional.{Environment.NewLine}Parameter name: maxValueCount",
p, v => { new DefaultOption ("a=", null, 0); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={\".\nParameter name: prototype",
"Ill-formed name/value separator found in \"a={\"." + Environment.NewLine + "Parameter name: prototype",
p, v => { new DefaultOption ("a={", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a=}\".\nParameter name: prototype",
"Ill-formed name/value separator found in \"a=}\"." + Environment.NewLine + "Parameter name: prototype",
p, v => { new DefaultOption ("a=}", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={{}}\".\nParameter name: prototype",
"Ill-formed name/value separator found in \"a={{}}\"." + Environment.NewLine + "Parameter name: prototype",
p, v => { new DefaultOption ("a={{}}", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={}}\".\nParameter name: prototype",
"Ill-formed name/value separator found in \"a={}}\"." + Environment.NewLine + "Parameter name: prototype",
p, v => { new DefaultOption ("a={}}", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={}{\".\nParameter name: prototype",
"Ill-formed name/value separator found in \"a={}{\"." + Environment.NewLine + "Parameter name: prototype",
p, v => { new DefaultOption ("a={}{", null); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("a==", null); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("a={}", null); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
p, v => { new DefaultOption ("a=+-*/", null); });
Utils.AssertException (null, null,
p, v => { new DefaultOption ("a", null, 0); });

View File

@@ -34,9 +34,16 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Permissions;
[assembly: AssemblyVersion (Consts.FxVersion)]
#if MONO_POSIX_NETSTANDARD_BUILD
[assembly: AssemblyVersion ("1.0.0.0")]
[assembly: AssemblyTitle("Mono.Posix.NETStandard.dll")]
#else
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: AssemblyTitle("Mono.Posix.dll")]
#endif
[assembly: AssemblyDescription("Unix Integration Classes")]
[assembly: CLSCompliant (true)]
@@ -48,9 +55,11 @@ using System.Security.Permissions;
*/
#if !MONO_POSIX_NETSTANDARD_BUILD
// We are using ../Open.snk for MONO_POSIX_NETSTANDARD_BUILD
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
#endif
/*
* TODO:
*

View File

@@ -309,6 +309,7 @@ namespace Mono.Unix.Native {
public delegate void SignalHandler (int signal);
#if !NETSTANDARD2_0
internal class XPrintfFunctions
{
internal delegate object XPrintf (object[] parameters);
@@ -335,6 +336,7 @@ namespace Mono.Unix.Native {
syslog = new XPrintf (_syslog.Invoke);
}
}
#endif
//
// Convention: Functions that are part of the C standard library go here.
@@ -378,7 +380,11 @@ namespace Mono.Unix.Native {
//
public class Stdlib
{
#if FORCE_USE_LIBC_NOT_MSVC
internal const string LIBC = "c";
#else
internal const string LIBC = "msvcrt";
#endif
internal const string MPH = "MonoPosixHelper";
// It is possible for Mono.Posix and MonoPosixHelper to get out of sync,
@@ -771,6 +777,7 @@ namespace Mono.Unix.Native {
return sys_fprintf (stream, "%s", message);
}
#if !NETSTANDARD2_0
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
"Use fprintf (IntPtr, string) instead.")]
public static int fprintf (IntPtr stream, string format, params object[] parameters)
@@ -781,6 +788,7 @@ namespace Mono.Unix.Native {
Array.Copy (parameters, 0, _parameters, 2, parameters.Length);
return (int) XPrintfFunctions.fprintf (_parameters);
}
#endif
/* SKIP: fscanf(3) */
@@ -793,6 +801,7 @@ namespace Mono.Unix.Native {
return sys_printf ("%s", message);
}
#if !NETSTANDARD2_0
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
"Use printf (string) instead.")]
public static int printf (string format, params object[] parameters)
@@ -802,6 +811,7 @@ namespace Mono.Unix.Native {
Array.Copy (parameters, 0, _parameters, 1, parameters.Length);
return (int) XPrintfFunctions.printf (_parameters);
}
#endif
/* SKIP: scanf(3) */
@@ -823,6 +833,7 @@ namespace Mono.Unix.Native {
return sys_snprintf (s, (ulong) s.Capacity, "%s", message);
}
#if !NETSTANDARD2_0
[CLSCompliant (false)]
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
"Use snprintf (StringBuilder, string) instead.")]
@@ -853,6 +864,7 @@ namespace Mono.Unix.Native {
Array.Copy (parameters, 0, _parameters, 3, parameters.Length);
return (int) XPrintfFunctions.snprintf (_parameters);
}
#endif
/*
* SKIP:

View File

@@ -1 +1 @@
4ae330d5b46f74420f5ed35603c04f4f6cae15fc
c750e5fa86b353b625f01b0f5d1227c6a43c4dc4

View File

@@ -300,17 +300,35 @@ public class UnixEncoding : Encoding
throw new ArgumentOutOfRangeException ("byteIndex", _("ArgRange_Array"));
}
unsafe {
fixed (char* p = s) {
fixed (byte* b = bytes) {
return GetBytes (p + charIndex, charCount, b + byteIndex, bytes.Length - byteIndex);
}
}
}
}
public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount)
{
if (bytes == null || chars == null)
throw new ArgumentNullException (bytes == null ? "bytes" : "chars");
if (charCount < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException (charCount < 0 ? "charCount" : "byteCount");
// Convert the characters into bytes.
char ch;
int length = bytes.Length;
int length = byteCount;
uint pair;
int posn = byteIndex;
int posn = 0;
int charIndex = 0;
while (charCount > 0) {
// Fetch the next UTF-16 character pair value.
ch = s[charIndex++];
ch = chars [charIndex++];
if (ch >= '\uD800' && ch <= '\uDBFF' && charCount > 1) {
// This may be the start of a surrogate pair.
pair = (uint)(s[charIndex]);
pair = (uint)(chars[charIndex]);
if (pair >= (uint)0xDC00 && pair <= (uint)0xDFFF) {
pair = (pair - (uint)0xDC00) +
((((uint)ch) - (uint)0xD800) << 10) +
@@ -326,7 +344,7 @@ public class UnixEncoding : Encoding
}
charCount -= 2;
if (charCount >= 0) {
bytes[posn++] = (byte) s [charIndex++];
bytes[posn++] = (byte)chars [charIndex++];
}
continue;
} else {
@@ -365,7 +383,7 @@ public class UnixEncoding : Encoding
}
// Return the final count to the caller.
return posn - byteIndex;
return posn;
}
// Internal version of "GetCharCount" which can handle a rolling
@@ -394,7 +412,7 @@ public class UnixEncoding : Encoding
uint leftSoFar = (leftOverCount & (uint)0x0F);
uint leftSize = ((leftOverCount >> 4) & (uint)0x0F);
while (count > 0) {
ch = (uint)(bytes[index++]);
ch = (uint)(bytes [index++]);
++next_raw;
--count;
if (leftSize == 0) {

View File

@@ -325,27 +325,42 @@ namespace Mono.Unix {
if (encoding == null)
throw new ArgumentNullException ("encoding");
int min_byte_count = encoding.GetMaxByteCount(1);
char[] copy = s.ToCharArray (index, count);
byte[] marshal = new byte [encoding.GetByteCount (copy) + min_byte_count];
if (index < 0 || count < 0)
throw new ArgumentOutOfRangeException ((index < 0 ? "index" : "count"),
"Non - negative number required.");
int bytes_copied = encoding.GetBytes (copy, 0, copy.Length, marshal, 0);
if (s.Length - index < count)
throw new ArgumentOutOfRangeException ("s", "Index and count must refer to a location within the string.");
if (bytes_copied != (marshal.Length-min_byte_count))
throw new NotSupportedException ("encoding.GetBytes() doesn't equal encoding.GetByteCount()!");
int null_terminator_count = encoding.GetMaxByteCount (1);
int length_without_null = encoding.GetByteCount (s);
int marshalLength = checked (length_without_null + null_terminator_count);
IntPtr mem = AllocHeap (marshal.Length);
IntPtr mem = AllocHeap (marshalLength);
if (mem == IntPtr.Zero)
throw new UnixIOException (Native.Errno.ENOMEM);
bool copied = false;
try {
Marshal.Copy (marshal, 0, mem, marshal.Length);
copied = true;
}
finally {
if (!copied)
FreeHeap (mem);
unsafe {
fixed (char* p = s) {
byte* marshal = (byte*)mem;
int bytes_copied;
try {
bytes_copied = encoding.GetBytes (p + index, count, marshal, marshalLength);
} catch {
FreeHeap (mem);
throw;
}
if (bytes_copied != length_without_null) {
FreeHeap (mem);
throw new NotSupportedException ("encoding.GetBytes() doesn't equal encoding.GetByteCount()!");
}
marshal += length_without_null;
for (int i = 0; i < null_terminator_count; ++i)
marshal[i] = 0;
}
}
return mem;

Some files were not shown because too many files have changed in this diff Show More