Skip to content

Commit ce9fa5c

Browse files
committed
Prepare scripts for continuous integration.
* Separate build and pack in two separate scripts. * Reuse build output in Build\bin folder, to save build time.
1 parent 576d9cf commit ce9fa5c

File tree

3 files changed

+16
-28
lines changed

3 files changed

+16
-28
lines changed

Scripts/build.cmd

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11
@echo off
2-
setlocal
3-
pushd %~dp0
4-
cd ..
5-
6-
SET BUILD_BASE_DIR=%CD%\Build\ForNuget
7-
SET BUILD_DIR=%BUILD_BASE_DIR%\bin
8-
SET PackageName=UnitsNet
9-
SET NuGetExe=%CD%\Src\.nuget\NuGet.exe
10-
11-
REM ECHO BUILD_DIR=%BUILD_DIR%
12-
13-
RMDIR /S /Q %BUILD_BASE_DIR%
14-
MKDIR %BUILD_DIR%
15-
16-
copy .\%PackageName%.nuspec %BUILD_BASE_DIR%
17-
18-
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:OutDir=%BUILD_DIR% /p:Configuration=Release .\Src\UnitsNet\UnitsNet.net35.csproj
19-
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:OutDir=%BUILD_DIR% /p:Configuration=Release .\Src\UnitsNet\UnitsNet.pcl.csproj
20-
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:OutDir=%BUILD_DIR% /p:Configuration=Release .\Src\UnitsNet\UnitsNet.sl4.csproj
21-
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:OutDir=%BUILD_DIR% /p:Configuration=Release .\Src\UnitsNet\UnitsNet.netcore45.csproj
22-
23-
%NuGetExe% pack %BUILD_BASE_DIR%\%PackageName%.nuspec -Verbosity detailed -OutputDirectory "%BUILD_BASE_DIR%" -BasePath "%BUILD_BASE_DIR%"
24-
25-
popd
2+
SET ROOT=".."
3+
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:Configuration=Release %ROOT%\Src\UnitsNet\UnitsNet.net35.csproj
4+
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:Configuration=Release %ROOT%\Src\UnitsNet\UnitsNet.pcl.csproj
5+
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:Configuration=Release %ROOT%\Src\UnitsNet\UnitsNet.sl4.csproj
6+
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild /t:Rebuild /p:Configuration=Release %ROOT%\Src\UnitsNet\UnitsNet.netcore45.csproj
267
pause

Scripts/pack_nuget.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
SET ROOT=".."
3+
SET NugetSpecFile=%ROOT%\UnitsNet.nuspec
4+
SET NuGetExe=%ROOT%\Src\.nuget\NuGet.exe
5+
6+
%NuGetExe% pack %NugetSpecFile% -Verbosity detailed -OutputDirectory "%ROOT%\Build" -BasePath "%ROOT%"
7+
pause

UnitsNet.nuspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ v1.2: Add force, torque, pressure, mass, voltage, length and length2d units of m
4242
<tags>unit units measurement si metric imperial abbreviation abbreviations convert parse c# .net immutable</tags>
4343
</metadata>
4444
<files>
45-
<file src="bin\UnitsNet.pcl.dll" target="lib\portable-net40+win+sl5+wp8\UnitsNet.pcl.dll" />
46-
<file src="bin\UnitsNet.net35.dll" target="lib\net35-client\UnitsNet.net35.dll" />
47-
<file src="bin\UnitsNet.sl4.dll" target="lib\sl4\UnitsNet.sl4.dll" />
48-
<file src="bin\UnitsNet.netcore45\UnitsNet.netcore45.dll" target="lib\netcore45\UnitsNet.netcore45.dll" />
45+
<file src="Build\bin\AnyCPU_Release\UnitsNet.pcl.dll" target="lib\portable-net40+win+sl5+wp8\UnitsNet.pcl.dll" />
46+
<file src="Build\bin\AnyCPU_Release\UnitsNet.net35.dll" target="lib\net35-client\UnitsNet.net35.dll" />
47+
<file src="Build\bin\AnyCPU_Release\UnitsNet.sl4.dll" target="lib\sl4\UnitsNet.sl4.dll" />
48+
<file src="Build\bin\AnyCPU_Release\UnitsNet.netcore45.dll" target="lib\netcore45\UnitsNet.netcore45.dll" />
4949
</files>
5050
</package>

0 commit comments

Comments
 (0)