Initial commit

This commit is contained in:
David Fowler 2015-10-03 11:34:08 -07:00
parent f40dd3d9f7
commit 15ccc3781f
7 changed files with 2289 additions and 0 deletions

33
Microsoft.DotNet.Cli.sln Normal file
View file

@ -0,0 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Cli", "src\Microsoft.DotNet.Cli\Microsoft.DotNet.Cli.xproj", "{60CF7E6C-D6C8-439D-B7B7-D8A27E29BE2C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5A29E8E3-A0FC-4C57-81DD-297B56D1A119}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{60CF7E6C-D6C8-439D-B7B7-D8A27E29BE2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60CF7E6C-D6C8-439D-B7B7-D8A27E29BE2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60CF7E6C-D6C8-439D-B7B7-D8A27E29BE2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60CF7E6C-D6C8-439D-B7B7-D8A27E29BE2C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{60CF7E6C-D6C8-439D-B7B7-D8A27E29BE2C} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
EndGlobalSection
EndGlobal

9
NuGet.Config Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="www.myget.org" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

3
global.json Normal file
View file

@ -0,0 +1,3 @@
{
"projects": ["src", "test"]
}

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>60cf7e6c-d6c8-439d-b7b7-d8a27e29be2c</ProjectGuid>
<RootNamespace>Microsoft.DotNet.Cli</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Dnx.Runtime.Common.CommandLine;
namespace Microsoft.DotNet.Cli
{
public class Program
{
public static int Main(string[] args)
{
// TODO: Use System.CommandLine
var app = new CommandLineApplication();
app.Name = "dotnet";
app.Description = "The .NET CLI";
app.HelpOption("-?|-h|--help");
app.Command("init", c =>
{
c.Description = "Scaffold a basic .NET application";
c.HelpOption("-?|-h|--help");
});
app.Command("compile", c =>
{
c.Description = "Produce assemblies for the project in given directory";
var optionFramework = c.Option("--framework <TARGET_FRAMEWORK>", "A list of target frameworks to build.", CommandOptionType.MultipleValue);
var optionOut = c.Option("--out <OUTPUT_DIR>", "Output directory", CommandOptionType.SingleValue);
var optionQuiet = c.Option("--quiet", "Do not show output such as dependencies in use",
CommandOptionType.NoValue);
var argProjectDir = c.Argument(
"[projects]",
"One or more projects build. If not specified, the project in the current directory will be used.",
multipleValues: true);
c.HelpOption("-?|-h|--help");
});
app.Command("restore", c =>
{
c.Description = "Restore packages";
var argRoot = c.Argument("[project]",
"List of projects and project folders to restore. Each value can be: a path to a project.json or global.json file, or a folder to recursively search for project.json files.",
multipleValues: true);
var optRuntimes = c.Option("--runtime <RID>",
"List of runtime identifiers to restore for",
CommandOptionType.MultipleValue);
c.HelpOption("-?|-h|--help");
});
app.Command("pack", c =>
{
c.Description = "Produce a NuGet package";
c.HelpOption("-?|-h|--help");
});
app.Command("publish", c =>
{
c.Description = "Produce deployable assets";
c.HelpOption("-?|-h|--help");
});
app.OnExecute(() =>
{
app.ShowHelp();
return 2;
});
return app.Execute(args);
}
}
}

View file

@ -0,0 +1,22 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"commands": {
"dotnet": "Microsoft.DotNet.Cli"
},
"dependencies": {
"System.Console": "4.0.0-*",
"System.Collections": "4.0.11-*",
"System.Linq": "4.0.1-*",
"System.Diagnostics.Process": "4.1.0-*",
"Microsoft.Framework.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-*"
}
},
"frameworks": {
"dnxcore50": { }
}
}

File diff suppressed because it is too large Load diff