Skip to content

Commit

Permalink
NotifyPropertyChangedBase v1.3.0
Browse files Browse the repository at this point in the history
Merge pull request #28 from bramborman/dev
  • Loading branch information
bramborman authored Sep 10, 2017
2 parents cddc9f5 + ce10716 commit 045d552
Show file tree
Hide file tree
Showing 23 changed files with 823 additions and 540 deletions.
25 changes: 0 additions & 25 deletions AfterBuild.ps1

This file was deleted.

120 changes: 120 additions & 0 deletions AppVeyor-Build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# MIT License
#
# Copyright (c) 2017 Marian Dolinský
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

Start-FileDownload "https://raw.githubusercontent.com/bramborman/AppVeyorBuildScripts/master/Scripts/Set-BuildVersion.ps1"
.\Set-BuildVersion.ps1

Start-FileDownload "https://raw.githubusercontent.com/bramborman/AppVeyorBuildScripts/master/Scripts/Set-PureBuildVersion.ps1"
.\Set-PureBuildVersion.ps1

Write-Host "`nVersions patching"
Write-Host "================="
Install-Module -Name powershell-yaml -Force

if($LastExitCode -ne 0)
{
$host.SetShouldExit($LastExitCode)
}

$yaml = Get-Content .\appveyor.yml -Raw
$appveyorConfig = ConvertFrom-Yaml $yaml
$buildVersion = $appveyorConfig.version.Replace('-', '.').Replace("{branch}", $null).Replace("{build}", $env:APPVEYOR_BUILD_NUMBER)
$projectFiles = Get-ChildItem -Include "*.csproj" -Recurse

foreach ($projectFile in $projectFiles)
{
$xml = [xml](Get-Content $projectFile.FullName)

$propertyGroup = $xml | Select-Xml -XPath "/Project/PropertyGroup[Version='1.0.0']"
$propertyGroup = $propertyGroup.Node

$propertyGroup.Version = $buildVersion
$propertyGroup.FileVersion = $buildVersion
$propertyGroup.AssemblyVersion = $buildVersion

if (!($projectFile.Name.Contains("Tests")))
{
$propertyGroup.PackageVersion = $env:APPVEYOR_BUILD_VERSION
}

$xml.Save($projectFile.FullName)

if($LastExitCode -ne 0)
{
$host.SetShouldExit($LastExitCode)
}
}


Write-Host "`nLibrary Build"
Write-Host "============="
dotnet restore
dotnet pack NotifyPropertyChangedBase\NotifyPropertyChangedBase.csproj -c Release -o $(Get-Location)
dotnet build NotifyPropertyChangedBase\NotifyPropertyChangedBase.csproj -c Release --no-incremental /p:DebugType=PdbOnly

Write-Host "`nTests Build"
Write-Host "==========="
dotnet build NotifyPropertyChangedBase.Tests\NotifyPropertyChangedBase.Tests.csproj -c Release

Write-Host "`nArtifacts"
Write-Host "========="

Push-AppveyorArtifact *.nupkg
$projectFolders = Get-ChildItem -Directory -Filter "NotifyPropertyChangedBase*"

foreach ($projectFolder in $projectFolders)
{
$releaseFolder = Join-Path $projectFolder.FullName "\bin\Release"

if (!(Test-Path $releaseFolder))
{
throw "Invalid project release folder. `$releaseFolder: '$releaseFolder'"
}

$zipFileName = "$projectFolder.$env:APPVEYOR_BUILD_VERSION.zip"
7z a $zipFileName "$releaseFolder\*"

Push-AppveyorArtifact $zipFileName
}

Start-FileDownload "https://raw.githubusercontent.com/bramborman/AppVeyorBuildScripts/master/Scripts/Deployment-Skipping.ps1"
.\Deployment-Skipping.ps1

Write-Host "`n.NET Core tests"
Write-Host "==============="
dotnet vstest NotifyPropertyChangedBase.Tests\bin\Release\netcoreapp1.0\NotifyPropertyChangedBase.Tests.NetCore.dll /logger:trx
(New-Object "System.Net.WebClient").UploadFile("https://ci.appveyor.com/api/testresults/mstest/$env:APPVEYOR_JOB_ID", (Resolve-Path "TestResults\*.trx"))

Write-Host "`nCodecov"
Write-Host "======="
choco install opencover.portable codecov --no-progress

$target = "dotnet.exe"
$targetArgs = "test NotifyPropertyChangedBase.Tests\NotifyPropertyChangedBase.Tests.csproj -c Release -f net45 --no-build"
$filter = """+[NotifyPropertyChangedBase*]* -[NotifyPropertyChangedBase.Tests*]*"""
$output = "OpenCoverResults.xml"

OpenCover.Console.exe -register:user -target:$target -targetargs:$targetArgs -filter:$filter -output:$output
codecov -f $output

This file was deleted.

3 changes: 0 additions & 3 deletions NotifyPropertyChangedBase.Net40/Properties/AssemblyInfo.cs

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions NotifyPropertyChangedBase.Net45/Properties/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp1.0;</TargetFrameworks>
<RootNamespace>NotifyPropertyChangedBase.Tests</RootNamespace>
<Title>NotifyPropertyChangedBase.Tests</Title>
<Product>NotifyPropertyChangedBase.Tests</Product>
<PackageId>NotifyPropertyChangedBase.Tests</PackageId>
<Company>Marian Dolinský</Company>
<Authors>Marian Dolinský</Authors>
<Copyright>© 2017 Marian Dolinský</Copyright>
<Version>1.0.0</Version>
<FileVersion>1.0.0.0</FileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<RepositoryUrl>https://github.com/bramborman/NotifyPropertyChangedBase</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>
<ItemGroup>
<None Remove="**\*.orig" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NotifyPropertyChangedBase\NotifyPropertyChangedBase.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
<AssemblyName>NotifyPropertyChangedBase.Tests.Net45</AssemblyName>
<AssemblyTitle>NotifyPropertyChangedBase.Tests.Net45</AssemblyTitle>
<DefineConstants>NET_45;HAVE_COM_ATTRIBUTES</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp1.0'">
<AssemblyName>NotifyPropertyChangedBase.Tests.NetCore</AssemblyName>
<AssemblyTitle>NotifyPropertyChangedBase.Tests.NetCore</AssemblyTitle>
<DefineConstants>NETCOREAPP1_0</DefineConstants>
</PropertyGroup>
</Project>
Loading

0 comments on commit 045d552

Please sign in to comment.