Fix sonarcloud call
Use environment variables and property function in .csproj
This commit is contained in:
@@ -9,14 +9,13 @@ environment:
|
|||||||
nuget:
|
nuget:
|
||||||
disable_publish_on_pr: true
|
disable_publish_on_pr: true
|
||||||
build_script:
|
build_script:
|
||||||
- ps: (Get-Content src\HtmlSanitizer\HtmlSanitizer.csproj).Replace("1.0.0-VERSION", $env:APPVEYOR_BUILD_VERSION) | Set-Content src\HtmlSanitizer\HtmlSanitizer.csproj
|
|
||||||
- dotnet restore
|
- dotnet restore
|
||||||
- dotnet pack --include-symbols --include-source -c Release src\HtmlSanitizer
|
- dotnet pack --include-symbols --include-source -c Release src\HtmlSanitizer
|
||||||
test_script:
|
test_script:
|
||||||
- ps: |
|
- ps: |
|
||||||
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
||||||
dotnet tool install --global dotnet-sonarscanner
|
dotnet tool install --global dotnet-sonarscanner
|
||||||
dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /d:sonar.organization="mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs"
|
dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /o:"mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs"
|
||||||
dotnet build
|
dotnet build
|
||||||
}
|
}
|
||||||
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\..\coverage.xml" test\HtmlSanitizer.Tests\HtmlSanitizer.Tests.csproj -f netcoreapp2.0
|
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\..\coverage.xml" test\HtmlSanitizer.Tests\HtmlSanitizer.Tests.csproj -f netcoreapp2.0
|
||||||
|
|||||||
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>Cleans HTML from constructs that can be used for cross site scripting (XSS)</Description>
|
<Description>Cleans HTML from constructs that can be used for cross site scripting (XSS)</Description>
|
||||||
<Copyright>Copyright 2013-2018 Michael Ganss</Copyright>
|
<Copyright>Copyright 2013-$([System.DateTime]::Now.Year) Michael Ganss</Copyright>
|
||||||
<AssemblyTitle>HtmlSanitizer</AssemblyTitle>
|
<AssemblyTitle>HtmlSanitizer</AssemblyTitle>
|
||||||
<VersionPrefix>1.0.0-VERSION</VersionPrefix>
|
<AppVeyor_Build_Version Condition="'$(APPVEYOR_BUILD_VERSION)' == ''">1.0.0</AppVeyor_Build_Version>
|
||||||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||||||
|
<FileVersion>$(AppVeyor_Build_Version).0</FileVersion>
|
||||||
|
<PackageVersion>$(AppVeyor_Build_Version)</PackageVersion>
|
||||||
<Authors>Michael Ganss</Authors>
|
<Authors>Michael Ganss</Authors>
|
||||||
<TargetFrameworks>net40;net45;netstandard1.3;netstandard2.0;</TargetFrameworks>
|
<TargetFrameworks>net40;net45;netstandard1.3;netstandard2.0;</TargetFrameworks>
|
||||||
<AssemblyName>HtmlSanitizer</AssemblyName>
|
<AssemblyName>HtmlSanitizer</AssemblyName>
|
||||||
@@ -14,36 +17,29 @@
|
|||||||
<PackageId>HtmlSanitizer</PackageId>
|
<PackageId>HtmlSanitizer</PackageId>
|
||||||
<PackageTags>xss;anti;antixss;html;security</PackageTags>
|
<PackageTags>xss;anti;antixss;html;security</PackageTags>
|
||||||
<PackageProjectUrl>https://github.com/mganss/HtmlSanitizer</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/mganss/HtmlSanitizer</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://raw.github.com/mganss/HtmlSanitizer/master/LICENSE.md</PackageLicenseUrl>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>git://github.com/mganss/HtmlSanitizer</RepositoryUrl>
|
<RepositoryUrl>git://github.com/mganss/HtmlSanitizer</RepositoryUrl>
|
||||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);dotnet</PackageTargetFallback>
|
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);dotnet</PackageTargetFallback>
|
||||||
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
|
|
||||||
<AppConfig Condition="'$(TargetFramework)' == 'net40'">app.net40.config</AppConfig>
|
<AppConfig Condition="'$(TargetFramework)' == 'net40'">app.net40.config</AppConfig>
|
||||||
<AutoUnifyAssemblyReferences Condition="'$(TargetFramework)' == 'net40'">false</AutoUnifyAssemblyReferences>
|
<AutoUnifyAssemblyReferences Condition="'$(TargetFramework)' == 'net40'">false</AutoUnifyAssemblyReferences>
|
||||||
<RootNamespace>Ganss.XSS</RootNamespace>
|
<RootNamespace>Ganss.XSS</RootNamespace>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\HtmlSanitizer.xml</DocumentationFile>
|
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\HtmlSanitizer.xml</DocumentationFile>
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AngleSharp" Version="[0.9.11]" />
|
<PackageReference Include="AngleSharp" Version="[0.9.11]" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
|
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net45'">
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
|
|
||||||
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
|
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
|
||||||
<PackageReference Include="System.ComponentModel" Version="4.3.0" />
|
<PackageReference Include="System.ComponentModel" Version="4.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
#if !NETSTANDARD
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("16af04e9-e712-417e-b749-c8d10148dda9")]
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("4.0.0.0")]
|
|
||||||
Reference in New Issue
Block a user