Skip to content

Commit

Permalink
Merge pull request #18 from hoyho/feat/pack
Browse files Browse the repository at this point in the history
Feat/pack
  • Loading branch information
hoyho authored Jun 10, 2019
2 parents c1a2e6f + 7e9704a commit e6b75b3
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bld/
[Bb]in/
[Oo]bj/
[Ll]og/
_output/

# Visual Studio 2015 cache/options directory
.vs/
Expand Down
17 changes: 17 additions & 0 deletions build/pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

BASEDIR=$(dirname "$0")

ROOT=$BASEDIR/../

cd $ROOT

FULL_ROOT=`pwd`

OUT=$FULL_ROOT"/_output"
echo "output dir: "$OUT

mkdir -p $OUT

#It will use <PropertyGroup> and <ItemGroup>(referenced pack or item with property pack=true)
dotnet pack src/WeGouSharp/WeGouSharp.csproj -o $OUT -c Release | tee

Binary file added src/WeGouSharp/.assets/Resources.zip
Binary file not shown.
4 changes: 4 additions & 0 deletions src/WeGouSharp/.assets/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This file is the resources and configs for wegousharp.
If you dot't have them in you project, extract the zip file to your porgram directory

happy coding~
42 changes: 31 additions & 11 deletions src/WeGouSharp/WeGouSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<!--
<OutputType>exe</OutputType>
-->
<PackageId>WegouSharp</PackageId>
<Version>0.0.4</Version>
<Authors>Hoyho</Authors>
<Company>here2say</Company>
<Title>Wechat public account scrawler helper</Title>
<Owners>Hoyho</Owners>
<RepositoryUrl>https://github.com/hoyho/WeGouSharp</RepositoryUrl>
<Description>A powerful spider tool for wechat official account</Description>
<LicenseUrl>https://raw.githubusercontent.com/hoyho/WeGouSharp/master/LICENSE</LicenseUrl>
<ProjectUrl>https://github.com/hoyho/WeGouSharp</ProjectUrl>

</PropertyGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.8.0" />
Expand All @@ -16,22 +29,29 @@
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="OpenCvSharp3-AnyCPU" Version="3.3.1.20171117" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
<PackageReference Include="RestSharp" Version="106.3.1" />
<!--
<PackageReference Include="OpenCvSharp3-WithoutDll" Version="3.3.1.20171117" />
-->
<PackageReference Include="RestSharp" Version="106.3.1" />
</ItemGroup>


<ItemGroup>
<None Update="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Content Include="log4net.config" buildAction="Content" copyToOutput="true" Pack="false" >
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<None Update="Resource\**" CopyToOutputDirectory="PreserveNewest" />
<Content Include="Resource\**" buildAction="Content" copyToOutput="true" Pack="false">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<None Update="wegousharpsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="wegousharpsettings.json" CopyToOutputDirectory="PreserveNewest" Pack="false" />
</ItemGroup>

<ItemGroup>
<None Include="readme.txt" pack="true" PackagePath="." />
</ItemGroup>


</Project>
23 changes: 23 additions & 0 deletions src/WeGouSharp/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
!!!! Important Note for NuGet User !!!!
!!!! Nuget用户重要说明 !!!!

Since dotnetcore/dotnet cli(for nuget) don't support distributing conent and tools anymore
Actually, you still can do that, but they file is just a link from cache. And there's many potential issues.

You may need to add Resource file manually.

Please download resource from GitHub and put it to published folder or add to your project and publish it

Resource mentioned here include some configurations and dependences like driver , etc


由于dotnetcore/dotnet cli用于nuget的接口现在不支持发布静态资源文件和工具集了(其实也能发布,只是拿到的是一链接文件,又有一堆坑,已经不建议这么使用)

因此你需要手动添加可能需要的资源文件

资源文件可从GitHub仓库下载, 请把下载的资源文件放在发布目录下,
或者添加到你的项目,然后作为发布文件输出

这里所说的资源包括一些配置文件,依赖项如gecko驱动之类的东西。


0 comments on commit e6b75b3

Please sign in to comment.