Skip to content

Commit db69704

Browse files
committed
build: Include UnitsNet.WindowsRuntimeComponent project
1 parent d1bddd5 commit db69704

File tree

6 files changed

+31
-19
lines changed

6 files changed

+31
-19
lines changed

Build/UpdateAssemblyInfo.ps1

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.EXAMPLE
77
Set new version.
88
powershell UpdateAssemblyInfo.ps1 1.2.3.4
9-
9+
1010
.NOTES
1111
Author: Andreas Gullberg Larsen
1212
Date: May 2, 2014
@@ -40,37 +40,38 @@ function Get-VersionFromNuspec ([string] $nuspecFilePath) {
4040
}
4141

4242
#-------------------------------------------------------------------------------
43-
# Description: Sets the AssemblyVersion and AssemblyFileVersion of
43+
# Description: Sets the AssemblyVersion and AssemblyFileVersion of
4444
# AssemblyInfo.cs files.
4545
#
4646
# Author: Andreas Larsen
4747
# Version: 1.0
4848
#-------------------------------------------------------------------------------
49-
function Update-AssemblyInfoFiles ([string] $libName) {
49+
function Update-AssemblyInfoFiles ([string] $nuspecFilePath, [string] $assemblyInfoFilePath) {
5050

51-
[Version]$version = Get-VersionFromNuspec "$root\Build\$libName.nuspec"
51+
[Version]$version = Get-VersionFromNuspec "$root\$nuspecFilePath"
5252

5353
$assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
5454
$fileVersionPattern = 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
5555
$assemblyVersion = 'AssemblyVersion("' + $version + '")';
5656
$fileVersion = 'AssemblyFileVersion("' + $version + '")';
57-
58-
Get-ChildItem "$root\$libName\Properties" | Where { $_.PSChildName -match "^AssemblyInfo\.cs$"} | ForEach-Object {
57+
58+
Get-ChildItem "$root\$assemblyInfoFilePath" | ForEach-Object {
5959
$filename = $_.Directory.ToString() + '\' + $_.Name
6060
$filename + ' -> ' + $version
61-
61+
6262
(Get-Content $filename -Encoding UTF8) | ForEach-Object {
6363
% {$_ -replace $assemblyVersionPattern, $assemblyVersion } |
6464
% {$_ -replace $fileVersionPattern, $fileVersion }
6565
} | Set-Content $filename -Encoding UTF8
66-
}
66+
}
6767
}
6868

6969
try {
7070
"Updating assembly info to version: $setVersion"
7171
""
72-
Update-AssemblyInfoFiles "UnitsNet"
73-
Update-AssemblyInfoFiles "UnitsNet.Serialization.JsonNet"
72+
Update-AssemblyInfoFiles "Build\UnitsNet.nuspec" "UnitsNet\Properties\AssemblyInfo.cs"
73+
Update-AssemblyInfoFiles "Build\UnitsNet.WindowsRuntimeComponent.nuspec" "UnitsNet\Properties\AssemblyInfo.WindowsRuntimeComponent.cs"
74+
Update-AssemblyInfoFiles "Build\UnitsNet.Serialization.JsonNet.nuspec" "UnitsNet.Serialization.JsonNet\Properties\AssemblyInfo.cs"
7475
}
7576
catch {
7677
$myError = $_.Exception.ToString()

Build/nuget-restore.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@echo off
22
SET ROOT=%~dp0..
33
SET NuGetExe=%ROOT%\Tools\NuGet.exe
4-
SET SolutionFile=%ROOT%\UnitsNet.sln
5-
%NuGetExe% restore %SolutionFile%
4+
5+
%NuGetExe% restore %ROOT%\UnitsNet.sln
6+
if %errorlevel% neq 0 exit /b %errorlevel%
7+
8+
%NuGetExe% restore %ROOT%\UnitsNet.WindowsRuntimeComponent.sln
69
if %errorlevel% neq 0 exit /b %errorlevel%

Build/pack-nuget.bat

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
@echo off
22
SET ROOT=%~dp0..
3-
SET MainLibNuspec=%ROOT%\Build\UnitsNet.nuspec
4-
SET SerializationLibNuspec=%ROOT%\Build\UnitsNet.Serialization.JsonNet.nuspec
3+
SET MainNuspec=%ROOT%\Build\UnitsNet.nuspec
4+
SET UwpNuspec=%ROOT%\Build\UnitsNet.WindowsRuntimeComponent.nuspec
5+
SET SerializationNuspec=%ROOT%\Build\UnitsNet.Serialization.JsonNet.nuspec
56
SET NuGetExe=%ROOT%\Tools\NuGet.exe
67
SET NuGetOutDir=%ROOT%\Artifacts\NuGet
78

89
mkdir "%NuGetOutDir%"
910

10-
%NuGetExe% pack %MainLibNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols
11+
%NuGetExe% pack %MainNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols
12+
if %errorlevel% neq 0 exit /b %errorlevel%
13+
%NuGetExe% pack %UwpNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols
14+
if %errorlevel% neq 0 exit /b %errorlevel%
15+
%NuGetExe% pack %SerializationNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols
1116
if %errorlevel% neq 0 exit /b %errorlevel%
12-
%NuGetExe% pack %SerializationLibNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols
13-
if %errorlevel% neq 0 exit /b %errorlevel%

Build/run-tests.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ set LogDir=%ROOT%\Artifacts\Logs
44
set TestsBinDir=%ROOT%\Artifacts\Bin\Tests\AnyCPU_Release
55
mkdir %LogDir%
66

7-
%ROOT%\Tools\NUnit\nunit-console.exe "%TestsBinDir%\UnitsNet.Tests.dll" /framework="net-4.0" /xml:%LogDir%\UnitsNet.Tests.xml
7+
%ROOT%\Tools\NUnit\nunit-console.exe "%TestsBinDir%\UnitsNet.Tests.dll" /framework="net-4.5" /xml:%LogDir%\UnitsNet.Tests.xml
88
if %errorlevel% neq 0 exit /b %errorlevel%
99

10-
%ROOT%\Tools\NUnit\nunit-console.exe "%TestsBinDir%\UnitsNet.Serialization.JsonNet.Tests.dll" /framework="net-3.5" /xml:%LogDir%\UnitsNet.Serialization.JsonNet.Tests.xml
10+
%ROOT%\Tools\NUnit\nunit-console.exe "%TestsBinDir%\UnitsNet.WindowsRuntimeComponent.Tests.dll" /framework="net-4.5" /xml:%LogDir%\UnitsNet.WindowsRuntimeComponent.Tests.xml
11+
if %errorlevel% neq 0 exit /b %errorlevel%
12+
13+
%ROOT%\Tools\NUnit\nunit-console.exe "%TestsBinDir%\UnitsNet.Serialization.JsonNet.Tests.dll" /framework="net-4.5" /xml:%LogDir%\UnitsNet.Serialization.JsonNet.Tests.xml
1114
if %errorlevel% neq 0 exit /b %errorlevel%

Build/src.msbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<MSBuild Projects="
2121
$(SrcPath)\UnitsNet.Net35.csproj;
2222
$(SrcPath)\UnitsNet.Portable40.csproj;
23+
$(SrcPath)\UnitsNet.WindowsRuntimeComponent.csproj;
2324
$(SerializationSrcPath)\UnitsNet.Serialization.JsonNet.Net35.csproj"
2425
Properties="Platform=$(Platform);Configuration=$(Configuration);VisualStudioVersion=$(VisualStudioVersion);AllowUnsafeBlocks=true;Retries=15;RetryDelayMilliseconds=5"
2526
Targets="Build">

Build/tests.msbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
<MSBuild Projects="
2121
$(TestsSrcPath)\UnitsNet.Tests.csproj;
22+
$(TestsSrcPath)\UnitsNet.WindowsRuntimeComponent.Tests.csproj;
2223
$(SerializationTestsSrcPath)\UnitsNet.Serialization.JsonNet.Tests.csproj"
2324
Properties="Platform=$(Platform);Configuration=$(Configuration);VisualStudioVersion=$(VisualStudioVersion);AllowUnsafeBlocks=true"
2425
Targets="Build">

0 commit comments

Comments
 (0)