Skip to content

Commit

Permalink
split project, fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
stanzhai committed Jul 11, 2013
1 parent 86fdeff commit 9c2ab2b
Show file tree
Hide file tree
Showing 32 changed files with 11,563 additions and 83 deletions.
6 changes: 6 additions & 0 deletions .nuget/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
133 changes: 133 additions & 0 deletions .nuget/NuGet.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>

<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>

<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
</PropertyGroup>

<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>

<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
</PropertyGroup>

<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
<PackagesConfig>packages.config</PackagesConfig>
</PropertyGroup>

<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>

<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>

<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>

<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>

<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " </RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>

<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>

<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>

<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
</Target>

<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>

<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />

<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>

<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />

<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>

<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
22 changes: 22 additions & 0 deletions Html2Article.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>Html2Article</id>
<version>1.17.0</version>
<authors>翟士丹</authors>
<owners>翟士丹</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<projectUrl>https://github.com/stanzhai/Html2Article</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>.NET平台下,一个高效的从Html中提取正文的工具。
正文提取采用了基于文本密度的提取算法,支持从压缩的Html文档中提取正文,每个页面平均提取时间为30ms,正确率在95%以上。 </description>
<releaseNotes></releaseNotes>
<copyright>Copyright StanZhai 2013</copyright>
<tags>Html Article 网页正文提取</tags>
<dependencies>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Web" targetFramework="net40" />
</frameworkAssemblies>
</metadata>
</package>
56 changes: 49 additions & 7 deletions Html2Article.sln
Original file line number Diff line number Diff line change
@@ -1,24 +1,66 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Html2Article", "Html2Article\Html2Article.csproj", "{9CF36626-4608-4467-9ED6-7E9C91A0E121}"
EndProject
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2C4D51DA-94A5-4035-BB74-350CE83CD2DF}"
ProjectSection(SolutionItems) = preProject
Html2Article.nuspec = Html2Article.nuspec
License.md = License.md
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Html2Article", "src\Html2Article\Html2Article.csproj", "{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "src\Demo\Demo.csproj", "{7F199520-F681-4BB7-B64F-79F68B1DFA43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Html2Article.Test", "src\Html2Article.Test\Html2Article.Test.csproj", "{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{FCAEC003-ADBD-4A36-8770-6699086484F4}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9CF36626-4608-4467-9ED6-7E9C91A0E121}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CF36626-4608-4467-9ED6-7E9C91A0E121}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CF36626-4608-4467-9ED6-7E9C91A0E121}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9CF36626-4608-4467-9ED6-7E9C91A0E121}.Release|Any CPU.Build.0 = Release|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Debug|x86.ActiveCfg = Debug|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Release|Any CPU.Build.0 = Release|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{0EDCFCDB-08FC-43AE-B6BB-BAF8D6EDF61E}.Release|x86.ActiveCfg = Release|Any CPU
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Debug|Any CPU.ActiveCfg = Debug|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Debug|Mixed Platforms.Build.0 = Debug|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Debug|x86.ActiveCfg = Debug|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Debug|x86.Build.0 = Debug|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Release|Any CPU.ActiveCfg = Release|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Release|Mixed Platforms.ActiveCfg = Release|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Release|Mixed Platforms.Build.0 = Release|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Release|x86.ActiveCfg = Release|x86
{7F199520-F681-4BB7-B64F-79F68B1DFA43}.Release|x86.Build.0 = Release|x86
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Debug|x86.ActiveCfg = Debug|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Release|Any CPU.Build.0 = Release|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AB667490-AB7D-46A7-A0AF-7BA1C49C1CCA}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

## 让你的项目支持Html正文提取

- **将实例项目中的Html2Article.cs复制到你的项目中。**
- **引入命名空间Html2Article**
- **`PM> Install-Package Html2Article`**
- **引入命名空间`using StanSoft;`**
- **添加如下代码:**

```C#
Expand Down
Binary file added packages/NUnit.2.6.2/NUnit.2.6.2.nupkg
Binary file not shown.
27 changes: 27 additions & 0 deletions packages/NUnit.2.6.2/NUnit.2.6.2.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>NUnit</id>
<version>2.6.2</version>
<title>NUnit</title>
<authors>Charlie Poole</authors>
<owners>Charlie Poole</owners>
<licenseUrl>http://nunit.org/nuget/license.html</licenseUrl>
<projectUrl>http://nunit.org/</projectUrl>
<iconUrl>http://nunit.org/nuget/nunit_32x32.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. A number of runners, both from the NUnit project and by third parties, are able to execute NUnit tests.

Version 2.6 is the seventh major release of this well-known and well-tested programming tool.

This package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner.</description>
<summary>NUnit is a unit-testing framework for all .Net languages with a strong TDD focus.</summary>
<releaseNotes>Version 2.6 is the seventh major release of NUnit.

Unlike earlier versions, this package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner.

The nunit.mocks assembly is now provided by the NUnit.Mocks package. The pnunit.framework assembly is provided by the pNUnit package.</releaseNotes>
<language>en-US</language>
<tags>test testing tdd framework fluent assert theory plugin addin</tags>
</metadata>
</package>
Binary file added packages/NUnit.2.6.2/lib/nunit.framework.dll
Binary file not shown.
Loading

0 comments on commit 9c2ab2b

Please sign in to comment.