Skip to content

Commit

Permalink
添加Nuget包项目以及Demo项目
Browse files Browse the repository at this point in the history
  • Loading branch information
liesauer committed Jul 25, 2019
1 parent dbdc34a commit 5c6eeb0
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 0 deletions.
18 changes: 18 additions & 0 deletions NetCoreBeautyNuget/Beauty.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">True</IsWindows>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">True</IsLinux>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">True</IsOSX>
<RuntimeOS Condition="$(IsWindows) == 'True'">win-x64</RuntimeOS>
<RuntimeOS Condition="$(IsLinux) == 'True'">linux-x64</RuntimeOS>
<RuntimeOS Condition="$(IsOSX) == 'True'">osx-x64</RuntimeOS>
<BeautyBinExt Condition="$(IsWindows) == 'True'">.exe</BeautyBinExt>
<BeautyBin>"$(MSBuildThisFileDirectory)../tools/$(RuntimeOS)/ncbeauty$(BeautyBinExt)"</BeautyBin>
<BeautyDir>"$(MSBuildProjectDirectory)/$(PublishDir)"</BeautyDir>
<BeautyLibsDir Condition="$(BeautyLibsDir) == ''">libraries</BeautyLibsDir>
</PropertyGroup>

<Target Name="NetCoreBeauty" AfterTargets="Publish">
<Exec Command="$(BeautyBin) $(BeautyDir) $(BeautyLibsDir)" />
</Target>
</Project>
12 changes: 12 additions & 0 deletions NetCoreBeautyNuget/NetCoreBeauty.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>nulastudio.NetCoreBeauty</AssemblyName>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<NuspecFile>NetCoreBeauty.nuspec</NuspecFile>
</PropertyGroup>

</Project>
16 changes: 16 additions & 0 deletions NetCoreBeautyNuget/NetCoreBeauty.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>nulastudio.NetCoreBeauty</id>
<description>Move a .NET Core app runtime components and dependencies into a sub-directory and make it beauty.</description>
<version>1.0.0</version>
<authors>LiesAuer</authors>
</metadata>
<files>
<file src="_._" target="lib/netstandard2.0/" />
<file src="NetCoreBeauty.targets" target="build/netstandard2.0/nulastudio.NetCoreBeauty.targets" />

<file src="Beauty.targets" target="targets/" />
<file src="../tools/**/*" target="tools/" />
</files>
</package>
3 changes: 3 additions & 0 deletions NetCoreBeautyNuget/NetCoreBeauty.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)/../../targets/Beauty.targets" />
</Project>
Empty file added NetCoreBeautyNuget/_._
Empty file.
Binary file not shown.
13 changes: 13 additions & 0 deletions NetCoreBeautyNugetTest/NetCoreBeautyTest.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<BeautyLibsDir>libraries</BeautyLibsDir>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.0.0" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions NetCoreBeautyNugetTest/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->

<configuration>
<packageSources>
<add key="Debug Packages" value="./.nugs" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>

</configuration>
12 changes: 12 additions & 0 deletions NetCoreBeautyNugetTest/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace NugetToolTest
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

0 comments on commit 5c6eeb0

Please sign in to comment.