@@ -14,73 +14,13 @@ Function Create-Directory([string] $directory_name) {
14
14
Create- Directory $artifacts_dir
15
15
16
16
ForEach ($p in $client_projects ) {
17
- $isSignedProject = $ ($p.Name ).EndsWith(" .Signed" )
18
- $workingDirectory = " $working_dir \$ ( $p.Name ) "
19
- Create- Directory $workingDirectory
20
-
21
17
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
42
20
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
47
23
}
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
84
24
}
85
25
86
26
Pop-Location
0 commit comments