Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Add appveyor ci with multi-targeting project #299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 1.0.{build}
image: Visual Studio 2017
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
configuration: Release
build_script:
- cmd: dotnet build -c Release src/HtmlAgilityPack.vs2019.sln
#test_script:
# - cmd: dotnet test -c Release
#after_test:
# - choco install opencover.portable
# - choco install codecov
# - OpenCover.Console.exe -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test -c Release --framework net472 --verbosity q"
# - codecov -f "results.xml"
artifacts:
- path: '**\*.nupkg'
name: nupkg
- path: '**\*.snupkg'
name: snupkg
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nuget:
disable_publish_on_pr: true
#deploy:
# provider: NuGet
# api_key:
# secure:
49 changes: 49 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Project>
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>

<PropertyGroup>
<Version>1.11.1</Version>
<Authors>ZZZ Projects Inc.</Authors>
<Company>ZZZ Projects Inc.</Company>
<Product>Html Agility Pack</Product>
<Copyright>Copyright © ZZZ Projects Inc. 2014 - 2019</Copyright>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)HtmlAgilityPack.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Deterministic>true</Deterministic>
<Features>pdb-path-determinism</Features>
</PropertyGroup>

<PropertyGroup>
<Net20FrameworkPathOverride>$(WINDIR)\Microsoft.NET\Framework\v2.0.50727</Net20FrameworkPathOverride>
<Net35FrameworkPathOverride>$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client;$(Net20FrameworkPathOverride)</Net35FrameworkPathOverride>
</PropertyGroup>

<PropertyGroup>
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>false</EmbedUntrackedSources>
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Net.Compilers" Version="3.*" Condition=" '$(OS)' == 'Windows_NT' ">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/HtmlAgilityPack.Shared/HtmlWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Forum & Issues: https://github.com/zzzprojects/html-agility-pack
// License: https://github.com/zzzprojects/html-agility-pack/blob/master/LICENSE
// More projects: http://www.zzzprojects.com/
// Copyright ZZZ Projects Inc. 2014 - 2017. All rights reserved.
// Copyright ?ZZZ Projects Inc. 2014 - 2017. All rights reserved.

#if !METRO

Expand Down Expand Up @@ -55,7 +55,7 @@ public partial class HtmlWeb
public delegate void PostResponseHandler(HttpWebRequest request, HttpWebResponse response);
#endif

#if NET45 || NETSTANDARD1_3 || NETSTANDARD1_6
#if NETSTANDARD1_3 || NETSTANDARD1_6
/// <summary>
/// Represents the method that will handle the PostResponse event.
/// </summary>
Expand All @@ -72,7 +72,7 @@ public partial class HtmlWeb
/// </summary>
public delegate bool PreRequestHandler(HttpWebRequest request);
#endif
#if NET45 || NETSTANDARD1_3 || NETSTANDARD1_6
#if NETSTANDARD1_3 || NETSTANDARD1_6
/// <summary>
/// Represents the method that will handle the PostResponse event.
/// </summary>
Expand Down
Binary file added src/HtmlAgilityPack.snk
Binary file not shown.
41 changes: 41 additions & 0 deletions src/HtmlAgilityPack.vs2019.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28917.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HtmlAgilityPack", "HtmlAgilityPack\HtmlAgilityPack.csproj", "{C6B167D0-269B-4397-A4D5-02B80D4BCCB2}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "HtmlAgilityPack.Shared", "HtmlAgilityPack.Shared\HtmlAgilityPack.Shared.shproj", "{5BA9A0D7-173F-4C4F-AFFA-3DD6DC2F9A79}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9A5FCC0-8EA7-464F-B2A5-26EB1A4A6F54}"
ProjectSection(SolutionItems) = preProject
..\.gitattributes = ..\.gitattributes
..\.gitignore = ..\.gitignore
..\appveyor.yml = ..\appveyor.yml
Directory.Build.props = Directory.Build.props
HtmlAgilityPack.snk = HtmlAgilityPack.snk
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
HtmlAgilityPack.Shared\HtmlAgilityPack.Shared.projitems*{5ba9a0d7-173f-4c4f-affa-3dd6dc2f9a79}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C6B167D0-269B-4397-A4D5-02B80D4BCCB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6B167D0-269B-4397-A4D5-02B80D4BCCB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6B167D0-269B-4397-A4D5-02B80D4BCCB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6B167D0-269B-4397-A4D5-02B80D4BCCB2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5B6386F5-8B61-4CE7-A90C-18B537F66A18}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions src/HtmlAgilityPack/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System;

[assembly: CLSCompliant(true)]
63 changes: 63 additions & 0 deletions src/HtmlAgilityPack/HtmlAgilityPack.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard1.6;netstandard2.0;net20;net35;net40;net45;</TargetFrameworks>
<AssemblyName>HtmlAgilityPack</AssemblyName>
<RootNamespace>HtmlAgilityPack</RootNamespace>
<PackageId>HtmlAgilityPack</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net20'">$(Net20FrameworkPathOverride)</FrameworkPathOverride>
<DefineConstants Condition=" '$(TargetFramework)' == 'net20' ">FX20;$(DefineConstants)</DefineConstants>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(Net35FrameworkPathOverride)</FrameworkPathOverride>
<DefineConstants Condition=" '$(TargetFramework)' == 'net35' ">FX35;$(DefineConstants)</DefineConstants>
<DefineConstants Condition=" '$(TargetFramework)' == 'net40' ">FX40;$(DefineConstants)</DefineConstants>
<DefineConstants Condition=" '$(TargetFramework)' == 'net45' ">FX40;FX45;$(DefineConstants)</DefineConstants>
<!--<DefineConstants Condition=" '$(TargetFramework)' == 'netcore45' ">METRO;$(DefineConstants)</DefineConstants>-->
</PropertyGroup>

<Import Project="..\HtmlAgilityPack.Shared\HtmlAgilityPack.Shared.projitems" Label="Shared" />

<ItemGroup Condition="
'$(TargetFramework)' == 'net20'
">
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>

<ItemGroup Condition="
'$(TargetFramework)' == 'net35'
">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>

<ItemGroup Condition="
'$(TargetFramework)' == 'net40' or
'$(TargetFramework)' == 'net45'
">
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>

<ItemGroup Condition="
'$(TargetFramework)' == 'netstandard1.3' or
'$(TargetFramework)' == 'netstandard1.6' or
'$(TargetFramework)' == 'netstandard2.0'
">
<PackageReference Include="System.Net.Http" Version="4.3.4" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These libraries all ship OOB with netstandard2.0. Adding a dependency on these for netstandard2.0 is not required, and will only make the dependency graph more complex. Would it be possible to remove the dependency on these for netstandard2.0?

<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" />
<PackageReference Include="System.Xml.XPath" Version="4.3.0" />
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
</ItemGroup>
</Project>