Skip to content

Commit

Permalink
Trying to create nuget package.
Browse files Browse the repository at this point in the history
  • Loading branch information
nstevens1040 committed May 7, 2023
1 parent 88be964 commit 4bb6f28
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 19 deletions.
17 changes: 17 additions & 0 deletions AngleSharp.DOMParser.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>AngleSharp.DOMParser</id>
<version>1.0.9</version>
<title>AngleSharp.DOMParser</title>
<authors>nstevens1040</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">Unlicense</license>
<projectUrl>https://github.com/nstevens1040/AngleSharp.DOMParser</projectUrl>
<description>This library uses AngelSharp to parse an HTML string into a document object model. The library targets .NET Framework 4.7.2 so that it is compatible with Windows PowerShell.</description>
<releaseNotes>First release</releaseNotes>
<copyright>Copyright © nstevens1040 2023</copyright>
<tags>html parser library csharp dom powershell document-object-model dotnet-framework windows-powershell</tags>
<repository type="git" url="https://github.com/nstevens1040/AngleSharp.DOMParser.git" branch="master" commit="" />
</metadata>
</package>
6 changes: 6 additions & 0 deletions AngleSharp.DOMParser.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Debug|x64.ActiveCfg = Debug|x64
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Debug|x64.Build.0 = Debug|x64
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Release|Any CPU.Build.0 = Release|Any CPU
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Release|x64.ActiveCfg = Release|x64
{7AED44B3-5147-4794-BA8B-BFDEC2A60AA5}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
29 changes: 25 additions & 4 deletions AngleSharp.DOMParser/AngleSharp.DOMParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<PackageTags>html;parser;parse;csharp;dom;powershell;document-object-model;dotnet-framework;windows-powershell;dotnet</PackageTags>
<AssemblyVersion>1.0.5</AssemblyVersion>
<FileVersion>1.0.5</FileVersion>
<AssemblyVersion>1.0.9</AssemblyVersion>
<FileVersion>1.0.9</FileVersion>
<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
<Version>1.0.5</Version>
<Version>1.0.9</Version>
<Authors>nstevens1040</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -42,6 +43,24 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>9.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>9.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="AngleSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea, processorArchitecture=MSIL">
<HintPath>..\packages\AngleSharp.1.0.1\lib\net472\AngleSharp.dll</HintPath>
Expand Down Expand Up @@ -76,6 +95,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="AngleSharp.DOMParser.nuspec" />
<None Include="AngleSharp.DOMParser.snk" />
<None Include="app.config" />
<None Include="build.ps1" />
Expand All @@ -84,6 +104,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>C:\Windows\System32\WindowsPowerShell\v1.0\powershell -ep bypass -noprofile -file ..\..\build.ps1</PostBuildEvent>
<PostBuildEvent>cd
C:\Windows\System32\WindowsPowerShell\v1.0\powershell -ep bypass -noprofile -file ..\..\..\build.ps1</PostBuildEvent>
</PropertyGroup>
</Project>
17 changes: 17 additions & 0 deletions AngleSharp.DOMParser/AngleSharp.DOMParser.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>AngleSharp.DOMParser</id>
<version>1.0.9</version>
<title>AngleSharp.DOMParser</title>
<authors>nstevens1040</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">Unlicense</license>
<projectUrl>https://github.com/nstevens1040/AngleSharp.DOMParser</projectUrl>
<description>This library uses AngelSharp to parse an HTML string into a document object model. The library targets .NET Framework 4.7.2 so that it is compatible with Windows PowerShell.</description>
<releaseNotes>First release</releaseNotes>
<copyright>Copyright © nstevens1040 2023</copyright>
<tags>html parser library csharp dom powershell document-object-model dotnet-framework windows-powershell</tags>
<repository type="git" url="https://github.com/nstevens1040/AngleSharp.DOMParser.git" branch="master" commit="" />
</metadata>
</package>
4 changes: 2 additions & 2 deletions AngleSharp.DOMParser/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyVersion("1.0.9.0")]
[assembly: AssemblyFileVersion("1.0.9.0")]
17 changes: 9 additions & 8 deletions AngleSharp.DOMParser/build.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

[cmdletbinding()]
Param()
cd ..\..\
cd ..\..\..\
write-Host "$($PWD.Path)"
#cd [System.IO.FileInfo]::New($MyInvocation.MyCommand.Path).Directory.FullName
remove-item "$($PWD.Path)\ilmerge.3.0.41.nupkg" -ea 0
remove-item -Recurse -Force -Path "$($PWD.Path)\ilmerge.3.0.41" -ea 0
Expand Down Expand Up @@ -36,12 +37,12 @@
/targetplatform:v4 `
/out:.\bin\build\AngleSharp.DomParser.dll `
/keyfile:.\AngleSharp.DOMParser.snk `
.\bin\Debug\AngleSharp.DOMParser.dll `
.\bin\Debug\System.Text.Encoding.CodePages.dll `
.\bin\Debug\AngleSharp.dll `
.\bin\Debug\System.Buffers.dll `
.\bin\Debug\System.Memory.dll `
.\bin\Debug\System.Numerics.Vectors.dll `
.\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
.\bin\Release\AngleSharp.DOMParser.dll `
.\bin\Release\System.Text.Encoding.CodePages.dll `
.\bin\Release\AngleSharp.dll `
.\bin\Release\System.Buffers.dll `
.\bin\Release\System.Memory.dll `
.\bin\Release\System.Numerics.Vectors.dll `
.\bin\Release\System.Runtime.CompilerServices.Unsafe.dll
remove-item -Recurse -Force -Path "$($PWD.Path)\ilmerge.3.0.41" -ea 0
remove-item "$($PWD.Path)\ilmerge.3.0.41.zip" -ea 0
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.0.5
version: 1.0.9
image: Visual Studio 2022
skip_tags: true
before_build:
Expand All @@ -20,12 +20,12 @@ deploy:
api_key:
secure: 1fo4bhFuqGYKGzv2VK9P/beOi1S7DxBO+9Wg98pkKiOxNWPE/p4Fb9sPWk3qhLth
- provider: GitHub
tag: v1.0.5
release: v1.0.5 stable
tag: v1.0.9
release: v1.0.9 stable
description: 'Pushing latest AngleSharp.DOMParser binaries.'
auth_token:
secure: ElzOGqa44YRqwJ9jKgjBNDbPEmxb1Mg3I+0TxsPQg8OdUSOA8T8DwkwoKofTXMQT
artifact: AngleSharp.DOMParser.1.0.5.zip,AngleSharp.DOMParser-latest.nupkg
artifact: AngleSharp.DOMParser.1.0.9.zip,AngleSharp.DOMParser-latest.nupkg
draft: false
prerelease: false
artifacts:
Expand All @@ -34,5 +34,5 @@ artifacts:
type: File
after_build:
- ps: >-
refreshenv; . 7z.exe a "AngleSharp.DOMParser.1.0.5.zip" .\AngleSharp.DOMParser\bin\build\AngleSharp.DOMParser.dll; Push-AppveyorArtifact "$($PWD.Path)\AngleSharp.DOMParser.1.0.5.zip" -FileName "AngleSharp.DOMParser.1.0.5.zip"; if( @(get-childitem -Recurse -Path "$($ENV:TEMP)" ).Where({$_.Extension -eq ".nupkg" -and $_.Name -match "AngleSharp.DOMParser"}) ){ $nupkg = @(get-childitem -Recurse -Path "$($ENV:TEMP)" ).Where({$_.Extension -eq ".nupkg" -and $_.Name -match "AngleSharp.DOMParser"})[0]; Copy-Item $nupkg.FullName . ; Move-Item -LiteralPath "$($PWD.Path)\$($nupkg.Name)" -Destination "$($PWD.Path)\AngleSharp.DOMParser-latest.nupkg"; Push-AppveyorArtifact "$($PWD.Path)\AngleSharp.DOMParser-latest.nupkg" -FileName "AngleSharp.DOMParser-latest.nupkg" }
refreshenv; . 7z.exe a "AngleSharp.DOMParser.1.0.9.zip" .\AngleSharp.DOMParser\bin\build\AngleSharp.DOMParser.dll; Push-AppveyorArtifact "$($PWD.Path)\AngleSharp.DOMParser.1.0.9.zip" -FileName "AngleSharp.DOMParser.1.0.9.zip"; if( @(get-childitem -Recurse -Path "$($ENV:TEMP)" ).Where({$_.Extension -eq ".nupkg" -and $_.Name -match "AngleSharp.DOMParser"}) ){ $nupkg = @(get-childitem -Recurse -Path "$($ENV:TEMP)" ).Where({$_.Extension -eq ".nupkg" -and $_.Name -match "AngleSharp.DOMParser"})[0]; Copy-Item $nupkg.FullName . ; Move-Item -LiteralPath "$($PWD.Path)\$($nupkg.Name)" -Destination "$($PWD.Path)\AngleSharp.DOMParser-latest.nupkg"; Push-AppveyorArtifact "$($PWD.Path)\AngleSharp.DOMParser-latest.nupkg" -FileName "AngleSharp.DOMParser-latest.nupkg" } else { write-host "nupkg not found!" -ForegroundColor Yellow }
48 changes: 48 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

[cmdletbinding()]
Param()
cd ..\..\
write-Host "$($PWD.Path)"
#cd [System.IO.FileInfo]::New($MyInvocation.MyCommand.Path).Directory.FullName
remove-item "$($PWD.Path)\ilmerge.3.0.41.nupkg" -ea 0
remove-item -Recurse -Force -Path "$($PWD.Path)\ilmerge.3.0.41" -ea 0
remove-item "$($PWD.Path)\ilmerge.3.0.41.zip" -ea 0
remove-item ".\bin\AngleSharp.DomParser.ILMerge.log" -ea 0
if((Get-ExecutionPolicy) -notin @([Microsoft.PowerShell.ExecutionPolicy]::Unrestricted,[Microsoft.PowerShell.ExecutionPolicy]::Bypass))
{
if(
[Security.Principal.WindowsPrincipal]::New([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
){
Set-ExecutionPolicy -Scope Process Bypass -Force
Set-ExecutionPolicy -Scope CurrentUser Bypass -Force
Set-ExecutionPolicy -Scope LocalMachine Bypass -Force
Set-ExecutionPolicy Bypass -Force
} else {
Set-ExecutionPolicy -Scope Process Bypass -Force
Set-ExecutionPolicy -Scope CurrentUser Bypass -Force
}
}
[System.Net.WebClient]::New().DownloadFile(
"https://globalcdn.nuget.org/packages/ilmerge.3.0.41.nupkg",
"$($PWD.Path)\ilmerge.3.0.41.nupkg"
)
$null = mkdir "$($PWD.Path)\ilmerge.3.0.41"
Move-Item "$($PWD.Path)\ilmerge.3.0.41.nupkg" "$($PWD.Path)\ilmerge.3.0.41.zip"
Expand-Archive -Path "$($PWD.Path)\ilmerge.3.0.41.zip" -Destination "$($PWD.Path)\ilmerge.3.0.41"
$ilmerge = "$($PWD.Path)\ilmerge.3.0.41\tools\net452\ILMerge.exe"
if(!(Test-Path ".\bin\build" -ea 0)){ $null = mkdir ".\bin\build" }
. $ilmerge /lib:.\bin\Debug `
/log:.\bin\AngleSharp.DomParser.ILMerge.log `
/target:library `
/targetplatform:v4 `
/out:.\bin\build\AngleSharp.DomParser.dll `
/keyfile:.\AngleSharp.DOMParser.snk `
.\bin\Release\AngleSharp.DOMParser.dll `
.\bin\Release\System.Text.Encoding.CodePages.dll `
.\bin\Release\AngleSharp.dll `
.\bin\Release\System.Buffers.dll `
.\bin\Release\System.Memory.dll `
.\bin\Release\System.Numerics.Vectors.dll `
.\bin\Release\System.Runtime.CompilerServices.Unsafe.dll
remove-item -Recurse -Force -Path "$($PWD.Path)\ilmerge.3.0.41" -ea 0
remove-item "$($PWD.Path)\ilmerge.3.0.41.zip" -ea 0

0 comments on commit 4bb6f28

Please sign in to comment.