From 14b246fb9ab541649eb26046310ee6de14c0c408 Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Wed, 20 Jun 2018 11:34:42 +0200 Subject: [PATCH] [build] Version and strongname the Build.Tasks --- .nuspec/Xamarin.Forms.targets | 18 +- GitInfo.txt | 1 + Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs | 74 +- Xamarin.Forms.Build.Tasks/GetTasksAbi.cs | 14 - Xamarin.Forms.Build.Tasks/Logger.cs | 79 - .../Properties/AssemblyInfo.cs | 20 +- .../Xamarin.Forms.Build.Tasks.csproj | 51 +- Xamarin.Forms.Build.Tasks/XamlCTask.cs | 118 +- Xamarin.Forms.Build.Tasks/XamlTask.cs | 7 +- .../Properties/AssemblyInfo.cs | 5 +- .../Properties/GlobalAssemblyInfo.cs | 2 - .../Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 2 + .../Properties/AssemblyInfo.cs | 2 + .../Properties/AssemblyInfo.cs | 5 +- .../Properties/AssemblyInfo.cs | 7 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/.AssemblyInfo.cs.swp | Bin 0 -> 4096 bytes Xamarin.Forms.Maps/Properties/AssemblyInfo.cs | 5 +- .../Properties/AssemblyInfo.cs | 2 + .../Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 5 +- .../Properties/AssemblyInfo.cs | 5 +- .../Properties/AssemblyInfo.cs | 6 +- .../Properties/AssemblyInfo.cs | 8 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 5 +- .../Xamarin.Forms.Xaml.UnitTests.csproj | 2 +- .../Xamarin.Forms.Xaml.Xamlc.csproj | 98 -- Xamarin.Forms.Xaml.Xamlc/Xamlc.cs | 77 - Xamarin.Forms.Xaml.Xamlc/app.config | 3 - Xamarin.Forms.Xaml.Xamlc/packages.config | 18 - .../Mono.Options/Options.cs | 1490 ----------------- Xamarin.Forms.Xaml.Xamlg/Program.cs | 20 - .../Properties/AssemblyInfo.cs | 31 - .../Xamarin.Forms.Xaml.Xamlg.csproj | 96 -- Xamarin.Forms.Xaml.Xamlg/Xamlg.cs | 140 -- Xamarin.Forms.Xaml.Xamlg/app.config | 3 - Xamarin.Forms.Xaml.Xamlg/packages.config | 19 - Xamarin.Forms.Xaml/Properties/AssemblyInfo.cs | 6 +- Xamarin.Forms.sln | 55 - xamarin.forms.snk | Bin 0 -> 596 bytes 42 files changed, 213 insertions(+), 2302 deletions(-) create mode 100644 GitInfo.txt delete mode 100644 Xamarin.Forms.Build.Tasks/GetTasksAbi.cs delete mode 100644 Xamarin.Forms.Build.Tasks/Logger.cs create mode 100644 Xamarin.Forms.Maps/Properties/.AssemblyInfo.cs.swp delete mode 100644 Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj delete mode 100644 Xamarin.Forms.Xaml.Xamlc/Xamlc.cs delete mode 100644 Xamarin.Forms.Xaml.Xamlc/app.config delete mode 100644 Xamarin.Forms.Xaml.Xamlc/packages.config delete mode 100644 Xamarin.Forms.Xaml.Xamlg/Mono.Options/Options.cs delete mode 100644 Xamarin.Forms.Xaml.Xamlg/Program.cs delete mode 100644 Xamarin.Forms.Xaml.Xamlg/Properties/AssemblyInfo.cs delete mode 100644 Xamarin.Forms.Xaml.Xamlg/Xamarin.Forms.Xaml.Xamlg.csproj delete mode 100644 Xamarin.Forms.Xaml.Xamlg/Xamlg.cs delete mode 100644 Xamarin.Forms.Xaml.Xamlg/app.config delete mode 100644 Xamarin.Forms.Xaml.Xamlg/packages.config create mode 100644 xamarin.forms.snk diff --git a/.nuspec/Xamarin.Forms.targets b/.nuspec/Xamarin.Forms.targets index 2a5b2ecc60d..4b65b7b997c 100644 --- a/.nuspec/Xamarin.Forms.targets +++ b/.nuspec/Xamarin.Forms.targets @@ -1,9 +1,8 @@ - + - true @@ -26,25 +25,12 @@ true false - + - - - - - - - <_XFTasksExpectedAbi>5 - - - diff --git a/GitInfo.txt b/GitInfo.txt new file mode 100644 index 00000000000..944880fa15e --- /dev/null +++ b/GitInfo.txt @@ -0,0 +1 @@ +3.2.0 diff --git a/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs b/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs index 3ca00370724..2fc0abd03c3 100644 --- a/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs +++ b/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs @@ -2,14 +2,12 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Microsoft.Build.Framework; + using Mono.Cecil; using Mono.Cecil.Cil; -using Mono.Cecil.Mdb; -using Mono.Cecil.Pdb; using Mono.Cecil.Rocks; -using Xamarin.Forms.Xaml; +using static Microsoft.Build.Framework.MessageImportance; namespace Xamarin.Forms.Build.Tasks { @@ -18,28 +16,21 @@ public class DebugXamlCTask : XamlTask public override bool Execute(out IList thrownExceptions) { thrownExceptions = null; - Logger = Logger ?? new Logger(null); - Logger.LogLine(MessageImportance.Normal, "Preparing debug code for xamlc, assembly: {0}", Assembly); + LoggingHelper.LogMessage(Normal, $"{new string(' ', 0)}Preparing debug code for xamlc, assembly: {Assembly}"); var resolver = new DefaultAssemblyResolver(); - if (!string.IsNullOrEmpty(DependencyPaths)) - { - foreach (var dep in DependencyPaths.Split(';')) - { - Logger.LogLine(MessageImportance.Low, "Adding searchpath {0}", dep); + if (!string.IsNullOrEmpty(DependencyPaths)) { + foreach (var dep in DependencyPaths.Split(';')) { + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Adding searchpath {dep}"); resolver.AddSearchDirectory(dep); } } - if (!string.IsNullOrEmpty(ReferencePath)) - { + if (!string.IsNullOrEmpty(ReferencePath)) { var paths = ReferencePath.Replace("//", "/").Split(';'); - foreach (var p in paths) - { + foreach (var p in paths) { var searchpath = Path.GetDirectoryName(p); - Logger.LogLine(MessageImportance.Low, "Adding searchpath {0}", searchpath); + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Adding searchpath {searchpath}"); resolver.AddSearchDirectory(searchpath); - // LogLine (3, "Referencing {0}", p); - // resolver.AddAssembly (p); } } @@ -51,33 +42,31 @@ public override bool Execute(out IList thrownExceptions) AssemblyResolver = resolver })) { foreach (var module in assemblyDefinition.Modules) { - Logger.LogLine(MessageImportance.Low, " Module: {0}", module.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Module: {module.Name}"); foreach (var resource in module.Resources.OfType()) { - Logger.LogString(MessageImportance.Low, " Resource: {0}... ", resource.Name); - string classname; - if (!resource.IsXaml(module, out classname)) { - Logger.LogLine(MessageImportance.Low, "skipped."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 4)}Resource: {resource.Name}"); + if (!resource.IsXaml(module, out var classname)) { + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}skipped."); continue; - } else - Logger.LogLine(MessageImportance.Low, ""); + } TypeDefinition typeDef = module.GetType(classname); if (typeDef == null) { - Logger.LogLine(MessageImportance.Low, "no type found... skipped."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}no type found... skipped."); continue; } var initComp = typeDef.Methods.FirstOrDefault(md => md.Name == "InitializeComponent"); if (initComp == null) { - Logger.LogLine(MessageImportance.Low, "no InitializeComponent found... skipped."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}no InitializeComponent found... skipped."); continue; } var initCompRuntime = typeDef.Methods.FirstOrDefault(md => md.Name == "__InitComponentRuntime"); if (initCompRuntime == null) { - Logger.LogString(MessageImportance.Low, " Creating empty {0}.__InitComponentRuntime ...", typeDef.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Creating empty {typeDef.Name}.__InitComponentRuntime"); initCompRuntime = new MethodDefinition("__InitComponentRuntime", initComp.Attributes, initComp.ReturnType); initCompRuntime.Body.InitLocals = true; - Logger.LogLine(MessageImportance.Low, "done."); - Logger.LogString(MessageImportance.Low, " Copying body of InitializeComponent to __InitComponentRuntime ...", typeDef.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Copying body of InitializeComponent to __InitComponentRuntime"); initCompRuntime.Body = new MethodBody(initCompRuntime); var iCRIl = initCompRuntime.Body.GetILProcessor(); foreach (var instr in initComp.Body.Instructions) @@ -85,7 +74,7 @@ public override bool Execute(out IList thrownExceptions) initComp.Body.Instructions.Clear(); initComp.Body.GetILProcessor().Emit(OpCodes.Ret); typeDef.Methods.Add(initCompRuntime); - Logger.LogLine(MessageImportance.Low, "done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); } // IL_0000: ldarg.0 @@ -103,14 +92,13 @@ public override bool Execute(out IList thrownExceptions) // IL_0019: callvirt instance void class Xamarin.Forms.Xaml.XamlcTests.MyPage::__InitComponentRuntime() // IL_001e: ret - var altCtor = - typeDef.Methods.Where( - md => md.IsConstructor && md.Parameters.Count == 1 && md.Parameters[0].ParameterType == module.TypeSystem.Boolean) - .FirstOrDefault(); + var altCtor = typeDef.Methods.FirstOrDefault(md => md.IsConstructor + && md.Parameters.Count == 1 + && md.Parameters[0].ParameterType == module.TypeSystem.Boolean); if (altCtor != null) - Logger.LogString(MessageImportance.Low, " Replacing body of {0}.{0} (bool {1}) ... ", typeDef.Name, altCtor.Parameters[0].Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Replacing body of {typeDef.Name}.{typeDef.Name} (bool {altCtor.Parameters[0].Name})"); else { - Logger.LogString(MessageImportance.Low, " Adding {0}.{0} (bool useCompiledXaml) ... ", typeDef.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Adding {typeDef.Name}.{typeDef.Name} (bool useCompiledXaml)"); altCtor = new MethodDefinition(".ctor", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, module.TypeSystem.Void); @@ -118,8 +106,9 @@ public override bool Execute(out IList thrownExceptions) module.TypeSystem.Boolean)); } - var body = new MethodBody(altCtor); - body.InitLocals = true; + var body = new MethodBody(altCtor) { + InitLocals = true + }; var il = body.GetILProcessor(); var br2 = Instruction.Create(OpCodes.Ldarg_0); var ret = Instruction.Create(OpCodes.Ret); @@ -142,17 +131,16 @@ public override bool Execute(out IList thrownExceptions) altCtor.Body = body; if (!typeDef.Methods.Contains(altCtor)) typeDef.Methods.Add(altCtor); - Logger.LogLine(MessageImportance.Low, "done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); } - Logger.LogLine(MessageImportance.Low, ""); } - Logger.LogString(MessageImportance.Normal, "Writing the assembly... "); + LoggingHelper.LogMessage(Normal, $"{new string(' ', 0)}Writing the assembly."); assemblyDefinition.Write(new WriterParameters { WriteSymbols = debug }); } - Logger.LogLine(MessageImportance.Normal, "done."); + LoggingHelper.LogMessage(Normal, $"{new string(' ', 2)}done."); return true; } diff --git a/Xamarin.Forms.Build.Tasks/GetTasksAbi.cs b/Xamarin.Forms.Build.Tasks/GetTasksAbi.cs deleted file mode 100644 index 80c87266f4e..00000000000 --- a/Xamarin.Forms.Build.Tasks/GetTasksAbi.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Xamarin.Forms.Build.Tasks -{ - public class GetTasksAbi : Task - { - [Output] - public string AbiVersion { get; } = "5"; - - public override bool Execute() - => true; - } -} \ No newline at end of file diff --git a/Xamarin.Forms.Build.Tasks/Logger.cs b/Xamarin.Forms.Build.Tasks/Logger.cs deleted file mode 100644 index 87a0eef0912..00000000000 --- a/Xamarin.Forms.Build.Tasks/Logger.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Xml; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Xamarin.Forms.Xaml; - -namespace Xamarin.Forms.Build.Tasks -{ - public class Logger { - public TaskLoggingHelper Helper { get; } - - public Logger(TaskLoggingHelper helper) - { - Helper = helper; - } - - - public void LogException(string subcategory, string errorCode, string helpKeyword, string file, Exception e) - { - var xpe = e as XamlParseException; - var xe = e as XmlException; - if (xpe != null) - LogError(subcategory, errorCode, helpKeyword, file, xpe.XmlInfo.LineNumber, xpe.XmlInfo.LinePosition, 0, 0, xpe.Message, xpe.HelpLink, xpe.Source); - else if (xe != null) - LogError(subcategory, errorCode, helpKeyword, file, xe.LineNumber, xe.LinePosition, 0, 0, xe.Message, xe.HelpLink, xe.Source); - else - LogError(subcategory, errorCode, helpKeyword, file, 0, 0, 0, 0, e.Message, e.HelpLink, e.Source); - } - - public void LogError(string subcategory, string errorCode, string helpKeyword, string file, int lineNumber, - int columnNumber, int endLineNumber, int endColumnNumber, string message, params object [] messageArgs) - { - FlushBuffer(); - - if (Helper != null) { - Helper.LogError(subcategory, errorCode, helpKeyword, file, lineNumber, columnNumber, endLineNumber, - endColumnNumber, message, messageArgs); - } else - Console.Error.WriteLine($"{file} ({lineNumber}:{columnNumber}) : {message}"); - } - - public void LogLine(MessageImportance messageImportance, string format, params object [] arg) - { - if (!string.IsNullOrEmpty(buffer)) { - format = buffer + format; - buffer = ""; - bufferImportance = MessageImportance.Low; - } - - if (Helper != null) - Helper.LogMessage(messageImportance, format, arg); - else - Console.WriteLine(format, arg); - } - - public void LogString(MessageImportance messageImportance, string format, params object [] arg) - { - if (Helper != null) { - buffer += String.Format(format, arg); - bufferImportance = messageImportance; - } else - Console.Write(format, arg); - } - - string buffer = ""; - MessageImportance bufferImportance = MessageImportance.Low; - void FlushBuffer() - { - if (!string.IsNullOrEmpty(buffer)) { - if (Helper != null) - Helper.LogMessage(bufferImportance, buffer); - else - Console.WriteLine(buffer); - } - buffer = ""; - bufferImportance = MessageImportance.Low; - } - } -} \ No newline at end of file diff --git a/Xamarin.Forms.Build.Tasks/Properties/AssemblyInfo.cs b/Xamarin.Forms.Build.Tasks/Properties/AssemblyInfo.cs index d394c00a411..29baafd85c6 100644 --- a/Xamarin.Forms.Build.Tasks/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Build.Tasks/Properties/AssemblyInfo.cs @@ -1,12 +1,24 @@ using System.Reflection; using System.Runtime.CompilerServices; - [assembly: AssemblyTitle("Xamarin.Forms.Build.Tasks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] +[assembly: AssemblyFileVersion( + ThisAssembly.Git.BaseVersion.Major + "." + + ThisAssembly.Git.BaseVersion.Minor + "." + + ThisAssembly.Git.BaseVersion.Patch + "." + + ThisAssembly.Git.Commits)] + +[assembly: AssemblyInformationalVersion( + ThisAssembly.Git.BaseVersion.Major + "." + + ThisAssembly.Git.BaseVersion.Minor + "." + + ThisAssembly.Git.BaseVersion.Patch + "." + + ThisAssembly.Git.Commits + "-" + + ThisAssembly.Git.Branch + "+" + + ThisAssembly.Git.Commit)] -[assembly: InternalsVisibleTo("xamlg")] -[assembly: InternalsVisibleTo("xamlc")] -[assembly: InternalsVisibleTo("Xamarin.Forms.Xaml.UnitTests")] \ No newline at end of file +#if DEBUG +[assembly:InternalsVisibleTo("Xamarin.Forms.Xaml.UnitTests")] +#endif \ No newline at end of file diff --git a/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj b/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj index 93ae83a5ad1..474a51e4538 100644 --- a/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj +++ b/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj @@ -1,11 +1,22 @@  + + false + <_DisableStrongNamer>True + false + - - Xamarin.Forms.Build.Tasks - netstandard2.0 - false - true - + + <_DisableStrongNamer Condition=" '$(_DisableStrongNamer)' != 'True' ">False + Xamarin.Forms.Build.Tasks + netstandard2.0 + false + true + True + True + true + ..\xamarin.forms.snk + ..\xamarin.forms.snk + @@ -14,6 +25,8 @@ + + @@ -26,11 +39,31 @@ Properties\GlobalAssemblyInfo.cs - + + + sn + + + + + + + + + + + $([System.Text.RegularExpressions.Regex]::Replace('$(SnExe)', ';.*', '')) + + + + + + + + <_CopyItems Include="$(TargetDir)*.dll" /> - - + \ No newline at end of file diff --git a/Xamarin.Forms.Build.Tasks/XamlCTask.cs b/Xamarin.Forms.Build.Tasks/XamlCTask.cs index 2186bcbf534..3390de46cdd 100644 --- a/Xamarin.Forms.Build.Tasks/XamlCTask.cs +++ b/Xamarin.Forms.Build.Tasks/XamlCTask.cs @@ -2,14 +2,16 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Xml; +using Microsoft.Build.Framework; using Mono.Cecil; using Mono.Cecil.Cil; -using static Mono.Cecil.Cil.OpCodes; - using Xamarin.Forms.Xaml; -using Microsoft.Build.Framework; + +using static Microsoft.Build.Framework.MessageImportance; +using static Mono.Cecil.Cil.OpCodes; namespace Xamarin.Forms.Build.Tasks { @@ -34,45 +36,35 @@ public class XamlCTask : XamlTask public override bool Execute(out IList thrownExceptions) { thrownExceptions = null; - Logger = Logger ?? new Logger(null); - Logger.LogLine(MessageImportance.Normal, "Compiling Xaml, assembly: {0}", Assembly); + LoggingHelper.LogMessage(Normal, $"{new string(' ', 0)}Compiling Xaml, assembly: {Assembly}"); var skipassembly = !CompileByDefault; bool success = true; - if (!File.Exists(Assembly)) - { - Logger.LogLine(MessageImportance.Normal, "Assembly file not found. Skipping XamlC."); + if (!File.Exists(Assembly)) { + LoggingHelper.LogMessage(Normal, $"{new string(' ', 2)}Assembly file not found. Skipping XamlC."); return true; } var resolver = DefaultAssemblyResolver ?? new XamlCAssemblyResolver(); - var xamlCResolver = resolver as XamlCAssemblyResolver; - - if (xamlCResolver != null) - { - if (!string.IsNullOrEmpty(DependencyPaths)) - { - foreach (var dep in DependencyPaths.Split(';')) - { - Logger.LogLine(MessageImportance.Low, "Adding searchpath {0}", dep); + if (resolver is XamlCAssemblyResolver xamlCResolver) { + if (!string.IsNullOrEmpty(DependencyPaths)) { + foreach (var dep in DependencyPaths.Split(';')) { + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Adding searchpath {dep}"); xamlCResolver.AddSearchDirectory(dep); } } - if (!string.IsNullOrEmpty(ReferencePath)) - { + if (!string.IsNullOrEmpty(ReferencePath)) { var paths = ReferencePath.Replace("//", "/").Split(';'); - foreach (var p in paths) - { + foreach (var p in paths) { var searchpath = Path.GetDirectoryName(p); - Logger.LogLine(MessageImportance.Low, "Adding searchpath {0}", searchpath); + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Adding searchpath {searchpath}"); xamlCResolver.AddSearchDirectory(searchpath); } } } - else { - Logger.LogLine(MessageImportance.Low, "Ignoring dependency and reference paths due to an unsupported resolver"); - } + else + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Ignoring dependency and reference paths due to an unsupported resolver"); var debug = DebugSymbols || (!string.IsNullOrEmpty(DebugType) && DebugType.ToLowerInvariant() != "none"); @@ -108,18 +100,18 @@ public override bool Execute(out IList thrownExceptions) skipmodule = false; } - Logger.LogLine(MessageImportance.Low, " Module: {0}", module.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Module: {module.Name}"); var resourcesToPrune = new List(); foreach (var resource in module.Resources.OfType()) { - Logger.LogString(MessageImportance.Low, " Resource: {0}... ", resource.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 4)}Resource: {resource.Name}"); string classname; if (!resource.IsXaml(module, out classname)) { - Logger.LogLine(MessageImportance.Low, "skipped."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}skipped."); continue; } TypeDefinition typeDef = module.GetType(classname); if (typeDef == null) { - Logger.LogLine(MessageImportance.Low, "no type found... skipped."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}no type found... skipped."); continue; } var skiptype = skipmodule; @@ -138,16 +130,15 @@ public override bool Execute(out IList thrownExceptions) skiptype = !(Type == classname); if (skiptype && !ForceCompile) { - Logger.LogLine(MessageImportance.Low, "Has XamlCompilationAttribute set to Skip and not Compile... skipped"); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}has XamlCompilationAttribute set to Skip and not Compile... skipped."); continue; } var initComp = typeDef.Methods.FirstOrDefault(md => md.Name == "InitializeComponent"); if (initComp == null) { - Logger.LogLine(MessageImportance.Low, "no InitializeComponent found... skipped."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}no InitializeComponent found... skipped."); continue; } - Logger.LogLine(MessageImportance.Low, ""); CustomAttribute xamlFilePathAttr; var xamlFilePath = typeDef.HasCustomAttributes && (xamlFilePathAttr = typeDef.CustomAttributes.FirstOrDefault(ca => ca.AttributeType.FullName == "Xamarin.Forms.Xaml.XamlFilePathAttribute")) != null ? @@ -156,13 +147,13 @@ public override bool Execute(out IList thrownExceptions) var initCompRuntime = typeDef.Methods.FirstOrDefault(md => md.Name == "__InitComponentRuntime"); if (initCompRuntime != null) - Logger.LogLine(MessageImportance.Low, " __InitComponentRuntime already exists... not creating"); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}__InitComponentRuntime already exists... not creating"); else { - Logger.LogString(MessageImportance.Low, " Creating empty {0}.__InitComponentRuntime ...", typeDef.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Creating empty {typeDef.Name}.__InitComponentRuntime"); initCompRuntime = new MethodDefinition("__InitComponentRuntime", initComp.Attributes, initComp.ReturnType); initCompRuntime.Body.InitLocals = true; - Logger.LogLine(MessageImportance.Low, "done."); - Logger.LogString(MessageImportance.Low, " Copying body of InitializeComponent to __InitComponentRuntime ...", typeDef.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Copying body of InitializeComponent to __InitComponentRuntime"); initCompRuntime.Body = new MethodBody(initCompRuntime); var iCRIl = initCompRuntime.Body.GetILProcessor(); foreach (var instr in initComp.Body.Instructions) @@ -171,85 +162,86 @@ public override bool Execute(out IList thrownExceptions) initComp.Body.GetILProcessor().Emit(OpCodes.Ret); initComp.Body.InitLocals = true; typeDef.Methods.Add(initCompRuntime); - Logger.LogLine(MessageImportance.Low, "done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); } - Logger.LogString(MessageImportance.Low, " Parsing Xaml... "); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Parsing Xaml"); var rootnode = ParseXaml(resource.GetResourceStream(), typeDef); if (rootnode == null) { - Logger.LogLine(MessageImportance.Low, "failed."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}failed."); continue; } - Logger.LogLine(MessageImportance.Low, "done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); hasCompiledXamlResources = true; - Logger.LogString(MessageImportance.Low, " Replacing {0}.InitializeComponent ()... ", typeDef.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Replacing {0}.InitializeComponent ()"); Exception e; if (!TryCoreCompile(initComp, initCompRuntime, rootnode, out e)) { success = false; - Logger.LogLine(MessageImportance.Low, "failed."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}failed."); (thrownExceptions = thrownExceptions ?? new List()).Add(e); - Logger.LogException(null, null, null, xamlFilePath, e); - Logger.LogLine(MessageImportance.Low, e.StackTrace); + if (e is XamlParseException xpe) + LoggingHelper.LogError(null, null, null, xamlFilePath, xpe.XmlInfo.LineNumber, xpe.XmlInfo.LinePosition, 0, 0, xpe.Message, xpe.HelpLink, xpe.Source); + else if (e is XmlException xe) + LoggingHelper.LogError(null, null, null, xamlFilePath, xe.LineNumber, xe.LinePosition, 0, 0, xe.Message, xe.HelpLink, xe.Source); + else + LoggingHelper.LogError(null, null, null, xamlFilePath, 0, 0, 0, 0, e.Message, e.HelpLink, e.Source); + LoggingHelper.LogMessage(Low, e.StackTrace); continue; } if (Type != null) InitCompForType = initComp; - Logger.LogLine(MessageImportance.Low, "done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); if (OptimizeIL) { - Logger.LogString(MessageImportance.Low, " Optimizing IL... "); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Optimizing IL"); initComp.Body.Optimize(); - Logger.LogLine(MessageImportance.Low, "done"); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); } - Logger.LogLine(MessageImportance.Low, ""); - #pragma warning disable 0618 if (OutputGeneratedILAsCode) - Logger.LogLine(MessageImportance.Low, " Decompiling option has been removed. Use a 3rd party decompiler to admire the beauty of the IL generated"); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Decompiling option has been removed. Use a 3rd party decompiler to admire the beauty of the IL generated"); #pragma warning restore 0618 resourcesToPrune.Add(resource); } if (hasCompiledXamlResources) { - Logger.LogString(MessageImportance.Low, " Changing the module MVID..."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 4)}Changing the module MVID"); module.Mvid = Guid.NewGuid(); - Logger.LogLine(MessageImportance.Low, "done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}done."); } if (!KeepXamlResources) { if (resourcesToPrune.Any()) - Logger.LogLine(MessageImportance.Low, " Removing compiled xaml resources"); + LoggingHelper.LogMessage(Low, $"{new string(' ', 4)}Removing compiled xaml resources"); foreach (var resource in resourcesToPrune) { - Logger.LogString(MessageImportance.Low, " Removing {0}... ", resource.Name); + LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Removing {resource.Name}"); module.Resources.Remove(resource); - Logger.LogLine(MessageImportance.Low, "done"); + LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done."); } } - - Logger.LogLine(MessageImportance.Low, ""); } if (!hasCompiledXamlResources) { - Logger.LogLine(MessageImportance.Low, "No compiled resources. Skipping writing assembly."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 0)}No compiled resources. Skipping writing assembly."); return success; } if (ReadOnly) return success; - Logger.LogString(MessageImportance.Low, "Writing the assembly... "); + LoggingHelper.LogMessage(Low, $"{new string(' ', 0)}Writing the assembly"); try { assemblyDefinition.Write(new WriterParameters { WriteSymbols = debug, }); - Logger.LogLine(MessageImportance.Low, "done."); + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}done."); } catch (Exception e) { - Logger.LogLine(MessageImportance.Low, "failed."); - Logger.LogException(null, null, null, null, e); + LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}failed."); + LoggingHelper.LogErrorFromException(e); (thrownExceptions = thrownExceptions ?? new List()).Add(e); - Logger.LogLine(MessageImportance.Low, e.StackTrace); + LoggingHelper.LogMessage(Low, e.StackTrace); success = false; } } diff --git a/Xamarin.Forms.Build.Tasks/XamlTask.cs b/Xamarin.Forms.Build.Tasks/XamlTask.cs index 4f32d6d3c5b..b2a9e42b464 100644 --- a/Xamarin.Forms.Build.Tasks/XamlTask.cs +++ b/Xamarin.Forms.Build.Tasks/XamlTask.cs @@ -28,21 +28,18 @@ public abstract class XamlTask : MarshalByRefObject, ITask public bool DebugSymbols { get; set; } public string DebugType { get; set; } - TaskLoggingHelper _log; + protected TaskLoggingHelper LoggingHelper { get; } internal XamlTask() { - _log = new TaskLoggingHelper(this); + LoggingHelper = new TaskLoggingHelper(this); } public IBuildEngine BuildEngine { get; set; } public ITaskHost HostObject { get; set; } - protected Logger Logger { get; set; } - public bool Execute() { - Logger = new Logger(_log); IList _; return Execute(out _); } diff --git a/Xamarin.Forms.Core.Design/Properties/AssemblyInfo.cs b/Xamarin.Forms.Core.Design/Properties/AssemblyInfo.cs index 1c6cce84688..7c0e4baeaf7 100644 --- a/Xamarin.Forms.Core.Design/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Core.Design/Properties/AssemblyInfo.cs @@ -4,4 +4,7 @@ [assembly: AssemblyTitle ("Xamarin.Forms.Core.Design")] [assembly: AssemblyDescription ("Provides the design-time metadata for the XAML language service.")] -[assembly: ProvideMetadata (typeof (Xamarin.Forms.Core.Design.RegisterMetadata))] \ No newline at end of file +[assembly: ProvideMetadata (typeof (Xamarin.Forms.Core.Design.RegisterMetadata))] + +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Core/Properties/GlobalAssemblyInfo.cs b/Xamarin.Forms.Core/Properties/GlobalAssemblyInfo.cs index ee0870a0d4d..428dc250a13 100644 --- a/Xamarin.Forms.Core/Properties/GlobalAssemblyInfo.cs +++ b/Xamarin.Forms.Core/Properties/GlobalAssemblyInfo.cs @@ -4,5 +4,3 @@ [assembly: AssemblyProduct("Xamarin.Forms")] [assembly: AssemblyCopyright("Copyright © Xamarin Inc. 2013-2017")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Maps.Android/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps.Android/Properties/AssemblyInfo.cs index 2dc2947221e..452044770c6 100644 --- a/Xamarin.Forms.Maps.Android/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Maps.Android/Properties/AssemblyInfo.cs @@ -21,4 +21,6 @@ [assembly: UsesPermission(Manifest.Permission.Internet)] [assembly: UsesPermission(Manifest.Permission.WriteExternalStorage)] [assembly: ExportRenderer(typeof (Map), typeof (MapRenderer))] -[assembly: Preserve] \ No newline at end of file +[assembly: Preserve] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Maps.Design/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps.Design/Properties/AssemblyInfo.cs index f404023d59a..a303323fa81 100644 --- a/Xamarin.Forms.Maps.Design/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Maps.Design/Properties/AssemblyInfo.cs @@ -3,3 +3,5 @@ [assembly: AssemblyTitle("Xamarin.Forms.Maps.Design")] [assembly: AssemblyDescription("Provides the design-time metadata for the XAML language service.")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Maps.MacOS/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps.MacOS/Properties/AssemblyInfo.cs index 26a0c014347..e5e6417ecde 100644 --- a/Xamarin.Forms.Maps.MacOS/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Maps.MacOS/Properties/AssemblyInfo.cs @@ -14,3 +14,5 @@ [assembly: ExportRenderer(typeof(Map), typeof(MapRenderer))] [assembly: Preserve] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs index 2618cf7557b..af2356d5622 100644 --- a/Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Maps.Tizen/Properties/AssemblyInfo.cs @@ -1,5 +1,8 @@ -using Xamarin.Forms.Maps; +using System.Reflection; +using Xamarin.Forms.Maps; using Xamarin.Forms.Maps.Tizen; using Xamarin.Forms.Platform.Tizen; [assembly: ExportRenderer(typeof (Map), typeof (MapRenderer))] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Maps.UWP/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps.UWP/Properties/AssemblyInfo.cs index 581816391da..237f250567c 100644 --- a/Xamarin.Forms.Maps.UWP/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Maps.UWP/Properties/AssemblyInfo.cs @@ -1,5 +1,8 @@ -using Xamarin.Forms.Maps; +using System.Reflection; +using Xamarin.Forms.Maps; using Xamarin.Forms.Maps.UWP; using Xamarin.Forms.Platform.UWP; -[assembly: ExportRenderer(typeof (Map), typeof (MapRenderer))] \ No newline at end of file +[assembly: ExportRenderer(typeof (Map), typeof (MapRenderer))] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Maps.iOS/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps.iOS/Properties/AssemblyInfo.cs index 200928e37a0..61ec8052ab9 100644 --- a/Xamarin.Forms.Maps.iOS/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Maps.iOS/Properties/AssemblyInfo.cs @@ -23,4 +23,6 @@ [assembly: Guid("4a5d02cd-7350-46b6-bbd5-204b727c67c9")] [assembly: ExportRenderer(typeof(Map), typeof(MapRenderer))] -[assembly: Preserve] \ No newline at end of file +[assembly: Preserve] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Maps/Properties/.AssemblyInfo.cs.swp b/Xamarin.Forms.Maps/Properties/.AssemblyInfo.cs.swp new file mode 100644 index 0000000000000000000000000000000000000000..74e0fd286616fa245b7c89aa91f84d9d22587503 GIT binary patch literal 4096 zcmYc?2=nw+u+TGL00IF9hCf$yqBE!7Vf@O+z)+l00TLw$fa-K}lM3{5@{<#D@Tjf> zD%1}s%FjwoE-BWJNX$(v%FKh&dT#kexo}YkPtP~8pctg1AhoC@GqqUXvA8%jHz}vm zGcPS)FS!_xU87Q?Aut*O=pn$%U~FUv&g#laiVDI)q38-m`J*8)8UmvsFd71*Aut*O RqaiRF0;3@?8Un*O1OSlDE>{2m literal 0 HcmV?d00001 diff --git a/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs index c84e6c40a12..2cec9875e0b 100644 --- a/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs @@ -1,3 +1,6 @@ using Xamarin.Forms.Internals; +using System.Reflection; -[assembly: Preserve] \ No newline at end of file +[assembly: Preserve] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Platform.Android.FormsViewGroup/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.Android.FormsViewGroup/Properties/AssemblyInfo.cs index 9274d630904..24d3b861e36 100644 --- a/Xamarin.Forms.Platform.Android.FormsViewGroup/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Platform.Android.FormsViewGroup/Properties/AssemblyInfo.cs @@ -11,3 +11,5 @@ [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCulture ("")] [assembly: ComVisible (false)] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Platform.Android/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.Android/Properties/AssemblyInfo.cs index 854f0270bc6..5e89babcc82 100644 --- a/Xamarin.Forms.Platform.Android/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Platform.Android/Properties/AssemblyInfo.cs @@ -65,4 +65,6 @@ [assembly: ExportImageSourceHandler(typeof(UriImageSource), typeof(ImageLoaderSourceHandler))] [assembly: Xamarin.Forms.Dependency(typeof(Deserializer))] [assembly: Xamarin.Forms.Dependency(typeof(ResourcesProvider))] -[assembly: Preserve] \ No newline at end of file +[assembly: Preserve] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Platform.GTK/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.GTK/Properties/AssemblyInfo.cs index e2244c897fe..0c59dfba60d 100644 --- a/Xamarin.Forms.Platform.GTK/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Platform.GTK/Properties/AssemblyInfo.cs @@ -52,4 +52,7 @@ [assembly: ExportCell(typeof(Xamarin.Forms.TextCell), typeof(TextCellRenderer))] [assembly: ExportCell(typeof(Xamarin.Forms.ImageCell), typeof(ImageCellRenderer))] [assembly: ExportCell(typeof(Xamarin.Forms.SwitchCell), typeof(SwitchCellRenderer))] -[assembly: ExportCell(typeof(Xamarin.Forms.ViewCell), typeof(ViewCellRenderer))] \ No newline at end of file +[assembly: ExportCell(typeof(Xamarin.Forms.ViewCell), typeof(ViewCellRenderer))] + +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Platform.MacOS/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.MacOS/Properties/AssemblyInfo.cs index a9383ba384d..e802ad840b0 100644 --- a/Xamarin.Forms.Platform.MacOS/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Platform.MacOS/Properties/AssemblyInfo.cs @@ -50,4 +50,7 @@ [assembly: ExportCell(typeof(ImageCell), typeof(ImageCellRenderer))] [assembly: ExportCell(typeof(EntryCell), typeof(EntryCellRenderer))] [assembly: ExportCell(typeof(ViewCell), typeof(ViewCellRenderer))] -[assembly: ExportCell(typeof(SwitchCell), typeof(SwitchCellRenderer))] \ No newline at end of file +[assembly: ExportCell(typeof(SwitchCell), typeof(SwitchCellRenderer))] + +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Platform.Tizen/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.Tizen/Properties/AssemblyInfo.cs index e8ed1009acc..8eb7b8dcea1 100644 --- a/Xamarin.Forms.Platform.Tizen/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Platform.Tizen/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using Xamarin.Forms; using Xamarin.Forms.Platform.Tizen; +using System.Reflection; [assembly: Dependency(typeof(ResourcesProvider))] [assembly: Dependency(typeof(Deserializer))] @@ -47,4 +48,7 @@ [assembly: ExportHandler(typeof(TapGestureRecognizer), typeof(TapGestureHandler))] [assembly: ExportHandler(typeof(PinchGestureRecognizer), typeof(PinchGestureHandler))] -[assembly: ExportHandler(typeof(PanGestureRecognizer), typeof(PanGestureHandler))] \ No newline at end of file +[assembly: ExportHandler(typeof(PanGestureRecognizer), typeof(PanGestureHandler))] + +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs index adf21f1dbf7..dd785dc1a72 100644 --- a/Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Platform.UAP/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ -using Xamarin.Forms; +using System.Reflection; +using Xamarin.Forms; using Xamarin.Forms.Platform.UWP; @@ -50,4 +51,7 @@ [assembly: ExportCell(typeof(ViewCell), typeof(ViewCellRenderer))] [assembly: Dependency(typeof(WindowsResourcesProvider))] [assembly: ExportRenderer(typeof(SearchBar), typeof(SearchBarRenderer))] -[assembly: ExportRenderer(typeof(TabbedPage), typeof(TabbedPageRenderer))] \ No newline at end of file +[assembly: ExportRenderer(typeof(TabbedPage), typeof(TabbedPageRenderer))] + +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Platform.iOS/Properties/AssemblyInfo.cs b/Xamarin.Forms.Platform.iOS/Properties/AssemblyInfo.cs index 737f2c560a5..d6fd755027f 100644 --- a/Xamarin.Forms.Platform.iOS/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Platform.iOS/Properties/AssemblyInfo.cs @@ -67,4 +67,6 @@ [assembly: Xamarin.Forms.Dependency(typeof(Deserializer))] [assembly: Xamarin.Forms.Dependency(typeof(ResourcesProvider))] [assembly: ResolutionGroupName("Xamarin")] -[assembly: Preserve] \ No newline at end of file +[assembly: Preserve] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Design/Properties/AssemblyInfo.cs b/Xamarin.Forms.Xaml.Design/Properties/AssemblyInfo.cs index 3b978884471..368b407996e 100644 --- a/Xamarin.Forms.Xaml.Design/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Xaml.Design/Properties/AssemblyInfo.cs @@ -4,4 +4,7 @@ [assembly: AssemblyTitle("Xamarin.Forms.Xaml.Design")] [assembly: AssemblyDescription("Provides the design-time metadata for the XAML language service.")] -[assembly: ProvideMetadata(typeof (RegisterMetadata))] \ No newline at end of file +[assembly: ProvideMetadata(typeof (RegisterMetadata))] + +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj index bff70fbe6f5..768d741e9a1 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj +++ b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj @@ -1,7 +1,7 @@  - Debug + Debug AnyCPU {4B14D295-C09B-4C38-B880-7CC768E50585} Library diff --git a/Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj b/Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj deleted file mode 100644 index fc2a0d4c7b3..00000000000 --- a/Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF} - Exe - Xamarin.Forms.Xaml - v4.7 - - true - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - -r "../../../Xamarin.Forms.Controls/bin/Debug/" -p "../../../Xamarin.Forms.Xaml.UnitTest/bin/Debug/;/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5;/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Facades/" --keep -v 4 ../../../Xamarin.Forms.Xaml.UnitTests/bin/Debug/Xamarin.Forms.Xaml.UnitTests.dll - xamlc - true - true - - - full - true - bin\Release - prompt - 4 - true - xamlc - true - true - - - - ..\packages\Mono.Cecil.0.10.0-beta7\lib\net40\Mono.Cecil.dll - - - ..\packages\Mono.Cecil.0.10.0-beta7\lib\net40\Mono.Cecil.Mdb.dll - - - ..\packages\Mono.Cecil.0.10.0-beta7\lib\net40\Mono.Cecil.Pdb.dll - - - ..\packages\Mono.Cecil.0.10.0-beta7\lib\net40\Mono.Cecil.Rocks.dll - - - - - ..\packages\System.Linq.4.1.0\lib\net463\System.Linq.dll - - - - ..\packages\System.Runtime.4.1.0\lib\net462\System.Runtime.dll - - - - ..\packages\System.Runtime.InteropServices.4.1.0\lib\net462\System.Runtime.InteropServices.dll - - - ..\packages\System.Threading.Thread.4.0.0\lib\net46\System.Threading.Thread.dll - - - ..\packages\Microsoft.Build.Framework.15.5.180\lib\net46\Microsoft.Build.Framework.dll - - - ..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - - - ..\packages\Microsoft.Build.Utilities.Core.15.5.180\lib\net46\Microsoft.Build.Utilities.Core.dll - - - - - Mono.Options\Options.cs - - - - - - - - {96D89208-4EB9-4451-BE73-8A9DF3D9D7B7} - Xamarin.Forms.Build.Tasks - - - - - - - \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Xamlc/Xamlc.cs b/Xamarin.Forms.Xaml.Xamlc/Xamlc.cs deleted file mode 100644 index 169d6c3dc62..00000000000 --- a/Xamarin.Forms.Xaml.Xamlc/Xamlc.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using Mono.Options; -using Xamarin.Forms.Build.Tasks; - -namespace Xamarin.Forms.Xaml -{ - class Xamlc - { - static readonly string help_string = "xamlc.exe - a utility for compiling XAML into IL.\n" + - "xamlc.exe assembly\n\n"; - - public static void Main(string[] args) - { - bool help = false; - int verbosity = 1; - bool keep = false; - bool optimize = false; - string paths = null; - string refs = null; - List extra = null; - - var p = new OptionSet - { - { "h|?|help", "Print this help message", v => help = true }, - { "v=|verbosity=", "0 is quiet, 1 is normal, 2 is verbose", v => verbosity = Int32.Parse(v) }, - { "o|optimize", "Optimize generated IL", v => optimize = true }, - { "keep", "do not strip compiled embedded xaml", v => keep = true }, - { "p=|paths=|dependencypaths=", "look for dependencies in (comma separated) list of paths", v => paths = v }, - { "r=", "referencepath", v => refs = v }, - }; - - if (help || args.Length < 1) - { - ShowHelp(p); - Environment.Exit(0); - } - try - { - extra = p.Parse(args); - } - catch (OptionException) - { - Console.WriteLine("Type `xamlc --help' for more information."); - return; - } - - if (extra.Count == 0) - { - if (verbosity > 0) - { - Console.WriteLine("assembly missing"); - ShowHelp(p); - } - Environment.Exit(0); - } - - var assembly = extra[0]; - var xamlc = new XamlCTask { - Assembly = assembly, - KeepXamlResources = keep, - OptimizeIL = optimize, - DependencyPaths = paths, - ReferencePath = refs, - DebugSymbols = true, - }; - IList _; - xamlc.Execute(out _); - } - - static void ShowHelp(OptionSet ops) - { - Console.WriteLine(help_string); - ops.WriteOptionDescriptions(Console.Out); - } - } -} \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Xamlc/app.config b/Xamarin.Forms.Xaml.Xamlc/app.config deleted file mode 100644 index 245587d76fd..00000000000 --- a/Xamarin.Forms.Xaml.Xamlc/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Xamarin.Forms.Xaml.Xamlc/packages.config b/Xamarin.Forms.Xaml.Xamlc/packages.config deleted file mode 100644 index 331ff810fd1..00000000000 --- a/Xamarin.Forms.Xaml.Xamlc/packages.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Xamlg/Mono.Options/Options.cs b/Xamarin.Forms.Xaml.Xamlg/Mono.Options/Options.cs deleted file mode 100644 index b6e36c788c2..00000000000 --- a/Xamarin.Forms.Xaml.Xamlg/Mono.Options/Options.cs +++ /dev/null @@ -1,1490 +0,0 @@ -// -// Options.cs -// -// Authors: -// Jonathan Pryor -// Federico Di Gregorio -// -// Copyright (C) 2008 Novell (http://www.novell.com) -// Copyright (C) 2009 Federico Di Gregorio. -// -// 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. -// - -// Compile With: -// gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll -// gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll -// -// The LINQ version just changes the implementation of -// OptionSet.Parse(IEnumerable), and confers no semantic changes. - -// -// A Getopt::Long-inspired option parsing library for C#. -// -// NDesk.Options.OptionSet is built upon a key/value table, where the -// key is a option format string and the value is a delegate that is -// invoked when the format string is matched. -// -// Option format strings: -// Regex-like BNF Grammar: -// name: .+ -// type: [=:] -// sep: ( [^{}]+ | '{' .+ '}' )? -// aliases: ( name type sep ) ( '|' name type sep )* -// -// Each '|'-delimited name is an alias for the associated action. If the -// format string ends in a '=', it has a required value. If the format -// string ends in a ':', it has an optional value. If neither '=' or ':' -// is present, no value is supported. `=' or `:' need only be defined on one -// alias, but if they are provided on more than one they must be consistent. -// -// Each alias portion may also end with a "key/value separator", which is used -// to split option values if the option accepts > 1 value. If not specified, -// it defaults to '=' and ':'. If specified, it can be any character except -// '{' and '}' OR the *string* between '{' and '}'. If no separator should be -// used (i.e. the separate values should be distinct arguments), then "{}" -// should be used as the separator. -// -// Options are extracted either from the current option by looking for -// the option name followed by an '=' or ':', or is taken from the -// following option IFF: -// - The current option does not contain a '=' or a ':' -// - The current option requires a value (i.e. not a Option type of ':') -// -// The `name' used in the option format string does NOT include any leading -// option indicator, such as '-', '--', or '/'. All three of these are -// permitted/required on any named option. -// -// Option bundling is permitted so long as: -// - '-' is used to start the option group -// - all of the bundled options are a single character -// - at most one of the bundled options accepts a value, and the value -// provided starts from the next character to the end of the string. -// -// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value' -// as '-Dname=value'. -// -// Option processing is disabled by specifying "--". All options after "--" -// are returned by OptionSet.Parse() unchanged and unprocessed. -// -// Unprocessed options are returned from OptionSet.Parse(). -// -// Examples: -// int verbose = 0; -// OptionSet p = new OptionSet () -// .Add ("v", v => ++verbose) -// .Add ("name=|value=", v => Console.WriteLine (v)); -// p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); -// -// The above would parse the argument string array, and would invoke the -// lambda expression three times, setting `verbose' to 3 when complete. -// It would also print out "A" and "B" to standard output. -// The returned array would contain the string "extra". -// -// C# 3.0 collection initializers are supported and encouraged: -// var p = new OptionSet () { -// { "h|?|help", v => ShowHelp () }, -// }; -// -// System.ComponentModel.TypeConverter is also supported, allowing the use of -// custom data types in the callback type; TypeConverter.ConvertFromString() -// is used to convert the value option to an instance of the specified -// type: -// -// var p = new OptionSet () { -// { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) }, -// }; -// -// Random other tidbits: -// - Boolean options (those w/o '=' or ':' in the option format string) -// are explicitly enabled if they are followed with '+', and explicitly -// disabled if they are followed with '-': -// string a = null; -// var p = new OptionSet () { -// { "a", s => a = s }, -// }; -// p.Parse (new string[]{"-a"}); // sets v != null -// p.Parse (new string[]{"-a+"}); // sets v != null -// p.Parse (new string[]{"-a-"}); // sets v == null -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.IO; -using System.Runtime.Serialization; -using System.Security.Permissions; -using System.Text; -using System.Text.RegularExpressions; - -#if LINQ -using System.Linq; -#endif - -#if TEST -using NDesk.Options; -#endif - -#if NDESK_OPTIONS -namespace NDesk.Options -#else - -namespace Mono.Options -#endif -{ - internal static class StringCoda - { - public static IEnumerable WrappedLines(string self, params int[] widths) - { - IEnumerable w = widths; - return WrappedLines(self, w); - } - - public static IEnumerable WrappedLines(string self, IEnumerable widths) - { - if (widths == null) - throw new ArgumentNullException("widths"); - return CreateWrappedLinesIterator(self, widths); - } - - static IEnumerable CreateWrappedLinesIterator(string self, IEnumerable widths) - { - if (string.IsNullOrEmpty(self)) - { - yield return string.Empty; - yield break; - } - using (IEnumerator ewidths = widths.GetEnumerator()) - { - bool? hw = null; - int width = GetNextWidth(ewidths, int.MaxValue, ref hw); - int start = 0, end; - do - { - end = GetLineEnd(start, width, self); - char c = self[end - 1]; - if (char.IsWhiteSpace(c)) - --end; - bool needContinuation = end != self.Length && !IsEolChar(c); - string continuation = ""; - if (needContinuation) - { - --end; - continuation = "-"; - } - string line = self.Substring(start, end - start) + continuation; - yield return line; - start = end; - if (char.IsWhiteSpace(c)) - ++start; - width = GetNextWidth(ewidths, width, ref hw); - } while (start < self.Length); - } - } - - static int GetNextWidth(IEnumerator ewidths, int curWidth, ref bool? eValid) - { - if (!eValid.HasValue || (eValid.HasValue && eValid.Value)) - { - curWidth = (eValid = ewidths.MoveNext()).Value ? ewidths.Current : curWidth; - // '.' is any character, - is for a continuation - const string minWidth = ".-"; - if (curWidth < minWidth.Length) - { - throw new ArgumentOutOfRangeException("widths", - string.Format("Element must be >= {0}, was {1}.", minWidth.Length, curWidth)); - } - return curWidth; - } - // no more elements, use the last element. - return curWidth; - } - - static bool IsEolChar(char c) - { - return !char.IsLetterOrDigit(c); - } - - static int GetLineEnd(int start, int length, string description) - { - int end = System.Math.Min(start + length, description.Length); - int sep = -1; - for (int i = start; i < end; ++i) - { - if (description[i] == '\n') - return i + 1; - if (IsEolChar(description[i])) - sep = i + 1; - } - if (sep == -1 || end == description.Length) - return end; - return sep; - } - } - - public class OptionValueCollection : IList, IList - { - readonly OptionContext _c; - - readonly List _values = new List(); - - internal OptionValueCollection(OptionContext c) - { - _c = c; - } - - #region IEnumerable - - IEnumerator IEnumerable.GetEnumerator() - { - return _values.GetEnumerator(); - } - - #endregion - - #region IEnumerable - - public IEnumerator GetEnumerator() - { - return _values.GetEnumerator(); - } - - #endregion - - public List ToList() - { - return new List(_values); - } - - public string[] ToArray() - { - return _values.ToArray(); - } - - public override string ToString() - { - return string.Join(", ", _values.ToArray()); - } - - #region ICollection - - void ICollection.CopyTo(Array array, int index) - { - (_values as ICollection).CopyTo(array, index); - } - - bool ICollection.IsSynchronized - { - get { return (_values as ICollection).IsSynchronized; } - } - - object ICollection.SyncRoot - { - get { return (_values as ICollection).SyncRoot; } - } - - #endregion - - #region ICollection - - public void Add(string item) - { - _values.Add(item); - } - - public void Clear() - { - _values.Clear(); - } - - public bool Contains(string item) - { - return _values.Contains(item); - } - - public void CopyTo(string[] array, int arrayIndex) - { - _values.CopyTo(array, arrayIndex); - } - - public bool Remove(string item) - { - return _values.Remove(item); - } - - public int Count - { - get { return _values.Count; } - } - - public bool IsReadOnly - { - get { return false; } - } - - #endregion - - #region IList - - int IList.Add(object value) - { - return (_values as IList).Add(value); - } - - bool IList.Contains(object value) - { - return (_values as IList).Contains(value); - } - - int IList.IndexOf(object value) - { - return (_values as IList).IndexOf(value); - } - - void IList.Insert(int index, object value) - { - (_values as IList).Insert(index, value); - } - - void IList.Remove(object value) - { - (_values as IList).Remove(value); - } - - void IList.RemoveAt(int index) - { - (_values as IList).RemoveAt(index); - } - - bool IList.IsFixedSize - { - get { return false; } - } - - object IList.this[int index] - { - get { return this[index]; } - set { (_values as IList)[index] = value; } - } - - #endregion - - #region IList - - public int IndexOf(string item) - { - return _values.IndexOf(item); - } - - public void Insert(int index, string item) - { - _values.Insert(index, item); - } - - public void RemoveAt(int index) - { - _values.RemoveAt(index); - } - - void AssertValid(int index) - { - if (_c.Option == null) - throw new InvalidOperationException("OptionContext.Option is null."); - if (index >= _c.Option.MaxValueCount) - throw new ArgumentOutOfRangeException("index"); - if (_c.Option.OptionValueType == OptionValueType.Required && - index >= _values.Count) - { - throw new OptionException(string.Format( - _c.OptionSet.MessageLocalizer("Missing required value for option '{0}'."), _c.OptionName), - _c.OptionName); - } - } - - public string this[int index] - { - get - { - AssertValid(index); - return index >= _values.Count ? null : _values[index]; - } - set { _values[index] = value; } - } - - #endregion - } - - public class OptionContext - { - public OptionContext(OptionSet set) - { - OptionSet = set; - OptionValues = new OptionValueCollection(this); - } - - public Option Option { get; set; } - - public string OptionName { get; set; } - - public int OptionIndex { get; set; } - - public OptionSet OptionSet { get; } - - public OptionValueCollection OptionValues { get; } - } - - public enum OptionValueType - { - None, - Optional, - Required - } - - public abstract class Option - { - static readonly char[] NameTerminator = { '=', ':' }; - - protected Option(string prototype, string description) - : this(prototype, description, 1) - { - } - - protected Option(string prototype, string description, int maxValueCount) - { - if (prototype == null) - throw new ArgumentNullException("prototype"); - if (prototype.Length == 0) - throw new ArgumentException("Cannot be the empty string.", "prototype"); - if (maxValueCount < 0) - throw new ArgumentOutOfRangeException("maxValueCount"); - - Prototype = prototype; - Description = description; - MaxValueCount = maxValueCount; - Names = (this is OptionSet.Category) - // append GetHashCode() so that "duplicate" categories have distinct - // names, e.g. adding multiple "" categories should be valid. - ? new[] { prototype + GetHashCode() } - : prototype.Split('|'); - - if (this is OptionSet.Category) - return; - - OptionValueType = ParsePrototype(); - - if (MaxValueCount == 0 && OptionValueType != OptionValueType.None) - { - throw new ArgumentException( - "Cannot provide maxValueCount of 0 for OptionValueType.Required or " + - "OptionValueType.Optional.", - "maxValueCount"); - } - if (OptionValueType == OptionValueType.None && maxValueCount > 1) - { - throw new ArgumentException( - string.Format("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), - "maxValueCount"); - } - if (Array.IndexOf(Names, "<>") >= 0 && - ((Names.Length == 1 && OptionValueType != OptionValueType.None) || - (Names.Length > 1 && MaxValueCount > 1))) - { - throw new ArgumentException( - "The default option handler '<>' cannot require values.", - "prototype"); - } - } - - public string Prototype { get; } - - public string Description { get; } - - public OptionValueType OptionValueType { get; } - - public int MaxValueCount { get; } - - internal string[] Names { get; } - - internal string[] ValueSeparators { get; private set; } - - public string[] GetNames() - { - return (string[])Names.Clone(); - } - - public string[] GetValueSeparators() - { - if (ValueSeparators == null) - return new string[0]; - return (string[])ValueSeparators.Clone(); - } - - protected static T Parse(string value, OptionContext c) - { - Type tt = typeof (T); - bool nullable = tt.IsValueType && tt.IsGenericType && - !tt.IsGenericTypeDefinition && - tt.GetGenericTypeDefinition() == typeof (Nullable<>); - Type targetType = nullable ? tt.GetGenericArguments()[0] : typeof (T); - TypeConverter conv = TypeDescriptor.GetConverter(targetType); - T t = default(T); - try - { - if (value != null) - t = (T)conv.ConvertFromString(value); - } - catch (Exception e) - { - throw new OptionException( - string.Format( - c.OptionSet.MessageLocalizer("Could not convert string `{0}' to type {1} for option `{2}'."), - value, targetType.Name, c.OptionName), - c.OptionName, e); - } - return t; - } - - OptionValueType ParsePrototype() - { - char type = '\0'; - List seps = new List(); - for (int i = 0; i < Names.Length; ++i) - { - string name = Names[i]; - if (name.Length == 0) - throw new ArgumentException("Empty option names are not supported.", "prototype"); - - int end = name.IndexOfAny(NameTerminator); - if (end == -1) - continue; - Names[i] = name.Substring(0, end); - if (type == '\0' || type == name[end]) - type = name[end]; - else - { - throw new ArgumentException( - string.Format("Conflicting option types: '{0}' vs. '{1}'.", type, name[end]), - "prototype"); - } - AddSeparators(name, end, seps); - } - - if (type == '\0') - return OptionValueType.None; - - if (MaxValueCount <= 1 && seps.Count != 0) - { - throw new ArgumentException( - string.Format("Cannot provide key/value separators for Options taking {0} value(s).", MaxValueCount), - "prototype"); - } - if (MaxValueCount > 1) - { - if (seps.Count == 0) - ValueSeparators = new[] { ":", "=" }; - else if (seps.Count == 1 && seps[0].Length == 0) - ValueSeparators = null; - else - ValueSeparators = seps.ToArray(); - } - - return type == '=' ? OptionValueType.Required : OptionValueType.Optional; - } - - static void AddSeparators(string name, int end, ICollection seps) - { - int start = -1; - for (int i = end + 1; i < name.Length; ++i) - { - switch (name[i]) - { - case '{': - if (start != -1) - { - throw new ArgumentException( - string.Format("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - } - start = i + 1; - break; - case '}': - if (start == -1) - { - throw new ArgumentException( - string.Format("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - } - seps.Add(name.Substring(start, i - start)); - start = -1; - break; - default: - if (start == -1) - seps.Add(name[i].ToString()); - break; - } - } - if (start != -1) - { - throw new ArgumentException( - string.Format("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - } - } - - public void Invoke(OptionContext c) - { - OnParseComplete(c); - c.OptionName = null; - c.Option = null; - c.OptionValues.Clear(); - } - - protected abstract void OnParseComplete(OptionContext c); - - public override string ToString() - { - return Prototype; - } - } - - public abstract class ArgumentSource - { - public abstract string Description { get; } - - public abstract string[] GetNames(); - public abstract bool GetArguments(string value, out IEnumerable replacement); - - public static IEnumerable GetArgumentsFromFile(string file) - { - return GetArguments(File.OpenText(file), true); - } - - public static IEnumerable GetArguments(TextReader reader) - { - return GetArguments(reader, false); - } - - // Cribbed from mcs/driver.cs:LoadArgs(string) - static IEnumerable GetArguments(TextReader reader, bool close) - { - try - { - StringBuilder arg = new StringBuilder(); - - string line; - while ((line = reader.ReadLine()) != null) - { - int t = line.Length; - - for (int i = 0; i < t; i++) - { - char c = line[i]; - - if (c == '"' || c == '\'') - { - char end = c; - - for (i++; i < t; i++) - { - c = line[i]; - - if (c == end) - break; - arg.Append(c); - } - } - else if (c == ' ') - { - if (arg.Length > 0) - { - yield return arg.ToString(); - arg.Length = 0; - } - } - else - arg.Append(c); - } - if (arg.Length > 0) - { - yield return arg.ToString(); - arg.Length = 0; - } - } - } - finally - { - if (close) - reader.Close(); - } - } - } - - public class ResponseFileSource : ArgumentSource - { - public override string Description - { - get { return "Read response file for more options."; } - } - - public override string[] GetNames() - { - return new[] { "@file" }; - } - - public override bool GetArguments(string value, out IEnumerable replacement) - { - if (string.IsNullOrEmpty(value) || !value.StartsWith("@")) - { - replacement = null; - return false; - } - replacement = GetArgumentsFromFile(value.Substring(1)); - return true; - } - } - - [Serializable] - public class OptionException : Exception - { - public OptionException() - { - } - - public OptionException(string message, string optionName) - : base(message) - { - OptionName = optionName; - } - - public OptionException(string message, string optionName, Exception innerException) - : base(message, innerException) - { - OptionName = optionName; - } - - protected OptionException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - OptionName = info.GetString("OptionName"); - } - - public string OptionName { get; } - - [SecurityPermission(SecurityAction.LinkDemand, SerializationFormatter = true)] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue("OptionName", OptionName); - } - } - - public delegate void OptionAction(TKey key, TValue value); - - public class OptionSet : KeyedCollection - { - const int OptionWidth = 29; - const int DescriptionFirstWidth = 80 - OptionWidth; - const int DescriptionRemWidth = 80 - OptionWidth - 2; - - readonly List _sources = new List(); - - readonly Regex _valueOption = new Regex( - @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$"); - - public OptionSet() - : this(delegate(string f) { return f; }) - { - } - - public OptionSet(Converter localizer) - { - MessageLocalizer = localizer; - ArgumentSources = new ReadOnlyCollection(_sources); - } - - public Converter MessageLocalizer { get; } - - public ReadOnlyCollection ArgumentSources { get; } - - protected override string GetKeyForItem(Option item) - { - if (item == null) - throw new ArgumentNullException("option"); - if (item.Names != null && item.Names.Length > 0) - return item.Names[0]; - // This should never happen, as it's invalid for Option to be - // constructed w/o any names. - throw new InvalidOperationException("Option has no names!"); - } - - [Obsolete("GetOptionForName is obsolete as of 1.1.0. Please use KeyedCollection.this[string] instead.")] - protected Option GetOptionForName(string option) - { - if (option == null) - throw new ArgumentNullException("option"); - try - { - return base[option]; - } - catch (KeyNotFoundException) - { - return null; - } - } - - protected override void InsertItem(int index, Option item) - { - base.InsertItem(index, item); - AddImpl(item); - } - - protected override void RemoveItem(int index) - { - Option p = Items[index]; - base.RemoveItem(index); - // KeyedCollection.RemoveItem() handles the 0th item - for (int i = 1; i < p.Names.Length; ++i) - Dictionary.Remove(p.Names[i]); - } - - protected override void SetItem(int index, Option item) - { - base.SetItem(index, item); - AddImpl(item); - } - - void AddImpl(Option option) - { - if (option == null) - throw new ArgumentNullException("option"); - List added = new List(option.Names.Length); - try - { - // KeyedCollection.InsertItem/SetItem handle the 0th name. - for (int i = 1; i < option.Names.Length; ++i) - { - Dictionary.Add(option.Names[i], option); - added.Add(option.Names[i]); - } - } - catch (Exception) - { - foreach (string name in added) - Dictionary.Remove(name); - throw; - } - } - - public OptionSet Add(string header) - { - if (header == null) - throw new ArgumentNullException("header"); - Add(new Category(header)); - return this; - } - - public new OptionSet Add(Option option) - { - base.Add(option); - return this; - } - - public OptionSet Add(string prototype, Action action) - { - return Add(prototype, null, action); - } - - public OptionSet Add(string prototype, string description, Action action) - { - if (action == null) - throw new ArgumentNullException("action"); - Option p = new ActionOption(prototype, description, 1, - delegate(OptionValueCollection v) { action(v[0]); }); - base.Add(p); - return this; - } - - public OptionSet Add(string prototype, OptionAction action) - { - return Add(prototype, null, action); - } - - public OptionSet Add(string prototype, string description, OptionAction action) - { - if (action == null) - throw new ArgumentNullException("action"); - Option p = new ActionOption(prototype, description, 2, - delegate(OptionValueCollection v) { action(v[0], v[1]); }); - base.Add(p); - return this; - } - - public OptionSet Add(string prototype, Action action) - { - return Add(prototype, null, action); - } - - public OptionSet Add(string prototype, string description, Action action) - { - return Add(new ActionOption(prototype, description, action)); - } - - public OptionSet Add(string prototype, OptionAction action) - { - return Add(prototype, null, action); - } - - public OptionSet Add(string prototype, string description, OptionAction action) - { - return Add(new ActionOption(prototype, description, action)); - } - - public OptionSet Add(ArgumentSource source) - { - if (source == null) - throw new ArgumentNullException("source"); - _sources.Add(source); - return this; - } - - protected virtual OptionContext CreateOptionContext() - { - return new OptionContext(this); - } - - public List Parse(IEnumerable arguments) - { - if (arguments == null) - throw new ArgumentNullException("arguments"); - OptionContext c = CreateOptionContext(); - c.OptionIndex = -1; - bool process = true; - List unprocessed = new List(); - Option def = Contains("<>") ? this["<>"] : null; - ArgumentEnumerator ae = new ArgumentEnumerator(arguments); - foreach (string argument in ae) - { - ++c.OptionIndex; - if (argument == "--") - { - process = false; - continue; - } - if (!process) - { - Unprocessed(unprocessed, def, c, argument); - continue; - } - if (AddSource(ae, argument)) - continue; - if (!Parse(argument, c)) - Unprocessed(unprocessed, def, c, argument); - } - if (c.Option != null) - c.Option.Invoke(c); - return unprocessed; - } - - bool AddSource(ArgumentEnumerator ae, string argument) - { - foreach (ArgumentSource source in _sources) - { - IEnumerable replacement; - if (!source.GetArguments(argument, out replacement)) - continue; - ae.Add(replacement); - return true; - } - return false; - } - - static bool Unprocessed(ICollection extra, Option def, OptionContext c, string argument) - { - if (def == null) - { - extra.Add(argument); - return false; - } - c.OptionValues.Add(argument); - c.Option = def; - c.Option.Invoke(c); - return false; - } - - protected bool GetOptionParts(string argument, out string flag, out string name, out string sep, out string value) - { - if (argument == null) - throw new ArgumentNullException("argument"); - - flag = name = sep = value = null; - Match m = _valueOption.Match(argument); - if (!m.Success) - return false; - flag = m.Groups["flag"].Value; - name = m.Groups["name"].Value; - if (m.Groups["sep"].Success && m.Groups["value"].Success) - { - sep = m.Groups["sep"].Value; - value = m.Groups["value"].Value; - } - return true; - } - - protected virtual bool Parse(string argument, OptionContext c) - { - if (c.Option != null) - { - ParseValue(argument, c); - return true; - } - - string f, n, s, v; - if (!GetOptionParts(argument, out f, out n, out s, out v)) - return false; - - Option p; - if (Contains(n)) - { - p = this[n]; - c.OptionName = f + n; - c.Option = p; - switch (p.OptionValueType) - { - case OptionValueType.None: - c.OptionValues.Add(n); - c.Option.Invoke(c); - break; - case OptionValueType.Optional: - case OptionValueType.Required: - ParseValue(v, c); - break; - } - return true; - } - // no match; is it a bool option? - if (ParseBool(argument, n, c)) - return true; - // is it a bundled option? - if (ParseBundledValue(f, string.Concat(n + s + v), c)) - return true; - - return false; - } - - void ParseValue(string option, OptionContext c) - { - if (option != null) - { - foreach (string o in c.Option.ValueSeparators != null - ? option.Split(c.Option.ValueSeparators, c.Option.MaxValueCount - c.OptionValues.Count, StringSplitOptions.None) - : new[] { option }) - c.OptionValues.Add(o); - } - if (c.OptionValues.Count == c.Option.MaxValueCount || - c.Option.OptionValueType == OptionValueType.Optional) - c.Option.Invoke(c); - else if (c.OptionValues.Count > c.Option.MaxValueCount) - { - throw new OptionException(MessageLocalizer(string.Format( - "Error: Found {0} option values when expecting {1}.", - c.OptionValues.Count, c.Option.MaxValueCount)), - c.OptionName); - } - } - - bool ParseBool(string option, string n, OptionContext c) - { - Option p; - string rn; - if (n.Length >= 1 && (n[n.Length - 1] == '+' || n[n.Length - 1] == '-') && - Contains((rn = n.Substring(0, n.Length - 1)))) - { - p = this[rn]; - string v = n[n.Length - 1] == '+' ? option : null; - c.OptionName = option; - c.Option = p; - c.OptionValues.Add(v); - p.Invoke(c); - return true; - } - return false; - } - - bool ParseBundledValue(string f, string n, OptionContext c) - { - if (f != "-") - return false; - for (int i = 0; i < n.Length; ++i) - { - Option p; - string opt = f + n[i]; - string rn = n[i].ToString(); - if (!Contains(rn)) - { - if (i == 0) - return false; - throw new OptionException(string.Format(MessageLocalizer( - "Cannot bundle unregistered option '{0}'."), opt), opt); - } - p = this[rn]; - switch (p.OptionValueType) - { - case OptionValueType.None: - Invoke(c, opt, n, p); - break; - case OptionValueType.Optional: - case OptionValueType.Required: - { - string v = n.Substring(i + 1); - c.Option = p; - c.OptionName = opt; - ParseValue(v.Length != 0 ? v : null, c); - return true; - } - default: - throw new InvalidOperationException("Unknown OptionValueType: " + p.OptionValueType); - } - } - return true; - } - - static void Invoke(OptionContext c, string name, string value, Option option) - { - c.OptionName = name; - c.Option = option; - c.OptionValues.Add(value); - option.Invoke(c); - } - - public void WriteOptionDescriptions(TextWriter o) - { - foreach (Option p in this) - { - int written = 0; - - Category c = p as Category; - if (c != null) - { - WriteDescription(o, p.Description, "", 80, 80); - continue; - } - - if (!WriteOptionPrototype(o, p, ref written)) - continue; - - if (written < OptionWidth) - o.Write(new string(' ', OptionWidth - written)); - else - { - o.WriteLine(); - o.Write(new string(' ', OptionWidth)); - } - - WriteDescription(o, p.Description, new string(' ', OptionWidth + 2), - DescriptionFirstWidth, DescriptionRemWidth); - } - - foreach (ArgumentSource s in _sources) - { - string[] names = s.GetNames(); - if (names == null || names.Length == 0) - continue; - - int written = 0; - - Write(o, ref written, " "); - Write(o, ref written, names[0]); - for (int i = 1; i < names.Length; ++i) - { - Write(o, ref written, ", "); - Write(o, ref written, names[i]); - } - - if (written < OptionWidth) - o.Write(new string(' ', OptionWidth - written)); - else - { - o.WriteLine(); - o.Write(new string(' ', OptionWidth)); - } - - WriteDescription(o, s.Description, new string(' ', OptionWidth + 2), - DescriptionFirstWidth, DescriptionRemWidth); - } - } - - void WriteDescription(TextWriter o, string value, string prefix, int firstWidth, int remWidth) - { - bool indent = false; - foreach (string line in GetLines(MessageLocalizer(GetDescription(value)), firstWidth, remWidth)) - { - if (indent) - o.Write(prefix); - o.WriteLine(line); - indent = true; - } - } - - bool WriteOptionPrototype(TextWriter o, Option p, ref int written) - { - string[] names = p.Names; - - int i = GetNextOptionIndex(names, 0); - if (i == names.Length) - return false; - - if (names[i].Length == 1) - { - Write(o, ref written, " -"); - Write(o, ref written, names[0]); - } - else - { - Write(o, ref written, " --"); - Write(o, ref written, names[0]); - } - - for (i = GetNextOptionIndex(names, i + 1); - i < names.Length; - i = GetNextOptionIndex(names, i + 1)) - { - Write(o, ref written, ", "); - Write(o, ref written, names[i].Length == 1 ? "-" : "--"); - Write(o, ref written, names[i]); - } - - if (p.OptionValueType == OptionValueType.Optional || - p.OptionValueType == OptionValueType.Required) - { - if (p.OptionValueType == OptionValueType.Optional) - Write(o, ref written, MessageLocalizer("[")); - Write(o, ref written, MessageLocalizer("=" + GetArgumentName(0, p.MaxValueCount, p.Description))); - string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 - ? p.ValueSeparators[0] - : " "; - for (int c = 1; c < p.MaxValueCount; ++c) - Write(o, ref written, MessageLocalizer(sep + GetArgumentName(c, p.MaxValueCount, p.Description))); - if (p.OptionValueType == OptionValueType.Optional) - Write(o, ref written, MessageLocalizer("]")); - } - return true; - } - - static int GetNextOptionIndex(string[] names, int i) - { - while (i < names.Length && names[i] == "<>") - ++i; - return i; - } - - static void Write(TextWriter o, ref int n, string s) - { - n += s.Length; - o.Write(s); - } - - static string GetArgumentName(int index, int maxIndex, string description) - { - if (description == null) - return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); - string[] nameStart; - if (maxIndex == 1) - nameStart = new[] { "{0:", "{" }; - else - nameStart = new[] { "{" + index + ":" }; - for (int i = 0; i < nameStart.Length; ++i) - { - int start, j = 0; - do - { - start = description.IndexOf(nameStart[i], j); - } while (start >= 0 && j != 0 ? description[j++ - 1] == '{' : false); - if (start == -1) - continue; - int end = description.IndexOf("}", start); - if (end == -1) - continue; - return description.Substring(start + nameStart[i].Length, end - start - nameStart[i].Length); - } - return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); - } - - static string GetDescription(string description) - { - if (description == null) - return string.Empty; - StringBuilder sb = new StringBuilder(description.Length); - int start = -1; - for (int i = 0; i < description.Length; ++i) - { - switch (description[i]) - { - case '{': - if (i == start) - { - sb.Append('{'); - start = -1; - } - else if (start < 0) - start = i + 1; - break; - case '}': - if (start < 0) - { - if ((i + 1) == description.Length || description[i + 1] != '}') - throw new InvalidOperationException("Invalid option description: " + description); - ++i; - sb.Append("}"); - } - else - { - sb.Append(description.Substring(start, i - start)); - start = -1; - } - break; - case ':': - if (start < 0) - goto default; - start = i + 1; - break; - default: - if (start < 0) - sb.Append(description[i]); - break; - } - } - return sb.ToString(); - } - - static IEnumerable GetLines(string description, int firstWidth, int remWidth) - { - return StringCoda.WrappedLines(description, firstWidth, remWidth); - } - - internal sealed class Category : Option - { - // Prototype starts with '=' because this is an invalid prototype - // (see Option.ParsePrototype(), and thus it'll prevent Category - // instances from being accidentally used as normal options. - public Category(string description) - : base("=:Category:= " + description, description) - { - } - - protected override void OnParseComplete(OptionContext c) - { - throw new NotSupportedException("Category.OnParseComplete should not be invoked."); - } - } - - sealed class ActionOption : Option - { - readonly Action _action; - - public ActionOption(string prototype, string description, int count, Action action) - : base(prototype, description, count) - { - if (action == null) - throw new ArgumentNullException("action"); - _action = action; - } - - protected override void OnParseComplete(OptionContext c) - { - _action(c.OptionValues); - } - } - - sealed class ActionOption : Option - { - readonly Action _action; - - public ActionOption(string prototype, string description, Action action) - : base(prototype, description, 1) - { - if (action == null) - throw new ArgumentNullException("action"); - _action = action; - } - - protected override void OnParseComplete(OptionContext c) - { - _action(Parse(c.OptionValues[0], c)); - } - } - - sealed class ActionOption : Option - { - readonly OptionAction _action; - - public ActionOption(string prototype, string description, OptionAction action) - : base(prototype, description, 2) - { - if (action == null) - throw new ArgumentNullException("action"); - _action = action; - } - - protected override void OnParseComplete(OptionContext c) - { - _action( - Parse(c.OptionValues[0], c), - Parse(c.OptionValues[1], c)); - } - } - - class ArgumentEnumerator : IEnumerable - { - readonly List> _sources = new List>(); - - public ArgumentEnumerator(IEnumerable arguments) - { - _sources.Add(arguments.GetEnumerator()); - } - - public IEnumerator GetEnumerator() - { - do - { - IEnumerator c = _sources[_sources.Count - 1]; - if (c.MoveNext()) - yield return c.Current; - else - { - c.Dispose(); - _sources.RemoveAt(_sources.Count - 1); - } - } while (_sources.Count > 0); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Add(IEnumerable arguments) - { - _sources.Add(arguments.GetEnumerator()); - } - } - } -} \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Xamlg/Program.cs b/Xamarin.Forms.Xaml.Xamlg/Program.cs deleted file mode 100644 index 275085411c1..00000000000 --- a/Xamarin.Forms.Xaml.Xamlg/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -// -// Program.cs -// -// Author: -// Stephane Delcroix -// -// Copyright (c) 2013 S. Delcroix -// -using System; - -namespace Xamarin.Forms.Xaml.Xamlg -{ - class MainClass - { - public static void Main (string[] args) - { - Console.WriteLine ("Hello World!"); - } - } -} diff --git a/Xamarin.Forms.Xaml.Xamlg/Properties/AssemblyInfo.cs b/Xamarin.Forms.Xaml.Xamlg/Properties/AssemblyInfo.cs deleted file mode 100644 index 9070b661ec6..00000000000 --- a/Xamarin.Forms.Xaml.Xamlg/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -// -// AssemblyInfo.cs -// -// Author: -// Stephane Delcroix -// -// Copyright (c) 2013 S. Delcroix -// - -using System.Reflection; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("Xamarin.Forms.Xaml.Xamlg")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("mobileInception")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("S. Delcroix")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Xamlg/Xamarin.Forms.Xaml.Xamlg.csproj b/Xamarin.Forms.Xaml.Xamlg/Xamarin.Forms.Xaml.Xamlg.csproj deleted file mode 100644 index d7dfdcdd87d..00000000000 --- a/Xamarin.Forms.Xaml.Xamlg/Xamarin.Forms.Xaml.Xamlg.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 12.0.0 - 2.0 - {D597E3C6-1A50-4042-99FA-3E7CE28E4819} - Exe - Xamarin.Forms.Xaml - xamlg - v4.7 - - true - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - true - 0618 - true - - - full - true - bin\Release - prompt - 4 - true - true - 0618 - true - - - - - - - ..\packages\System.Linq.4.1.0\lib\net463\System.Linq.dll - - - - ..\packages\System.Runtime.4.1.0\lib\net462\System.Runtime.dll - - - - ..\packages\System.Runtime.InteropServices.4.1.0\lib\net462\System.Runtime.InteropServices.dll - - - ..\packages\System.Threading.Thread.4.0.0\lib\net46\System.Threading.Thread.dll - - - ..\packages\Microsoft.Build.Framework.15.5.180\lib\net46\Microsoft.Build.Framework.dll - - - ..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - - - ..\packages\Microsoft.Build.Utilities.Core.15.5.180\lib\net46\Microsoft.Build.Utilities.Core.dll - - - ..\packages\System.Reflection.Metadata.1.3.0\lib\portable-net45+win8\System.Reflection.Metadata.dll - - - ..\packages\Microsoft.Build.Tasks.Core.15.5.180\lib\net46\Microsoft.Build.Tasks.Core.dll - - - - - - - - XmlnsHelper.cs - - - - - - - - - - {96D89208-4EB9-4451-BE73-8A9DF3D9D7B7} - Xamarin.Forms.Build.Tasks - - - \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Xamlg/Xamlg.cs b/Xamarin.Forms.Xaml.Xamlg/Xamlg.cs deleted file mode 100644 index 2bccaec238b..00000000000 --- a/Xamarin.Forms.Xaml.Xamlg/Xamlg.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// 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. -// -// Original Author for Moonlight: -// Jackson Harper (jackson@ximian.com) -// -// Copyright 2007 Novell, Inc. -// -// Author: -// Stephane Delcroix (stephane@mi8.be) -// -// Copyright 2013 Mobile Inception - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using Mono.Options; -using Xamarin.Forms.Build.Tasks; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; - -namespace Xamarin.Forms.Xaml -{ - public class Xamlg - { - static readonly string HelpString = "xamlg.exe - a utility for generating partial classes from XAML.\n" + - "xamlg.exe xamlfile...\n\n" + - "If an outputfile is not specified one will be created using the format .g.cs\n\n"; - - public static void Main(string[] args) - { - bool help = false; - var p = new OptionSet - { - { "h|?|help", "Print this help message", v => help = true } - }; - - if (help || args.Length < 1) - { - ShowHelp(p); - Environment.Exit(0); - } - List extra = null; - try - { - extra = p.Parse(args); - } - catch (OptionException) - { - Console.WriteLine("Type `xamlg --help' for more information."); - return; - } - - foreach (var file in extra) - { - var f = file; - - var item = new TaskItem(f); - item.SetMetadata("TargetPath", f); - var generator = new XamlGTask() { - BuildEngine = new DummyBuildEngine(), - AssemblyName = "test", - Language = "C#", - XamlFiles = new[] { item }, - OutputFiles = new[] { new TaskItem(f + ".g.cs") } - }; - - - new XamlGTask { - XamlFiles = new[] { new TaskItem(f)} - }.Execute(); - - } - } - - static void ShowHelp(OptionSet ops) - { - Console.WriteLine(HelpString); - ops.WriteOptionDescriptions(Console.Out); - } - } - - public class DummyBuildEngine : IBuildEngine - { - public void LogErrorEvent(BuildErrorEventArgs e) - { - } - - public void LogWarningEvent(BuildWarningEventArgs e) - { - } - - public void LogMessageEvent(BuildMessageEventArgs e) - { - } - - public void LogCustomEvent(CustomBuildEventArgs e) - { - } - - public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) - { - return false; - } - - public bool ContinueOnError { - get { return false; } - } - - public int LineNumberOfTaskNode { - get { return 1; } - } - - public int ColumnNumberOfTaskNode { - get { return 1; } - } - - public string ProjectFileOfTaskNode { - get { return String.Empty; } - } - } -} \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.Xamlg/app.config b/Xamarin.Forms.Xaml.Xamlg/app.config deleted file mode 100644 index 245587d76fd..00000000000 --- a/Xamarin.Forms.Xaml.Xamlg/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Xamarin.Forms.Xaml.Xamlg/packages.config b/Xamarin.Forms.Xaml.Xamlg/packages.config deleted file mode 100644 index df38b583bdc..00000000000 --- a/Xamarin.Forms.Xaml.Xamlg/packages.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Xamarin.Forms.Xaml/Properties/AssemblyInfo.cs b/Xamarin.Forms.Xaml/Properties/AssemblyInfo.cs index d5b1eefb58c..4643bdb05fd 100644 --- a/Xamarin.Forms.Xaml/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.Xaml/Properties/AssemblyInfo.cs @@ -1,3 +1,4 @@ +using System.Reflection; using System.Runtime.CompilerServices; using Xamarin.Forms.Internals; @@ -19,4 +20,7 @@ #pragma warning disable CS0612 // Type or member is obsolete [assembly: TypeForwardedTo(typeof(Xamarin.Forms.Xaml.Internals.INameScopeProvider))] -#pragma warning restore CS0612 // Type or member is obsolete \ No newline at end of file +#pragma warning restore CS0612 // Type or member is obsolete + +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] diff --git a/Xamarin.Forms.sln b/Xamarin.Forms.sln index a4b27d11d7f..a003f3a8912 100644 --- a/Xamarin.Forms.sln +++ b/Xamarin.Forms.sln @@ -21,12 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Core.UnitTest EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.ControlGallery.Android", "Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj", "{1346A7F1-4457-4BB4-A371-2C8E28BBD53E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Xaml.Xamlg", "Xamarin.Forms.Xaml.Xamlg\Xamarin.Forms.Xaml.Xamlg.csproj", "{D597E3C6-1A50-4042-99FA-3E7CE28E4819}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Xaml.UnitTests", "Xamarin.Forms.Xaml.UnitTests\Xamarin.Forms.Xaml.UnitTests.csproj", "{4B14D295-C09B-4C38-B880-7CC768E50585}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Xaml.Xamlc", "Xamarin.Forms.Xaml.Xamlc\Xamarin.Forms.Xaml.Xamlc.csproj", "{928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuspec", ".nuspec", "{7E12C50D-A570-4DF1-94E1-8599843FA87C}" ProjectSection(SolutionItems) = preProject .nuspec\Xamarin.Forms.AppLinks.nuspec = .nuspec\Xamarin.Forms.AppLinks.nuspec @@ -314,32 +310,7 @@ Global {1346A7F1-4457-4BB4-A371-2C8E28BBD53E}.Release|x86.ActiveCfg = Release|Any CPU {1346A7F1-4457-4BB4-A371-2C8E28BBD53E}.Release|x86.Build.0 = Release|Any CPU {1346A7F1-4457-4BB4-A371-2C8E28BBD53E}.Release|x86.Deploy.0 = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|ARM.ActiveCfg = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|ARM.Build.0 = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|iPhone.Build.0 = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|x64.ActiveCfg = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|x64.Build.0 = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|x86.ActiveCfg = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Debug|x86.Build.0 = Debug|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|Any CPU.Build.0 = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|ARM.ActiveCfg = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|ARM.Build.0 = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|iPhone.ActiveCfg = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|iPhone.Build.0 = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|x64.ActiveCfg = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|x64.Build.0 = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|x86.ActiveCfg = Release|Any CPU - {D597E3C6-1A50-4042-99FA-3E7CE28E4819}.Release|x86.Build.0 = Release|Any CPU {4B14D295-C09B-4C38-B880-7CC768E50585}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B14D295-C09B-4C38-B880-7CC768E50585}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B14D295-C09B-4C38-B880-7CC768E50585}.Debug|ARM.ActiveCfg = Debug|Any CPU {4B14D295-C09B-4C38-B880-7CC768E50585}.Debug|ARM.Build.0 = Debug|Any CPU {4B14D295-C09B-4C38-B880-7CC768E50585}.Debug|iPhone.ActiveCfg = Debug|Any CPU @@ -362,30 +333,6 @@ Global {4B14D295-C09B-4C38-B880-7CC768E50585}.Release|x64.Build.0 = Release|Any CPU {4B14D295-C09B-4C38-B880-7CC768E50585}.Release|x86.ActiveCfg = Release|Any CPU {4B14D295-C09B-4C38-B880-7CC768E50585}.Release|x86.Build.0 = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|ARM.ActiveCfg = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|ARM.Build.0 = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|iPhone.Build.0 = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|x64.ActiveCfg = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|x64.Build.0 = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|x86.ActiveCfg = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Debug|x86.Build.0 = Debug|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|Any CPU.Build.0 = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|ARM.ActiveCfg = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|ARM.Build.0 = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|iPhone.ActiveCfg = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|iPhone.Build.0 = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|x64.ActiveCfg = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|x64.Build.0 = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|x86.ActiveCfg = Release|Any CPU - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}.Release|x86.Build.0 = Release|Any CPU {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|Any CPU.Build.0 = Debug|Any CPU {57B8B73D-C3B5-4C42-869E-7B2F17D354AC}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -1595,9 +1542,7 @@ Global {0E16E70A-D6DD-4323-AD5D-363ABFF42D6A} = {29AC50BF-B4FB-450B-9386-0C5AD4B84226} {00259593-A283-47A5-ACB7-9C3819B16364} = {33A20844-7EF4-441D-83DA-2ACAF5E1CDFA} {1346A7F1-4457-4BB4-A371-2C8E28BBD53E} = {4F5E2D21-17F6-4A42-B8FB-D03D82E24EC8} - {D597E3C6-1A50-4042-99FA-3E7CE28E4819} = {32F608E2-6406-4DCF-9105-E2A7CB7085CF} {4B14D295-C09B-4C38-B880-7CC768E50585} = {32F608E2-6406-4DCF-9105-E2A7CB7085CF} - {928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF} = {32F608E2-6406-4DCF-9105-E2A7CB7085CF} {57B8B73D-C3B5-4C42-869E-7B2F17D354AC} = {9AD757F5-E57A-459D-A0A7-E0675E045B84} {9DB2F292-8034-4E06-89AD-98BBDA4306B9} = {32F608E2-6406-4DCF-9105-E2A7CB7085CF} {CB9C96CE-125C-4A68-B6A1-C3FF1FBF93E1} = {4F5E2D21-17F6-4A42-B8FB-D03D82E24EC8} diff --git a/xamarin.forms.snk b/xamarin.forms.snk new file mode 100644 index 0000000000000000000000000000000000000000..5a3b6660ef821c5767c0727e27efb6c8b75f10f9 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096;n-_?&2x$(}Rgmq+0Gg>m9@AE*a!m*C z%f!X4mDvEW;u~XraXdU=vbN{I$CrI%Lylw>e(IB9<`6Nw^g*_)H+?}H^`yTu<&?uC zM9?xVPPa%6bOY1PUgS02Mcyl1V!-GQ>k+CnwQ^0+Q8)1}GnJRaUU!xg`p4vft$wTj z{;vHMlHVsO=E2(WP2|v(gH3C;Hyouq{u60v4_3u+_Qitm^XtRsaefa03NcvRoUa-Q zK5V^UEn*Z$iiFC!tF!zD*cNBtz$Yr)1i;*zecTQTI;6FJKPfFTgDk&ME>0J3<*OFt zk8ftwx+rsR@??8J;NT~h|H1*{%gETTZQ<2zkY?G%QJUwE5pr*iIS78LClI}^@zi=h zH9!|g6-(|PSS90^HFAjs6yxEcug*`SQS#+=Lz=|DLyN(IWDIvF%nL#^J7{}xOBU%+ zNu=gllDY{v+9lSfbLn^ElS+h8O9>Y+-IMQGo{6IuW*zQX8z2A5kNKw;Qm7YoI~IH- zvdGVkOe%}DINpa9>zs0-n_u9TJfWRXhT>e!a$*5rdwc`U`QIJ@ZGhaZ?`d4Vm7__f zANM^|Df9?I_Q71O_Zc;7o$%u@$7#VQgEs~7R#nur;<_E6DM=6aiS*|%h5I;7ySOG{ z>c8Fzax^R3#Uj|;mw_4*=sU%AxOb#rMTW(tHG@L`V^^u^J?`ko0mCo%Q~TBz_lf=9 i2EpYE9H(C(u|!CX37cYQ@6I0_5!s7PwQLejJwu#5zalUI literal 0 HcmV?d00001