Skip to content

Commit

Permalink
问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
liesauer committed Jul 25, 2019
1 parent 5c6eeb0 commit 1d6aaee
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NetCoreBeautyNuget/Beauty.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<RuntimeOS Condition="$(IsOSX) == 'True'">osx-x64</RuntimeOS>
<BeautyBinExt Condition="$(IsWindows) == 'True'">.exe</BeautyBinExt>
<BeautyBin>"$(MSBuildThisFileDirectory)../tools/$(RuntimeOS)/ncbeauty$(BeautyBinExt)"</BeautyBin>
<BeautyDir>"$(MSBuildProjectDirectory)/$(PublishDir)"</BeautyDir>
<BeautyDir>"$(MSBuildProjectDirectory)/$(PublishDir).HERE/.."</BeautyDir>
<BeautyLibsDir Condition="$(BeautyLibsDir) == ''">libraries</BeautyLibsDir>
</PropertyGroup>

<Target Name="NetCoreBeauty" AfterTargets="Publish">
<Target Name="NetCoreBeauty" AfterTargets="Publish" Condition="$(DisableBeauty) != 'True'">
<Exec Command="$(BeautyBin) $(BeautyDir) $(BeautyLibsDir)" />
</Target>
</Project>
5 changes: 4 additions & 1 deletion NetCoreBeautyNuget/NetCoreBeauty.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
<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>
<version>1.0.1</version>
<authors>LiesAuer</authors>
<owners>nulastudio</owners>
<projectUrl>https://github.com/nulastudio/NetCoreBeauty</projectUrl>
<license type="expression">MIT</license>
</metadata>
<files>
<file src="_._" target="lib/netstandard2.0/" />
Expand Down
Empty file.
Binary file not shown.
5 changes: 4 additions & 1 deletion NetCoreBeautyNugetTest/NetCoreBeautyTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<!-- beauty into sub-directory, default is libs, quote with "" if contains space -->
<BeautyLibsDir>libraries</BeautyLibsDir>
<!-- set to True if you want to disable -->
<DisableBeauty>False</DisableBeauty>
</PropertyGroup>

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

</Project>
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,46 @@
# NetCoreBeauty

## What is it?
Move a .NET Core app runtime components and dependencies into a sub-directory and make it beauty.

## Before Beauty
![before_beauty](before_beauty.png)

## After Beauty
![after_beauty](after_beauty.png)

## How to use?
1. Add Nuget reference into you .NET Core project.
```
dotnet add package nulastudio.NetCoreBeauty
```
you `*.csproj` should be similar like this
```
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<!-- beauty into sub-directory, default is libs, quote with "" if contains space -->
<BeautyLibsDir>libraries</BeautyLibsDir>
<!-- set to True if you want to disable -->
<DisableBeauty>False</DisableBeauty>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.0.1" />
</ItemGroup>
</Project>
```
when you run `dotnet publish` , everything is done automatically.

2. Use the binary application if you project has already be published.
```
Usage:
ncbeauty <beautyDir> [<LibsDir>]
```
for example
```
ncbeauty /path/to/publishDir
```
Binary file added after_beauty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added before_beauty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/main/beauty.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func main() {
if len(os.Args) >= 3 {
libsDir = os.Args[2]
}
beautyDir = strings.Trim(beautyDir, "\"")
libsDir = strings.Trim(libsDir, "\"")
beautyDir, _ = filepath.Abs(beautyDir)
}

Expand Down

0 comments on commit 1d6aaee

Please sign in to comment.