diff options
author | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 13:02:25 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 16:13:41 -0700 |
commit | 17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch) | |
tree | b5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Xaml.Xamlc | |
download | xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2 xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip |
Initial import
Diffstat (limited to 'Xamarin.Forms.Xaml.Xamlc')
-rw-r--r-- | Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj | 59 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml.Xamlc/Xamlc.cs | 69 |
2 files changed, 128 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj b/Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj new file mode 100644 index 00000000..653f812b --- /dev/null +++ b/Xamarin.Forms.Xaml.Xamlc/Xamarin.Forms.Xaml.Xamlc.csproj @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{928A23F3-2330-4F9F-B6A3-BFE01FE2A2DF}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>Xamarin.Forms.Xaml</RootNamespace> + <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug</OutputPath> + <DefineConstants>DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + <Commandlineparameters>-r "../../../Xamarin.Forms.Controls/bin/Debug/" -p "../../../Xamarin.Forms.Xaml.UnitTest/bin/Debug/;/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/mono/4.5;/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/mono/4.5/Facades/" --keep -v 4 -d ../../../Xamarin.Forms.Xaml.UnitTests/bin/Debug/Xamarin.Forms.Xaml.UnitTests.dll</Commandlineparameters> + <AssemblyName>xamlc</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>full</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + <AssemblyName>xamlc</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Turkey|AnyCPU' "> + <Optimize>false</Optimize> + <OutputPath>bin\Turkey</OutputPath> + <WarningLevel>4</WarningLevel> + <AssemblyName>Xamarin.Forms.Xaml.Xamlc</AssemblyName> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="Microsoft.Build.Utilities.v4.0" /> + <Reference Include="Microsoft.Build.Framework" /> + </ItemGroup> + <ItemGroup> + <Compile Include="..\Xamarin.Forms.Xaml.Xamlg\Mono.Options\Options.cs"> + <Link>Mono.Options\Options.cs</Link> + </Compile> + <Compile Include="Xamlc.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <ItemGroup> + <Folder Include="Mono.Options\" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Xamarin.Forms.Build.Tasks\Xamarin.Forms.Build.Tasks.csproj"> + <Project>{96D89208-4EB9-4451-BE73-8A9DF3D9D7B7}</Project> + <Name>Xamarin.Forms.Build.Tasks</Name> + </ProjectReference> + </ItemGroup> +</Project> diff --git a/Xamarin.Forms.Xaml.Xamlc/Xamlc.cs b/Xamarin.Forms.Xaml.Xamlc/Xamlc.cs new file mode 100644 index 00000000..b2fa172b --- /dev/null +++ b/Xamarin.Forms.Xaml.Xamlc/Xamlc.cs @@ -0,0 +1,69 @@ +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; + bool decompile = false; + string paths = null; + string refs = 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 }, + { "d|decompile", v => decompile = true } + }; + + if (help || args.Length < 1) + { + ShowHelp(p); + Environment.Exit(0); + } + List<string> extra = null; + 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]; + XamlCTask.Compile(assembly, verbosity, keep, optimize, paths, refs, decompile); + } + + static void ShowHelp(OptionSet ops) + { + Console.WriteLine(help_string); + ops.WriteOptionDescriptions(Console.Out); + } + } +}
\ No newline at end of file |