Skip to content

Commit 671be9c

Browse files
niemyjskiejsmith
authored andcommitted
Updated the build. Temp copied source into deprecated packages to simplify resource compiling... will be deleted in next release.
1 parent 9704ab3 commit 671be9c

File tree

2 files changed

+7
-71
lines changed

2 files changed

+7
-71
lines changed

build/Package.ps1

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,13 @@ Function Create-Directory([string] $directory_name) {
1414
Create-Directory $artifacts_dir
1515

1616
ForEach ($p in $client_projects) {
17-
$isSignedProject = $($p.Name).EndsWith(".Signed")
18-
$workingDirectory = "$working_dir\$($p.Name)"
19-
Create-Directory $workingDirectory
20-
2117
Write-Host "Building Client NuGet Package: $($p.Name)" -ForegroundColor Yellow
22-
23-
#copy assemblies from build directory to working directory.
24-
ForEach ($b in $client_build_configurations) {
25-
$buildDirectory = "$build_dir\$configuration\$($p.Name)\lib\$($b.NuGetDir)"
26-
$workingLibDirectory = "$workingDirectory\lib\$($b.NuGetDir)"
27-
Create-Directory $workingLibDirectory
28-
29-
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
30-
}
31-
32-
# Copy the source code for Symbol Source.
33-
robocopy $($p.SourceDir) $workingDirectory\src\$($p.SourceDir.Replace($base_dir, """")) *.cs *.xaml /S /NP | Out-Null
34-
Copy-Item "$base_dir\src\GlobalAssemblyInfo.cs" "$workingDirectory\src\src\GlobalAssemblyInfo.cs"
35-
36-
If ((Test-Path -Path "$($p.SourceDir)\NuGet")) {
37-
Copy-Item "$($p.SourceDir)\readme.txt" "$workingDirectory\readme.txt"
38-
Copy-Item "$($p.SourceDir)\NuGet\*" $workingDirectory -Recurse
39-
}
40-
41-
Copy-Item "$($base_dir)\LICENSE.txt" "$workingDirectory"
18+
dotnet pack "$($p.SourceDir)" -c Release -o $artifacts_dir
19+
Write-Host "Building Client NuGet Package: $($p.Name)" -ForegroundColor Yellow
4220

43-
If ($isSignedProject) {
44-
Copy-Item "$($source_dir)\Exceptionless.Signed\NuGet\tools\exceptionless.psm1" "$workingDirectory\tools"
45-
} Else {
46-
Copy-Item "$($source_dir)\Exceptionless\NuGet\tools\exceptionless.psm1" "$workingDirectory\tools"
21+
If (-not $?) {
22+
$anyError = $True
4723
}
48-
49-
$nuspecFile = "$workingDirectory\$($p.Name).nuspec"
50-
If ($isSignedProject) {
51-
$unsignedNuspecFile = $($p.Name).Replace(".Signed", "");
52-
Rename-Item -Path "$workingDirectory\$unsignedNuspecFile.nuspec" -NewName $nuspecFile
53-
}
54-
55-
# update NuGet nuspec file.
56-
$nuspec = [xml](Get-Content $nuspecFile)
57-
If (($($p.ExternalNuGetDependencies) -ne $null) -and (Test-Path -Path "$($p.SourceDir)\packages.config")) {
58-
$packages = [xml](Get-Content "$($p.SourceDir)\packages.config")
59-
60-
ForEach ($d in $($p.ExternalNuGetDependencies).Split(";", [StringSplitOptions]"RemoveEmptyEntries")) {
61-
$package = $packages.SelectSinglenode("/packages/package[@id=""$d""]")
62-
$nuspec | Select-Xml -XPath '//dependency' |% {
63-
If ($_.Node.Id.Equals($d)){
64-
$_.Node.Version = "$($package.version)"
65-
}
66-
}
67-
}
68-
}
69-
70-
If ($isSignedProject) {
71-
$nuspec | Select-Xml -XPath '//id' |% { $_.Node.InnerText = $_.Node.InnerText + ".Signed" }
72-
$nuspec | Select-Xml -XPath '//dependency' |% {
73-
If($_.Node.Id.StartsWith("Exceptionless")){
74-
$_.Node.Id = $_.Node.Id + ".Signed"
75-
}
76-
}
77-
}
78-
79-
$nuspec.Save($nuspecFile);
80-
81-
$nuget_version = $env:APPVEYOR_BUILD_VERSION
82-
If ($env:VERSION_SUFFIX) { $nuget_version = $nuget_version + '-' + $env:VERSION_SUFFIX }
83-
nuget pack $nuspecFile -OutputDirectory $artifacts_dir -Version $nuget_version -Symbols
8424
}
8525

8626
Pop-Location

build/Settings.ps1

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$configuration = "Release"
1+
$configuration = "Release"
22
$base_dir = Resolve-Path "..\"
33
$artifacts_dir = "$base_dir\artifacts"
44
$build_dir = "$base_dir\build"
@@ -29,11 +29,7 @@ $client_projects = @(
2929
@{ Name = "Exceptionless.MessagePack.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.MessagePack.Signed"; ExternalNuGetDependencies = "MessagePack"; },
3030

3131
@{ Name = "Exceptionless.Windows"; SourceDir = "$source_dir\Platforms\Exceptionless.Windows"; ExternalNuGetDependencies = $null; },
32-
@{ Name = "Exceptionless.Windows.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Windows"; ExternalNuGetDependencies = $null; },
32+
@{ Name = "Exceptionless.Windows.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Windows.Signed"; ExternalNuGetDependencies = $null; },
3333
@{ Name = "Exceptionless.Wpf"; SourceDir = "$source_dir\Platforms\Exceptionless.Wpf"; ExternalNuGetDependencies = $null; },
34-
@{ Name = "Exceptionless.Wpf.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Wpf"; ExternalNuGetDependencies = $null; }
35-
)
36-
37-
$client_build_configurations = @(
38-
@{ Constants = "NET45"; TargetFrameworkVersionProperty="NET45"; NuGetDir = "net45"; }
34+
@{ Name = "Exceptionless.Wpf.Signed"; SourceDir = "$source_dir\Platforms\Exceptionless.Wpf.Signed"; ExternalNuGetDependencies = $null; }
3935
)

0 commit comments

Comments
 (0)