-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
MakeSourcePackages.ps1
24 lines (19 loc) · 1.42 KB
/
MakeSourcePackages.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Patching all sources with internal attribute for use in source packages
$files = get-childitem . *.cs -rec
foreach ($file in $files)
{
(Get-Content $file.PSPath) |
Foreach-Object { $_ -replace "public static class", "internal static class" } |
Foreach-Object { $_ -replace "public sealed class", "internal sealed class" } |
Foreach-Object { $_ -replace "public class", "internal class" } |
Foreach-Object { $_ -replace "public interface", "internal interface" } |
Set-Content -Encoding UTF8 $file.PSPath
}
# Getting packages versions
$xmlVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$PSScriptRoot/src/Simplify.Xml/bin/Release/netstandard2.0/Simplify.Xml.dll").FileVersion
$stringVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$PSScriptRoot/src/Simplify.String/bin/Release/netstandard2.0/Simplify.String.dll").FileVersion
$systemVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$PSScriptRoot/src/Simplify.System/bin/Release/netstandard2.0/Simplify.System.dll").FileVersion
# Packing source packages
src\.nuget\NuGet.exe pack src/Simplify.Xml/Simplify.Xml.Sources.nuspec -Version $xmlVersion -OutputDirectory ./src/publish/
src\.nuget\NuGet.exe pack src/Simplify.String/Simplify.String.Sources.nuspec -Version $stringVersion -OutputDirectory ./src/publish/
src\.nuget\NuGet.exe pack src/Simplify.System/Simplify.System.Sources.nuspec -Version $systemVersion -OutputDirectory ./src/publish/