From caa2af2024d37a4b6f193abe8b962301c6c30629 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Mon, 30 Nov 2015 12:26:53 -0800 Subject: [PATCH] allow dotnet-publish to publish a library fixes #314 --- src/Microsoft.DotNet.Tools.Publish/Program.cs | 14 ++++++-------- test/TestLibrary/project.json | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.DotNet.Tools.Publish/Program.cs b/src/Microsoft.DotNet.Tools.Publish/Program.cs index dd08d1a09..b696e9833 100644 --- a/src/Microsoft.DotNet.Tools.Publish/Program.cs +++ b/src/Microsoft.DotNet.Tools.Publish/Program.cs @@ -95,12 +95,6 @@ namespace Microsoft.DotNet.Tools.Publish var options = context.ProjectFile.GetCompilerOptions(context.TargetFramework, configuration); - if (!options.EmitEntryPoint.GetValueOrDefault()) - { - Reporter.Output.WriteLine($"{context.RootProject.Identity} does not have an entry point defined.".Red()); - return 1; - } - // Generate the output path if (string.IsNullOrEmpty(outputPath)) { @@ -145,8 +139,12 @@ namespace Microsoft.DotNet.Tools.Publish PublishFiles(export.NativeLibraries, outputPath); } - // Publish the application itself - PublishHost(context, outputPath); + // Publish a host if this is an application + if (options.EmitEntryPoint.GetValueOrDefault()) + { + Reporter.Verbose.WriteLine($"Making {context.ProjectFile.Name.Cyan()} runnable ..."); + PublishHost(context, outputPath); + } Reporter.Output.WriteLine($"Published to {outputPath}".Green().Bold()); return 0; diff --git a/test/TestLibrary/project.json b/test/TestLibrary/project.json index 5e3bf84f1..0e91574b2 100644 --- a/test/TestLibrary/project.json +++ b/test/TestLibrary/project.json @@ -1,8 +1,7 @@ { "version": "1.0.0-*", "dependencies": { - "System.Runtime": "4.0.21-beta-23428", - "Microsoft.NETCore.Runtime": "1.0.1-beta-23428" + "System.Runtime": "4.0.21-beta-23428" }, "frameworks": {