Prepare for .NET Core

This commit is contained in:
Michael Ganss
2016-06-03 14:47:11 +02:00
parent 61de21acbb
commit 0a33044dc5
9 changed files with 33 additions and 51 deletions

View File

@@ -4,9 +4,6 @@ using AngleSharp.Dom.Html;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ganss.XSS namespace Ganss.XSS
{ {

View File

@@ -2,10 +2,10 @@ using AngleSharp;
using AngleSharp.Dom; using AngleSharp.Dom;
using AngleSharp.Dom.Css; using AngleSharp.Dom.Css;
using AngleSharp.Dom.Html; using AngleSharp.Dom.Html;
using AngleSharp.Extensions;
using AngleSharp.Html; using AngleSharp.Html;
using AngleSharp.Parser.Css; using AngleSharp.Parser.Css;
using AngleSharp.Parser.Html; using AngleSharp.Parser.Html;
using AngleSharp.Extensions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@@ -728,11 +728,7 @@ namespace Ganss.XSS
{ {
return uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped); return uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped);
} }
#if NETSTANDARD
catch (Exception)
#else
catch (UriFormatException) catch (UriFormatException)
#endif
{ {
return null; return null;
} }

View File

@@ -49,10 +49,6 @@
<AssemblyOriginatorKeyFile>HtmlSanitizer.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>HtmlSanitizer.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="AngleSharp, Version=0.9.6.41832, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea, processorArchitecture=MSIL">
<HintPath>..\packages\AngleSharp.0.9.6\lib\net45\AngleSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Net" /> <Reference Include="System.Net" />
@@ -71,7 +67,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="HtmlSanitizer.snk" /> <None Include="HtmlSanitizer.snk" />
<None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,11 @@
{
"dependencies": {
"AngleSharp": "0.9.6"
},
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

View File

@@ -1,5 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following

View File

@@ -1,10 +1,4 @@
using System; namespace Ganss.XSS
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ganss.XSS
{ {
/// <summary> /// <summary>
/// List of reasons why something was identified to get removed from the HTML /// List of reasons why something was identified to get removed from the HTML

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.6" targetFramework="net45" />
</packages>

View File

@@ -13,6 +13,10 @@
"url": "git://github.com/mganss/HtmlSanitizer" "url": "git://github.com/mganss/HtmlSanitizer"
} }
}, },
"buildOptions": {
"keyFile": "HtmlSanitizer.snk",
"publicSign": true
},
"dependencies": { "dependencies": {
"AngleSharp": "0.9.6" "AngleSharp": "0.9.6"
}, },
@@ -25,24 +29,23 @@
} }
}, },
"netstandard1.3": { "netstandard1.3": {
"imports": [ "dotnet" ], "imports": "dotnet",
"buildOptions": { "buildOptions": {
"define": [ "define": [
"NETSTANDARD" "NETSTANDARD"
] ]
}, },
"dependencies": { "dependencies": {
"System.Collections": "4.0.11-rc3-23909", "System.Collections": "4.0.11-rc2-24027",
"System.ComponentModel": "4.0.1-rc2-24027", "System.ComponentModel": "4.0.1-rc2-24027",
"System.Diagnostics.Debug": "4.0.11-rc3-23909", "System.Diagnostics.Debug": "4.0.11-rc2-24027",
"System.Globalization": "4.0.11-rc3-23909", "System.Globalization": "4.0.11-rc2-24027",
"System.IO": "4.1.0-rc3-23909", "System.Linq": "4.1.0-rc2-24027",
"System.Linq": "4.1.0-rc3-23909", "System.Runtime": "4.1.0-rc2-24027",
"System.Runtime": "4.1.0-rc3-23909", "System.Runtime.Extensions": "4.1.0-rc2-24027",
"System.Runtime.Extensions": "4.1.0-rc3-23909", "System.Text.RegularExpressions": "4.0.12-rc2-24027",
"System.Text.RegularExpressions": "4.0.12-rc3-23909", "System.Threading": "4.0.11-rc2-24027"
"System.Threading": "4.0.11-rc3-23909"
} }
} }
} }
} }

View File

@@ -1,4 +1,4 @@
version: 3.2.{build} version: 3.3.{build}
install: install:
- nuget restore - nuget restore
configuration: Release configuration: Release
@@ -14,20 +14,9 @@ environment:
secure: pUUrynbyxCRpsAgGdKBVYDZCilwBmaWQ1Jg+rg5znr0= secure: pUUrynbyxCRpsAgGdKBVYDZCilwBmaWQ1Jg+rg5znr0=
CoverityNotificationEmail: CoverityNotificationEmail:
secure: m/ox72HU97EeJExWEFWx+0M9uov0cydn6E8mSaQzsQE= secure: m/ox72HU97EeJExWEFWx+0M9uov0cydn6E8mSaQzsQE=
build: build_script:
project: HtmlSanitizer.sln - dotnet restore
verbosity: minimal - dotnet pack --version-suffix %APPVEYOR_BUILD_VERSION%
publish_nuget: true
publish_nuget_symbols: true
#after_build:
# - ps: |
# if ($env:CoverityProjectToken)
# {
# cov-build.exe --dir cov-int msbuild /t:Rebuild HtmlSanitizer.sln
# nuget.exe install PublishCoverity -ExcludeVersion
# PublishCoverity\tools\PublishCoverity.exe compress -o coverity.zip -i cov-int
# PublishCoverity\tools\PublishCoverity.exe publish -t "$env:CoverityProjectToken" -e "$env:CoverityNotificationEmail" -r "$env:APPVEYOR_REPO_NAME" -z coverity.zip -d "AppVeyor $env:APPVEYOR_BUILD_VERSION" --codeVersion "$env:APPVEYOR_REPO_COMMIT"
# }
test_script: test_script:
- nuget.exe install OpenCover -ExcludeVersion - nuget.exe install OpenCover -ExcludeVersion
- nuget.exe install NUnit.Runners -ExcludeVersion - nuget.exe install NUnit.Runners -ExcludeVersion
@@ -35,3 +24,5 @@ test_script:
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%" - "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov - pip install codecov
- codecov -f "coverage.xml" - codecov -f "coverage.xml"
artifacts:
- path: '**\*.nupkg'