Adding Readme.md
Cleaning up some options Renaming BuildType to BuildConfiguration
This commit is contained in:
parent
42e557408a
commit
f382872c41
3 changed files with 69 additions and 26 deletions
|
@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||||
public string InputManagedAssemblyPath { get; set; }
|
public string InputManagedAssemblyPath { get; set; }
|
||||||
public string OutputDirectory { get; set; }
|
public string OutputDirectory { get; set; }
|
||||||
public string IntermediateDirectory { get; set; }
|
public string IntermediateDirectory { get; set; }
|
||||||
public string BuildType { get; set; }
|
public string BuildConfiguration { get; set; }
|
||||||
public string Architecture { get; set; }
|
public string Architecture { get; set; }
|
||||||
public string NativeMode { get; set; }
|
public string NativeMode { get; set; }
|
||||||
public List<string> ReferencePaths { get; set; }
|
public List<string> ReferencePaths { get; set; }
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
using Microsoft.Dnx.Runtime.Common.CommandLine;
|
using Microsoft.Dnx.Runtime.Common.CommandLine;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.Tools.Common;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Compiler.Native
|
namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||||
{
|
{
|
||||||
|
@ -78,17 +72,19 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||||
|
|
||||||
private static CommandLineApplication SetupApp()
|
private static CommandLineApplication SetupApp()
|
||||||
{
|
{
|
||||||
var app = new CommandLineApplication();
|
var app = new CommandLineApplication
|
||||||
app.Name = "dotnet compile native";
|
{
|
||||||
app.FullName = "IL to Native compiler";
|
Name = "dotnet compile native",
|
||||||
app.Description = "IL to Native compiler Compiler for the .NET Platform";
|
FullName = "IL to Native compiler",
|
||||||
|
Description = "IL to Native compiler Compiler for the .NET Platform"
|
||||||
|
};
|
||||||
|
|
||||||
app.HelpOption("-h|--help");
|
app.HelpOption("-h|--help");
|
||||||
|
|
||||||
var managedInputArg = app.Argument("<INPUT_ASSEMBLY>", "The managed input assembly to compile to native.");
|
var managedInputArg = app.Argument("<INPUT_ASSEMBLY>", "The managed input assembly to compile to native.");
|
||||||
var outputArg = app.Option("-o|--out <OUTPUT_DIR>", "Output Directory for native executable.", CommandOptionType.SingleValue);
|
var outputArg = app.Option("-o|--out <OUTPUT_DIR>", "Output Directory for native executable.", CommandOptionType.SingleValue);
|
||||||
var intermediateArg = app.Option("--temp-output <OUTPUT_DIR>", "Directory for intermediate files.", CommandOptionType.SingleValue);
|
var intermediateArg = app.Option("-t|--temp-output <OUTPUT_DIR>", "Directory for intermediate files.", CommandOptionType.SingleValue);
|
||||||
var archArg = app.Option("-a|--arch <ARCH>", "Architecture type to compile for, defaults to the arch of the machine.", CommandOptionType.SingleValue );
|
var buildConfigArg = app.Option("-c|--configuration <TYPE>", "debug/release build configuration. Defaults to debug.", CommandOptionType.SingleValue);
|
||||||
var buildTypeArg = app.Option("-c|--configuration <TYPE>", "debug/release build type. Defaults to debug.", CommandOptionType.SingleValue);
|
|
||||||
var modeArg = app.Option("-m|--mode <MODE>", "Code Generation mode. Defaults to ryujit. ", CommandOptionType.SingleValue);
|
var modeArg = app.Option("-m|--mode <MODE>", "Code Generation mode. Defaults to ryujit. ", CommandOptionType.SingleValue);
|
||||||
|
|
||||||
var referencesArg = app.Option("-r|--reference <REF_PATH>", "Use to specify Managed DLL references of the app.", CommandOptionType.MultipleValue);
|
var referencesArg = app.Option("-r|--reference <REF_PATH>", "Use to specify Managed DLL references of the app.", CommandOptionType.MultipleValue);
|
||||||
|
@ -99,14 +95,11 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||||
var linklibArg = app.Option("--linklib <LINKLIB>", "Use to link in additional static libs", CommandOptionType.MultipleValue);
|
var linklibArg = app.Option("--linklib <LINKLIB>", "Use to link in additional static libs", CommandOptionType.MultipleValue);
|
||||||
|
|
||||||
// TEMPORARY Hack until CoreRT compatible Framework Libs are available
|
// TEMPORARY Hack until CoreRT compatible Framework Libs are available
|
||||||
var appdepSDKPathArg = app.Option("--appdepsdk <SDK>", "Use to plug in custom appdepsdk path", CommandOptionType.SingleValue);
|
var appdepSdkPathArg = app.Option("--appdepsdk <SDK>", "Use to plug in custom appdepsdk path", CommandOptionType.SingleValue);
|
||||||
|
|
||||||
// Optional Log Path
|
// Optional Log Path
|
||||||
var logpathArg = app.Option("--logpath <LOG_PATH>", "Use to dump Native Compilation Logs to a file.", CommandOptionType.SingleValue);
|
var logpathArg = app.Option("--logpath <LOG_PATH>", "Use to dump Native Compilation Logs to a file.", CommandOptionType.SingleValue);
|
||||||
|
|
||||||
// Use Response File
|
|
||||||
var responseFilePathArg = app.Option("--rsp <RSP_FILE>", "Compilation Response File", CommandOptionType.SingleValue);
|
|
||||||
|
|
||||||
app.OnExecute(() =>
|
app.OnExecute(() =>
|
||||||
{
|
{
|
||||||
var cmdLineArgs = new ArgValues()
|
var cmdLineArgs = new ArgValues()
|
||||||
|
@ -114,14 +107,14 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||||
InputManagedAssemblyPath = managedInputArg.Value,
|
InputManagedAssemblyPath = managedInputArg.Value,
|
||||||
OutputDirectory = outputArg.Value(),
|
OutputDirectory = outputArg.Value(),
|
||||||
IntermediateDirectory = intermediateArg.Value(),
|
IntermediateDirectory = intermediateArg.Value(),
|
||||||
Architecture = archArg.Value(),
|
Architecture = "x64",
|
||||||
BuildType = buildTypeArg.Value(),
|
BuildConfiguration = buildConfigArg.Value(),
|
||||||
NativeMode = modeArg.Value(),
|
NativeMode = modeArg.Value(),
|
||||||
ReferencePaths = referencesArg.Values,
|
ReferencePaths = referencesArg.Values,
|
||||||
IlcArgs = ilcArgs.Value(),
|
IlcArgs = ilcArgs.Value(),
|
||||||
IlcPath = ilcPathArg.Value(),
|
IlcPath = ilcPathArg.Value(),
|
||||||
LinkLibPaths = linklibArg.Values,
|
LinkLibPaths = linklibArg.Values,
|
||||||
AppDepSDKPath = appdepSDKPathArg.Value(),
|
AppDepSDKPath = appdepSdkPathArg.Value(),
|
||||||
LogPath = logpathArg.Value()
|
LogPath = logpathArg.Value()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,8 +169,8 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BuildType
|
// BuildConfiguration
|
||||||
if(string.IsNullOrEmpty(args.BuildType))
|
if(string.IsNullOrEmpty(args.BuildConfiguration))
|
||||||
{
|
{
|
||||||
config.BuildType = GetDefaultBuildType();
|
config.BuildType = GetDefaultBuildType();
|
||||||
}
|
}
|
||||||
|
@ -185,11 +178,11 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
config.BuildType = EnumExtensions.Parse<BuildConfiguration>(args.BuildType.ToLower());
|
config.BuildType = EnumExtensions.Parse<BuildConfiguration>(args.BuildConfiguration.ToLower());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
throw new Exception("Invalid BuildType Option.");
|
throw new Exception("Invalid Configuration Option.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
50
src/Microsoft.DotNet.Tools.Compiler.Native/README.md
Normal file
50
src/Microsoft.DotNet.Tools.Compiler.Native/README.md
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
dotnet-compile
|
||||||
|
===========
|
||||||
|
|
||||||
|
**NAME**
|
||||||
|
dotnet-compile-native -- Compiles IL binaries to native binaries.
|
||||||
|
|
||||||
|
**SYNOPSIS**
|
||||||
|
dotnet compile [options]
|
||||||
|
|
||||||
|
**DESCRIPTION**
|
||||||
|
The `compile-native` command compiles IL assemblies to native machine code. It is used by `dotnet-compile --native`.
|
||||||
|
|
||||||
|
The output is a native exe that conforms to the architecture of the underlying operating system (i.e. running on 64-bit OS will produce a native 64-bit exe). This can be overriden via the --arch switch and specifying the wanted architecture. The executable has a default extension of "" on Linux and OS X and ".exe" on Windows. The source must include a `static void Main(string[] args) entry point and specify compilerOptions.emitEntryPoint in the project.json.
|
||||||
|
|
||||||
|
Output files are written to the child `bin` folder, which will be created if it doesn't exist. Files will be overwritten as needed.
|
||||||
|
|
||||||
|
**Options**
|
||||||
|
|
||||||
|
--appdepsdk <SDK_PATH>
|
||||||
|
Path to custom AppDepSDK
|
||||||
|
|
||||||
|
-c, --configuration [debug|release]
|
||||||
|
Build configuration. Defaults to `debug`.
|
||||||
|
|
||||||
|
--ilcargs <args>
|
||||||
|
Custom arguments for the IL Compiler.
|
||||||
|
|
||||||
|
--ilcpath <ILC_PATH>
|
||||||
|
Path to a custom ilc.exe
|
||||||
|
|
||||||
|
--linklib <LIB_PATH>
|
||||||
|
Path to static lib to link
|
||||||
|
|
||||||
|
--logpath <LOG_PATH>
|
||||||
|
Enables logging and writes native compilation logs to the given path.
|
||||||
|
|
||||||
|
-m, --mode [cpp|ryujit|custom]
|
||||||
|
Code generation mode. Defaults to ryujit.
|
||||||
|
|
||||||
|
-o, --out directoryname
|
||||||
|
Output directory for the native executable.
|
||||||
|
|
||||||
|
-r, --reference
|
||||||
|
Path to a managed dll reference for the app.
|
||||||
|
|
||||||
|
-t, --temp-out
|
||||||
|
Specifies temporary directory for intermediate files.
|
||||||
|
|
||||||
|
-v, --verbose
|
||||||
|
Prints verbose logging information, to follow the flow of execution of the command.
|
Loading…
Add table
Reference in a new issue