Skip to content

Commit 8553c72

Browse files
committed
Upgrade AppVeyor to VS2019
1 parent 4534b53 commit 8553c72

24 files changed

+161
-676
lines changed

Diff for: appveyor.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 4.6.1.{build}
22
pull_requests:
33
do_not_increment_build_number: true
4-
image: Visual Studio 2017
4+
image: Visual Studio 2019
55
assembly_info:
66
patch: true
77
file: '**\AssemblyInfo.*'
@@ -15,6 +15,8 @@ build_script:
1515
artifacts:
1616
- path: _output\**\*.nupkg
1717
name: nupkg
18+
- path: _output\**\*.snupkg
19+
name: nupkg
1820
deploy:
1921
- provider: NuGet
2022
api_key:

Diff for: common.ps1 renamed to build-common.ps1

+1-16
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ param(
7272
function _DownloadNuget{
7373
param([Parameter(Mandatory=$true,Position=0)]$rootPath)
7474

75-
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe"
75+
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
7676
$targetNugetExe = "$rootPath\nuget.exe"
7777

7878
if(!(Test-Path $targetNugetExe )){
@@ -86,21 +86,6 @@ param([Parameter(Mandatory=$true,Position=0)]$rootPath)
8686
Set-Alias nuget $targetNugetExe -Scope Global
8787
}
8888

89-
function Set-MsBuildAlias()
90-
{
91-
$path = &"$PSScriptRoot\packages\vswhere.2.5.2\tools\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
92-
if ($path) {
93-
$path = join-path $path 'MSBuild\15.0\Bin\MSBuild.exe'
94-
if (test-path $path) {
95-
Set-Alias msbuild $path -Scope Global
96-
Write-Host "MSBuild found at '$path'"
97-
}
98-
else{
99-
Write-Error "MSBuild not found"
100-
}
101-
}
102-
}
103-
10489
function checkExitCode{
10590
if ($lastExitCode -ne 0)
10691
{

Diff for: build.ps1

+31-39
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ param(
33
[string]$configuration = "Release"
44
)
55

6-
. ".\common.ps1"
6+
. "./build-common.ps1"
77

88
$solutionName = "loggly"
99
$sourceUrl = "https://github.com/neutmute/loggly-csharp"
@@ -14,7 +14,7 @@ function init {
1414
$global:rootFolder = Join-Path $rootFolder .
1515
$global:packagesFolder = Join-Path $rootFolder packages
1616
$global:outputFolder = Join-Path $rootFolder _output
17-
17+
1818
# Test for AppVeyor config
1919
if(!(Test-Path Env:\PackageVersion )){
2020
$env:PackageVersion = $env:APPVEYOR_BUILD_VERSION
@@ -28,72 +28,64 @@ function init {
2828
_WriteOut -ForegroundColor $ColorScheme.Banner "-= $solutionName Build =-"
2929
_WriteConfig "rootFolder" $rootFolder
3030
_WriteConfig "version" $env:PackageVersion
31-
3231
}
3332

3433
function restorePackages{
35-
_WriteOut -ForegroundColor $ColorScheme.Banner "nuget, gitlink restore"
34+
_WriteOut -ForegroundColor $ColorScheme.Banner "nuget restore"
3635

3736
New-Item -Force -ItemType directory -Path $packagesFolder
3837
_DownloadNuget $packagesFolder
3938
nuget restore
40-
nuget install gitlink -SolutionDir "$rootFolder" -ExcludeVersion
4139

42-
dotnet restore
40+
dotnet restore "$rootFolder\$solutionName.sln"
41+
42+
checkExitCode
4343
}
4444

4545
function nugetPack{
46-
_WriteOut -ForegroundColor $ColorScheme.Banner "Nuget pack"
47-
48-
New-Item -Force -ItemType directory -Path $outputFolder
46+
_WriteOut -ForegroundColor $ColorScheme.Banner "Nuget pack"
4947

5048
if(!(Test-Path Env:\nuget )){
5149
$env:nuget = nuget
5250
}
53-
54-
nuget pack $rootFolder\Source\Loggly\Loggly.nuspec -o $outputFolder -IncludeReferencedProjects -p Configuration=$configuration -Version $env:PackageVersion
55-
nuget pack $rootFolder\Source\Loggly.Config\Loggly.Config.nuspec -IncludeReferencedProjects -o $outputFolder -p Configuration=$configuration -Version $env:PackageVersion
51+
52+
dotnet pack "$rootFolder\$solutionName.sln" --configuration $configuration --no-build --no-restore -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true -p:EmbedUntrackedSources=true -p:PublishRepositoryUrl=true --output $outputFolder
53+
54+
checkExitCode
5655
}
5756

5857
function nugetPublish{
5958

60-
if(Test-Path Env:\nugetapikey ){
61-
_WriteOut -ForegroundColor $ColorScheme.Banner "Nuget publish..."
62-
&nuget push $outputFolder\* -ApiKey "$env:nugetapikey" -source https://www.nuget.org
63-
}
64-
else{
65-
_WriteOut -ForegroundColor Yellow "nugetapikey environment variable not detected. Skipping nuget publish"
66-
}
59+
if($env:APPVEYOR_PULL_REQUEST_NUMBER){
60+
_WriteOut -ForegroundColor Yellow "Pull Request Build Detected. Skipping Publish"
61+
}
62+
else{
63+
if(Test-Path Env:\nugetapikey ){
64+
_WriteOut -ForegroundColor $ColorScheme.Banner "Nuget publish..."
65+
&nuget push $outputFolder\* -ApiKey "$env:nugetapikey" -source https://www.nuget.org
66+
}
67+
else{
68+
_WriteOut -ForegroundColor Yellow "nugetapikey environment variable not detected. Skipping nuget publish"
69+
}
70+
}
6771
}
6872

6973
function buildSolution{
70-
71-
Set-MsBuildAlias
72-
7374
_WriteOut -ForegroundColor $ColorScheme.Banner "Build Solution"
74-
msbuild "$rootFolder\$solutionName.sln" /p:Configuration=$configuration
75-
76-
#&"$rootFolder\packages\gitlink\build\GitLink.exe" $rootFolder -u $sourceUrl
77-
}
78-
79-
function executeTests{
75+
76+
New-Item -Force -ItemType directory -Path $outputFolder
8077

81-
Write-Host "Execute Tests"
78+
dotnet build "$rootFolder\$solutionName.sln" --configuration $configuration -p:PackageVersion=$env:PackageVersion -p:ContinuousIntegrationBuild=true -p:EmbedUntrackedSources=true -p:PublishRepositoryUrl=true
8279

83-
$testResultformat = ""
84-
$nunitConsole = "$rootFolder\packages\NUnit.ConsoleRunner.3.4.1\tools\nunit3-console.exe"
80+
checkExitCode
81+
}
8582

86-
if(Test-Path Env:\APPVEYOR){
87-
$testResultformat = ";format=AppVeyor"
88-
$nunitConsole = "nunit3-console"
89-
}
9083

91-
& $nunitConsole .\Source\Loggly.Tests\bin\$configuration\Loggly.Tests.dll --result=.\Source\Loggly.Tests\bin\$configuration\nunit-results.xml$testResultformat
84+
function executeTests{
9285

93-
checkExitCode
86+
_WriteOut -ForegroundColor $ColorScheme.Banner "Execute Tests"
9487

95-
#Appveyor may 2017 isn't building vs2017 for me
96-
#dotnet test .\Source\NetStandard\Loggly.Tests\project.json -c $configuration
88+
dotnet test $rootFolder\source\Loggly.Tests
9789

9890
checkExitCode
9991
}

Diff for: loggly.sln

+3-28
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26228.4
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31205.134
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{5B1BDA21-CAE4-4686-B45B-1087AA9A36F4}"
77
ProjectSection(SolutionItems) = preProject
88
.gitignore = .gitignore
99
appveyor.yml = appveyor.yml
10+
build-common.ps1 = build-common.ps1
1011
build.ps1 = build.ps1
11-
common.ps1 = common.ps1
1212
LICENSE = LICENSE
1313
readme.md = readme.md
1414
EndProjectSection
@@ -21,14 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Loggly.Example", "source\Lo
2121
EndProject
2222
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Loggly", "source\Loggly\Loggly.csproj", "{F66349BA-29A6-4336-BA81-993170FC9963}"
2323
EndProject
24-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NetStandard", "NetStandard", "{45F03704-6667-4EF3-A53F-721B01B86442}"
25-
EndProject
26-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Loggly", "source\NetStandard\Loggly\Loggly.csproj", "{4B177388-2A8D-4B79-848C-567E8A48219C}"
27-
EndProject
28-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Loggly.Config", "source\NetStandard\Loggly.Config\Loggly.Config.csproj", "{8CDDFB41-AA21-4975-90E7-42BE6E4583EC}"
29-
EndProject
30-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Loggly.Tests", "source\NetStandard\Loggly.Tests\Loggly.Tests.csproj", "{245FA0D6-B93F-4563-9D2C-88FF628E207C}"
31-
EndProject
3224
Global
3325
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3426
Debug|Any CPU = Debug|Any CPU
@@ -50,27 +42,10 @@ Global
5042
{F66349BA-29A6-4336-BA81-993170FC9963}.Debug|Any CPU.Build.0 = Debug|Any CPU
5143
{F66349BA-29A6-4336-BA81-993170FC9963}.Release|Any CPU.ActiveCfg = Release|Any CPU
5244
{F66349BA-29A6-4336-BA81-993170FC9963}.Release|Any CPU.Build.0 = Release|Any CPU
53-
{4B177388-2A8D-4B79-848C-567E8A48219C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54-
{4B177388-2A8D-4B79-848C-567E8A48219C}.Debug|Any CPU.Build.0 = Debug|Any CPU
55-
{4B177388-2A8D-4B79-848C-567E8A48219C}.Release|Any CPU.ActiveCfg = Release|Any CPU
56-
{4B177388-2A8D-4B79-848C-567E8A48219C}.Release|Any CPU.Build.0 = Release|Any CPU
57-
{8CDDFB41-AA21-4975-90E7-42BE6E4583EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58-
{8CDDFB41-AA21-4975-90E7-42BE6E4583EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
59-
{8CDDFB41-AA21-4975-90E7-42BE6E4583EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
60-
{8CDDFB41-AA21-4975-90E7-42BE6E4583EC}.Release|Any CPU.Build.0 = Release|Any CPU
61-
{245FA0D6-B93F-4563-9D2C-88FF628E207C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62-
{245FA0D6-B93F-4563-9D2C-88FF628E207C}.Debug|Any CPU.Build.0 = Debug|Any CPU
63-
{245FA0D6-B93F-4563-9D2C-88FF628E207C}.Release|Any CPU.ActiveCfg = Release|Any CPU
64-
{245FA0D6-B93F-4563-9D2C-88FF628E207C}.Release|Any CPU.Build.0 = Release|Any CPU
6545
EndGlobalSection
6646
GlobalSection(SolutionProperties) = preSolution
6747
HideSolutionNode = FALSE
6848
EndGlobalSection
69-
GlobalSection(NestedProjects) = preSolution
70-
{4B177388-2A8D-4B79-848C-567E8A48219C} = {45F03704-6667-4EF3-A53F-721B01B86442}
71-
{8CDDFB41-AA21-4975-90E7-42BE6E4583EC} = {45F03704-6667-4EF3-A53F-721B01B86442}
72-
{245FA0D6-B93F-4563-9D2C-88FF628E207C} = {45F03704-6667-4EF3-A53F-721B01B86442}
73-
EndGlobalSection
7449
GlobalSection(ExtensibilityGlobals) = postSolution
7550
SolutionGuid = {61F249B5-3057-47D7-B637-3ED17A6A00B6}
7651
EndGlobalSection

Diff for: source/NetStandard/Loggly.Config/LogTransport.cs renamed to source/Loggly.Config/LogTransport.cs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if !NET45
2+
13
namespace Loggly.Config
24
{
35
/// <summary>
@@ -28,3 +30,5 @@ public enum LogTransport
2830
SyslogTcp,
2931
}
3032
}
33+
34+
#endif

Diff for: source/Loggly.Config/Loggly.Config.csproj

+41-84
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,54 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>10.0.20723</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{58A100CE-CC7E-43BF-A054-D28648F092AC}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>Loggly.Config</RootNamespace>
12-
<AssemblyName>Loggly.Config</AssemblyName>
13-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<TargetFrameworkProfile />
16-
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>TRACE;DEBUG;FEATURE_SYSTEM_CONFIGURATION FEATURE_SYSTEM_ENVIRONMENT_OSVERSION</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
<Prefer32Bit>false</Prefer32Bit>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE;FEATURE_SYSTEM_CONFIGURATION FEATURE_SYSTEM_ENVIRONMENT_OSVERSION</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
<Prefer32Bit>false</Prefer32Bit>
35-
</PropertyGroup>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
363
<PropertyGroup>
4+
<TargetFrameworks>netstandard1.5;netstandard2.0;net45</TargetFrameworks>
5+
<VersionPrefix>4.6.0</VersionPrefix>
6+
7+
<Title>loggly-csharp-config</Title>
8+
<Company>neutmute</Company>
9+
<Authors>neutmute</Authors>
10+
<Description>Configuration classes for loggly clients. Settings are read from app.config or can be programmatically injected at runtime. See readme.md for documentation</Description>
11+
<PackageTags>loggly;syslog;logging</PackageTags>
12+
<PackageIcon>loggly-config.png</PackageIcon>
13+
<PackageProjectUrl>https://github.com/neutmute/loggly-csharp</PackageProjectUrl>
14+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
15+
<RepositoryType>git</RepositoryType>
16+
<RepositoryUrl>https://github.com/neutmute/loggly-csharp.git</RepositoryUrl>
17+
18+
<AssemblyOriginatorKeyFile>../../LogglyCsharp.snk</AssemblyOriginatorKeyFile>
3719
<SignAssembly>true</SignAssembly>
38-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
39-
</PropertyGroup>
40-
<PropertyGroup>
41-
<AssemblyOriginatorKeyFile>..\..\LogglyCsharp.snk</AssemblyOriginatorKeyFile>
20+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
21+
22+
<ProjectGuid>{58A100CE-CC7E-43BF-A054-D28648F092AC}</ProjectGuid>
23+
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' == 'net45'">true</DisableImplicitFrameworkReferences>
24+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4225
</PropertyGroup>
26+
27+
<ItemGroup>
28+
<None Include="../../SolutionItems/loggly-config.png" Link="loggly-config.png" Pack="true" PackagePath="" Visible="false" />
29+
</ItemGroup>
30+
4331
<ItemGroup>
32+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
33+
</ItemGroup>
34+
35+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
4436
<Reference Include="System" />
4537
<Reference Include="System.Configuration" />
46-
<Reference Include="System.Data" />
47-
<Reference Include="System.Xml" />
38+
<Reference Include="System.Core" />
4839
</ItemGroup>
49-
<ItemGroup>
50-
<Compile Include="..\..\SolutionItems\Properties\AssemblyInfo.cs">
51-
<Link>Properties\AssemblyInfo.cs</Link>
52-
</Compile>
53-
<Compile Include="AppConfigPartials\TransportAppConfig.cs" />
54-
<Compile Include="ExtensionMethods\TagExtensions.cs" />
55-
<Compile Include="ExtensionMethods\TransportAppConfig.cs" />
56-
<Compile Include="AppConfigPartials\TagAppConfig.cs" />
57-
<Compile Include="ApplicationNameProvider.cs" />
58-
<Compile Include="Tags\ITag.cs" />
59-
<Compile Include="SearchConfiguration.cs" />
60-
<Compile Include="Tags\SimpleTag.cs" />
61-
<Compile Include="Tags\ComplexTags\ApplicationNameTag.cs" />
62-
<Compile Include="Tags\ComplexTags\ComplexTag.cs" />
63-
<Compile Include="Tags\ComplexTags\OperatingSystemPlatformTag.cs" />
64-
<Compile Include="Tags\ComplexTags\OperatingSystemVersionTag.cs" />
65-
<Compile Include="ConfigurationSection.csd.cs">
66-
<DependentUpon>ConfigurationSection.csd.xsd</DependentUpon>
67-
</Compile>
40+
41+
<ItemGroup Condition=" '$(TargetFramework)' != 'net45'">
42+
<Compile Remove="ConfigurationSection*.*;AppConfigPartials\*.cs" />
43+
</ItemGroup>
44+
45+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45'">
46+
<Compile Remove="ConfigurationSection1.csd.cs" />
6847
<Compile Include="ConfigurationSection1.csd.cs">
6948
<AutoGen>True</AutoGen>
7049
<DesignTime>True</DesignTime>
7150
<DependentUpon>ConfigurationSection.csd</DependentUpon>
7251
</Compile>
73-
<Compile Include="Tags\ComplexTags\HostnameTag.cs" />
74-
<Compile Include="ILogglyConfig.cs" />
75-
<Compile Include="LogglyConfig.cs" />
76-
<Compile Include="AppConfigPartials\LogglyConfig.cs" />
77-
<Compile Include="AppConfigPartials\SearchAppConfig.cs" />
78-
<Compile Include="AppConfigPartials\SimpleTagAppConfig.cs" />
79-
<Compile Include="Properties\AssemblyInfoUnique.cs" />
80-
<Compile Include="TagConfiguration.cs" />
81-
<Compile Include="TransportConfiguration.cs" />
82-
</ItemGroup>
83-
<ItemGroup>
84-
<None Include="..\..\LogglyCsharp.snk">
85-
<Link>LogglyCsharp.snk</Link>
86-
</None>
8752
<None Include="ConfigurationSection.csd">
8853
<Generator>CsdFileGenerator</Generator>
8954
<LastGenOutput>ConfigurationSection1.csd.cs</LastGenOutput>
@@ -101,18 +66,10 @@
10166
<DependentUpon>ConfigurationSection.csd</DependentUpon>
10267
<SubType>Designer</SubType>
10368
</None>
104-
<None Include="Loggly.Config.nuspec" />
10569
</ItemGroup>
70+
10671
<ItemGroup>
10772
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
10873
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
10974
</ItemGroup>
110-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
111-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
112-
Other similar extension points exist, see Microsoft.Common.targets.
113-
<Target Name="BeforeBuild">
114-
</Target>
115-
<Target Name="AfterBuild">
116-
</Target>
117-
-->
118-
</Project>
75+
</Project>

0 commit comments

Comments
 (0)