Skip to content

Commit cba3bb1

Browse files
committed
WIP More csproj updates #142
1 parent 1007e97 commit cba3bb1

File tree

31 files changed

+385
-58
lines changed

31 files changed

+385
-58
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/TestResults
2-
/Build
3-
41
## Ignore Visual Studio temporary files, build results, and
52
## files generated by popular Visual Studio add-ons.
63

@@ -15,7 +12,6 @@
1512
[Dd]ebug/
1613
[Rr]elease/
1714
x64/
18-
build/
1915
[Bb]in/
2016
[Oo]bj/
2117
src/Samples/Exceptionless.SampleConsole/store

build/Build.ps1

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Push-Location $PSScriptRoot
2+
. .\Settings.ps1
3+
4+
$anyError = $False
5+
6+
ForEach ($p in $client_projects) {
7+
If (Test-Path "$($p.SourceDir)\project.json") {
8+
Write-Host "Building $($p.Name)" -ForegroundColor Yellow
9+
dotnet build "$($p.SourceDir)" -c Release
10+
Write-Host "Finished building $($p.Name)" -ForegroundColor Yellow
11+
12+
If ($LASTEXITCODE -ne 0) {
13+
$anyError = $True
14+
}
15+
16+
Continue;
17+
}
18+
19+
ForEach ($b in $client_build_configurations) {
20+
$outputDirectory = "$build_dir\$configuration\$($p.Name)\lib\$($b.NuGetDir)"
21+
Write-Host "Building $($p.Name) ($($b.TargetFrameworkVersionProperty))" -ForegroundColor Yellow
22+
23+
If ($($p.Name).EndsWith(".Signed")) {
24+
$name = $($p.Name).Replace(".Signed", "");
25+
msbuild "$($p.SourceDir)\$name.csproj" `
26+
/p:AssemblyName="$($p.Name)" `
27+
/p:DocumentationFile="bin\$($configuration)\$($b.TargetFrameworkVersionProperty)\$($p.Name).Signed.xml" `
28+
/p:SignAssembly=true `
29+
/p:AssemblyOriginatorKeyFile="$sign_file" `
30+
/p:Configuration="$configuration" `
31+
/p:Platform="AnyCPU" `
32+
/p:NoWarn="1591" `
33+
/verbosity:minimal `
34+
/p:DefineConstants="`"TRACE;SIGNED;$($b.Constants)`"" `
35+
/p:OutputPath="$outputDirectory" `
36+
/p:TargetPortable="$targetPortable" `
37+
/p:TargetFrameworkVersionProperty="$($b.TargetFrameworkVersionProperty)" `
38+
/t:"Rebuild"
39+
} else {
40+
msbuild "$($p.SourceDir)\$($p.Name).csproj" `
41+
/p:AssemblyName="$($p.Name)" `
42+
/p:DocumentationFile="bin\$($configuration)\$($b.TargetFrameworkVersionProperty)\$($p.Name).xml" `
43+
/p:SignAssembly=false `
44+
/p:Configuration="$configuration" `
45+
/p:Platform="AnyCPU" `
46+
/p:NoWarn="1591" `
47+
/verbosity:minimal `
48+
/p:DefineConstants="`"TRACE;$($b.Constants)`"" `
49+
/p:OutputPath="$outputDirectory" `
50+
/p:TargetPortable="$targetPortable" `
51+
/p:TargetFrameworkVersionProperty="$($b.TargetFrameworkVersionProperty)" `
52+
/t:"Rebuild"
53+
}
54+
If ($LASTEXITCODE -ne 0) {
55+
$anyError = $True
56+
}
57+
58+
Write-Host "Finished building $($p.Name) ($($b.TargetFrameworkVersionProperty))" -ForegroundColor Yellow
59+
}
60+
}
61+
62+
Pop-Location
63+
64+
If ($anyError) {
65+
throw "One or more builds failed"
66+
}

build/DisplayEnvironmentInfo.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
$isPr = "No";
2+
if ($env:APPVEYOR_PULL_REQUEST_NUMBER)
3+
{
4+
$isPr = "Yes = PR #: " + $env:APPVEYOR_PULL_REQUEST_NUMBER
5+
}
6+
7+
Write-Host " *** AppVeyor configuration information ***" -ForegroundColor Yellow
8+
" Account Name: " + $env:APPVEYOR_ACCOUNT_NAME
9+
Write-Host " Version: $env:APPVEYOR_BUILD_VERSION" -ForegroundColor Red
10+
" Git Repo"
11+
" - Name: " + $env:APPVEYOR_REPO_NAME
12+
" - Branch: " + $env:APPVEYOR_REPO_BRANCH
13+
Write-Host " - Info: $env:APPVEYOR_REPO_COMMIT / $env:APPVEYOR_REPO_COMMIT_AUTHOR / $env:APPVEYOR_REPO_COMMIT_TIMESTAMP" -ForegroundColor Gray
14+
Write-Host " '$env:APPVEYOR_REPO_COMMIT_MESSAGE'" -ForegroundColor Gray
15+
" - Is a PR: " + $isPr
16+
" Platform: " + $env:PLATFORM
17+
" Configuration: " + $env:CONFIGURATION
18+
" --------------------------------------------------------------------------"
19+
""

build/Package.ps1

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Push-Location $PSScriptRoot
2+
. .\Settings.ps1
3+
4+
Function Create-Directory([string] $directory_name) {
5+
If (Test-Path -Path $directory_name) {
6+
Remove-Item -Recurse -Force -Path $directory_name | Out-Null
7+
}
8+
9+
If (!(Test-Path -Path $directory_name)) {
10+
New-Item $directory_name -ItemType Directory | Out-Null
11+
}
12+
}
13+
14+
Create-Directory $artifacts_dir
15+
16+
ForEach ($p in $client_projects) {
17+
If (Test-Path "$($p.SourceDir)\project.json") {
18+
Write-Host "Building Client NuGet Package: $($p.Name)" -ForegroundColor Yellow
19+
dotnet pack "$($p.SourceDir)" -c Release -o $artifacts_dir
20+
Write-Host "Building Client NuGet Package: $($p.Name)" -ForegroundColor Yellow
21+
22+
If (-not $?) {
23+
$anyError = $True
24+
}
25+
26+
Continue;
27+
}
28+
29+
$isSignedProject = $($p.Name).EndsWith(".Signed")
30+
$workingDirectory = "$working_dir\$($p.Name)"
31+
Create-Directory $workingDirectory
32+
33+
Write-Host "Building Client NuGet Package: $($p.Name)" -ForegroundColor Yellow
34+
35+
#copy assemblies from build directory to working directory.
36+
ForEach ($b in $client_build_configurations) {
37+
$buildDirectory = "$build_dir\$configuration\$($p.Name)\lib\$($b.NuGetDir)"
38+
$workingLibDirectory = "$workingDirectory\lib\$($b.NuGetDir)"
39+
Create-Directory $workingLibDirectory
40+
41+
Get-ChildItem -Path $buildDirectory | Where-Object { $_.Name -eq "$($p.Name).dll" -Or $_.Name -eq "$($p.Name).pdb" -or $_.Name -eq "$($p.Name).xml" } | Copy-Item -Destination $workingLibDirectory
42+
}
43+
44+
# Copy the source code for Symbol Source.
45+
robocopy $($p.SourceDir) $workingDirectory\src\$($p.SourceDir.Replace($base_dir, """")) *.cs *.xaml /S /NP | Out-Null
46+
Copy-Item "$base_dir\src\GlobalAssemblyInfo.cs" "$workingDirectory\src\src\GlobalAssemblyInfo.cs"
47+
48+
If ((Test-Path -Path "$($p.SourceDir)\NuGet")) {
49+
Copy-Item "$($p.SourceDir)\readme.txt" "$workingDirectory\readme.txt"
50+
Copy-Item "$($p.SourceDir)\NuGet\*" $workingDirectory -Recurse
51+
}
52+
53+
Copy-Item "$($base_dir)\LICENSE.txt" "$workingDirectory"
54+
55+
If ($isSignedProject) {
56+
Copy-Item "$($source_dir)\Exceptionless.Signed\NuGet\tools\exceptionless.psm1" "$workingDirectory\tools"
57+
} Else {
58+
Copy-Item "$($source_dir)\Exceptionless\NuGet\tools\exceptionless.psm1" "$workingDirectory\tools"
59+
}
60+
61+
$nuspecFile = "$workingDirectory\$($p.Name).nuspec"
62+
If ($isSignedProject) {
63+
$unsignedNuspecFile = $($p.Name).Replace(".Signed", "");
64+
Rename-Item -Path "$workingDirectory\$unsignedNuspecFile.nuspec" -NewName $nuspecFile
65+
}
66+
67+
# update NuGet nuspec file.
68+
$nuspec = [xml](Get-Content $nuspecFile)
69+
If (($($p.ExternalNuGetDependencies) -ne $null) -and (Test-Path -Path "$($p.SourceDir)\packages.config")) {
70+
$packages = [xml](Get-Content "$($p.SourceDir)\packages.config")
71+
72+
ForEach ($d in $($p.ExternalNuGetDependencies).Split(";", [StringSplitOptions]"RemoveEmptyEntries")) {
73+
$package = $packages.SelectSinglenode("/packages/package[@id=""$d""]")
74+
$nuspec | Select-Xml -XPath '//dependency' |% {
75+
If ($_.Node.Id.Equals($d)){
76+
$_.Node.Version = "$($package.version)"
77+
}
78+
}
79+
}
80+
}
81+
82+
If ($isSignedProject) {
83+
$nuspec | Select-Xml -XPath '//id' |% { $_.Node.InnerText = $_.Node.InnerText + ".Signed" }
84+
$nuspec | Select-Xml -XPath '//dependency' |% {
85+
If($_.Node.Id.StartsWith("Exceptionless")){
86+
$_.Node.Id = $_.Node.Id + ".Signed"
87+
}
88+
}
89+
}
90+
91+
$nuspec.Save($nuspecFile);
92+
93+
$nuget_version = $env:APPVEYOR_BUILD_VERSION + $env:VERSION_SUFFIX
94+
nuget pack $nuspecFile -OutputDirectory $artifacts_dir -Version $nuget_version -Symbols
95+
}
96+
97+
Pop-Location

build/Settings.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$configuration = "Release"
2+
$base_dir = Resolve-Path "..\"
3+
$artifacts_dir = "$base_dir\artifacts"
4+
$build_dir = "$base_dir\build"
5+
$source_dir = "$base_dir\src"
6+
$working_dir = "$build_dir\working"
7+
$sign_file = "$source_dir\Exceptionless.snk"
8+
9+
$client_projects = @(
10+
@{ Name = "Exceptionless"; SourceDir = "$source_dir\Exceptionless"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
11+
@{ Name = "Exceptionless.Signed"; SourceDir = "$source_dir\Exceptionless"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
12+
@{ Name = "Exceptionless.Portable"; SourceDir = "$source_dir\Exceptionless.Portable"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
13+
@{ Name = "Exceptionless.Portable.Signed"; SourceDir = "$source_dir\Exceptionless.Portable"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
14+
@{ Name = "Exceptionless.AspNetCore"; SourceDir = "$source_dir\Platforms\Exceptionless.AspNetCore"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
15+
@{ Name = "Exceptionless.AspNetCore.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.AspNetCore"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
16+
@{ Name = "Exceptionless.Mvc"; SourceDir = "$source_dir\Platforms\Exceptionless.Mvc"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
17+
@{ Name = "Exceptionless.Mvc.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Mvc"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
18+
@{ Name = "Exceptionless.Nancy"; SourceDir = "$source_dir\Platforms\Exceptionless.Nancy"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
19+
@{ Name = "Exceptionless.WebApi"; SourceDir = "$source_dir\Platforms\Exceptionless.WebApi"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
20+
@{ Name = "Exceptionless.WebApi.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.WebApi"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
21+
@{ Name = "Exceptionless.Web"; SourceDir = "$source_dir\Platforms\Exceptionless.Web"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
22+
@{ Name = "Exceptionless.Web.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Web"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
23+
@{ Name = "Exceptionless.Windows"; SourceDir = "$source_dir\Platforms\Exceptionless.Windows"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
24+
@{ Name = "Exceptionless.Windows.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Windows"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
25+
@{ Name = "Exceptionless.Wpf"; SourceDir = "$source_dir\Platforms\Exceptionless.Wpf"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
26+
@{ Name = "Exceptionless.Wpf.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Wpf"; ExternalNuGetDependencies = $null; UseMSBuild = $false; },
27+
@{ Name = "Exceptionless.NLog"; SourceDir = "$source_dir\Platforms\Exceptionless.NLog"; ExternalNuGetDependencies = "NLog"; UseMSBuild = $false; }
28+
@{ Name = "Exceptionless.NLog.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.NLog"; ExternalNuGetDependencies = "NLog"; UseMSBuild = $false; }
29+
@{ Name = "Exceptionless.Log4net"; SourceDir = "$source_dir\Platforms\Exceptionless.Log4net"; ExternalNuGetDependencies = "log4net"; UseMSBuild = $false; }
30+
@{ Name = "Exceptionless.Log4net.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Log4net"; ExternalNuGetDependencies = "log4net"; UseMSBuild = $false; }
31+
32+
@{ Name = "Exceptionless.Windows"; SourceDir = "$source_dir\Platforms\Exceptionless.Windows"; ExternalNuGetDependencies = $null; UseMSBuild = $true; },
33+
@{ Name = "Exceptionless.Windows.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Windows"; ExternalNuGetDependencies = $null; UseMSBuild = $true; },
34+
@{ Name = "Exceptionless.Wpf"; SourceDir = "$source_dir\Platforms\Exceptionless.Wpf"; ExternalNuGetDependencies = $null; UseMSBuild = $true; },
35+
@{ Name = "Exceptionless.Wpf.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Wpf"; ExternalNuGetDependencies = $null; UseMSBuild = $true; },
36+
)
37+
38+
$client_build_configurations = @(
39+
@{ Constants = "NET45"; TargetFrameworkVersionProperty="NET45"; NuGetDir = "net45"; }
40+
)

build/common.props

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project ToolsVersion="15.0">
2+
<Import Project="version.props" />
3+
4+
<PropertyGroup>
5+
<Product>Exceptionless</Product>
6+
<Description>Exceptionless is a cloud based error reporting service that sends your exceptions to https://exceptionless.com and provides aggregated views and analytics.</Description>
7+
<Copyright>Copyright (c) 2017 Exceptionless. All rights reserved.</Copyright>
8+
<Authors>Exceptionless</Authors>
9+
<NoWarn>$(NoWarn);CS1591</NoWarn>
10+
<WarningsAsErrors>true</WarningsAsErrors>
11+
<DebugType>portable</DebugType>
12+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
13+
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
14+
<IncludeSymbols>True</IncludeSymbols>
15+
<IncludeSource>True</IncludeSource>
16+
17+
<PackageReleaseNotes>https://github.com/exceptionless/Exceptionless.Net/releases</PackageReleaseNotes>
18+
<PackageIconUrl>https://be.exceptionless.io/img/exceptionless-32.png</PackageIconUrl>
19+
<PackageProjectUrl>https://github.com/exceptionless/Exceptionless.Net</PackageProjectUrl>
20+
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
21+
<RepositoryType>git</RepositoryType>
22+
<RepositoryUrl>https://github.com/exceptionless/Exceptionless.Net</RepositoryUrl>
23+
<VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
24+
25+
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
26+
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
27+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
28+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
29+
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
30+
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
31+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
32+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
33+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
34+
</PropertyGroup>
35+
</Project>

build/version.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
2+
<Project>
3+
<PropertyGroup>
4+
<VersionPrefix>4.0.0</VersionPrefix>
5+
<VersionSuffix>dev</VersionSuffix>
6+
</PropertyGroup>
7+
</Project>

samples/Exceptionless.SampleAspNetCore/Exceptionless.SampleAspNetCore.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
21-
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
22-
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
23-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
24-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.0.2" />
25-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
26-
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
27-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
28-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" />
20+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
21+
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
22+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
23+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
24+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
26+
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
27+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
28+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
2929
</ItemGroup>
3030

3131
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">

src/Exceptionless/Exceptionless.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<AssemblyName>$(AssemblyName).Signed</AssemblyName>
1616
</PropertyGroup>
1717

18+
<ItemGroup>
19+
<Compile Include="..\GlobalAssemblyInfo.cs" Link="Properties\GlobalAssemblyInfo.cs" />
20+
</ItemGroup>
21+
1822
<ItemGroup>
1923
<EmbeddedResource Include="Newtonsoft.Json\Dynamic.snk">
2024
<Link>Exceptionless.Json.Dynamic.snk</Link>

src/Exceptionless/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using System;
2-
using System.Reflection;
32
using System.Runtime.CompilerServices;
43
using System.Runtime.InteropServices;
54

65
[assembly: CLSCompliant(true)]
76
[assembly: ComVisible(false)]
7+
[assembly: AssemblyTitle("Exceptionless")]
8+
[assembly: AssemblyDescription("Exceptionless")]
89

910
#if !PORTABLE && !NETSTANDARD1_2
1011
[assembly: Guid("2d458cc4-3bb3-4852-b6a2-11d5ac8672df")]

0 commit comments

Comments
 (0)