Skip to content

Commit e71e015

Browse files
committed
added: NuSpecs
added: Build scripts. ready to publish package.
1 parent 058a222 commit e71e015

21 files changed

+551
-14
lines changed

BuildScripts/Build.bat

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@echo off
2+
setlocal EnableDelayedExpansion
3+
4+
set SLN="..\src\ImTools.sln"
5+
set OUTDIR="..\bin\Release"
6+
7+
set MSBUILDVER=%2
8+
if "%MSBUILDVER%"=="" set MSBUILDVER=14
9+
echo:MsBuild version: %MSBUILDVER%
10+
11+
echo:
12+
echo:Building %SLN% into %OUTDIR% . . .
13+
14+
for /f "tokens=2*" %%S in ('reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\%MSBUILDVER%.0 /v MSBuildToolsPath') do (
15+
16+
if exist "%%T" (
17+
18+
echo:
19+
echo:Using MSBuild from "%%T"
20+
21+
"%%T\MSBuild.exe" %SLN% /t:Rebuild /v:minimal /m /fl /flp:LogFile=MSBuild.log ^
22+
/p:OutDir=%OUTDIR% ^
23+
/p:GenerateProjectSpecificOutputFolder=false ^
24+
/p:Configuration=Release ^
25+
/p:RestorePackages=false ^
26+
/p:BuildInParallel=true
27+
28+
find /C "Build succeeded." MSBuild.log
29+
)
30+
)
31+
32+
endlocal
33+
if not "%1"=="-nopause" pause

BuildScripts/Clean.bat

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@echo off
2+
3+
echo:
4+
echo:Deleting Release and Debug folders . . .
5+
6+
echo:
7+
echo:Switch to solution folder first . . .
8+
pushd "..\src"
9+
10+
if not exist *.sln (
11+
echo:
12+
echo:ERROR: Cleaned folder does not contain solution files, that means it is probably wrong folder. So no cleaning.
13+
popd & exit 1
14+
)
15+
16+
for /d /r %%D IN (b?n;o?j) do (
17+
if exist "%%D\Release" echo "%%D\Release" & rd /s /q "%%D\Release"
18+
if exist "%%D\Debug" echo "%%D\Debug" & rd /s /q "%%D\Debug"
19+
)
20+
21+
echo:
22+
echo:Cleaning succeeded.
23+
popd
24+
25+
if not "%1"=="-nopause" pause

BuildScripts/NuGetPack.bat

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@echo off
2+
pushd "..\src"
3+
4+
set NUGET=".nuget\NuGet.exe"
5+
set PACKAGEDIR="bin\NuGetPackages"
6+
7+
echo:
8+
echo:Packing NuGet packages into %PACKAGEDIR% . . .
9+
10+
if exist %PACKAGEDIR% rd /s /q %PACKAGEDIR%
11+
md %PACKAGEDIR%
12+
13+
echo:
14+
call :ParseVersion "ImTools\Properties\AssemblyInfo.cs"
15+
echo:ImTools v%VER%
16+
echo:================
17+
%NUGET% pack "..\NuGet\ImTools.dll.nuspec" -Version %VER% -OutputDirectory %PACKAGEDIR% -NonInteractive -Symbols
18+
%NUGET% pack "..\NuGet\ImTools.nuspec" -Version %VER% -OutputDirectory %PACKAGEDIR% -NonInteractive
19+
20+
echo:
21+
echo:Packaging succeeded.
22+
popd
23+
24+
if not "%1"=="-nopause" pause
25+
goto:eof
26+
27+
:ParseVersion
28+
set VERFILE=%~1
29+
for /f "usebackq tokens=2,3 delims=:() " %%A in ("%VERFILE%") do (
30+
if "%%A"=="AssemblyInformationalVersion" set VER=%%~B
31+
)
32+
exit /b

BuildScripts/NuGetPublish.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
pushd "..\src"
3+
4+
set NUGET=".nuget\NuGet.exe"
5+
set PACKAGEDIR="bin\NuGetPackages"
6+
set /p APIKEY=<ApiKey.txt
7+
8+
%NUGET% push "%PACKAGEDIR%\ImTools.dll.1.0.0-preview-01.nupkg" -Source https://nuget.org -ApiKey %APIKEY%
9+
%NUGET% push "%PACKAGEDIR%\ImTools.1.0.0-preview-01.nupkg" -Source https://nuget.org -ApiKey %APIKEY%
10+
11+
popd
12+
pause
13+
14+
echo:
15+
echo:Packaging succeeded.

BuildScripts/RunTestsWithCoverage.bat

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@echo off
2+
pushd "..\src"
3+
4+
setlocal EnableDelayedExpansion
5+
6+
set NUNIT="packages\NUnit.ConsoleRunner.3.6.0\tools\nunit3-console.exe"
7+
set OPENCOVER="packages\OpenCover.4.6.519\tools\OpenCover.Console.exe"
8+
set REPORTGEN="packages\ReportGenerator.2.5.5\tools\ReportGenerator.exe"
9+
set REPORTS=bin\Reports
10+
set COVERAGE="%REPORTS%\Coverage.xml"
11+
12+
if not exist %REPORTS% md %REPORTS%
13+
14+
for %%P in (".") do (
15+
for %%T in ("%%P\bin\Release\*Tests.dll") do (
16+
set TESTLIBS=!TESTLIBS! %%T
17+
))
18+
19+
echo:
20+
echo:Running tests with coverage. Results are collected in %COVERAGE% . . .
21+
echo:
22+
echo:from assemblies: %TESTLIBS%
23+
echo:
24+
25+
%OPENCOVER%^
26+
-register:user^
27+
-target:%NUNIT%^
28+
-targetargs:"%TESTLIBS%"^
29+
-filter:"+[*]* -[*Test*]* -[Microsoft*]*"^
30+
-excludebyattribute:*.ExcludeFromCodeCoverageAttribute^
31+
-hideskipped:all^
32+
-output:%COVERAGE%
33+
34+
echo:
35+
echo:Generating HTML coverage report in "%REPORTS%" . . .
36+
echo:
37+
38+
%REPORTGEN%^
39+
-reports:%COVERAGE%^
40+
-targetdir:%REPORTS%^
41+
-reporttypes:Html;HtmlSummary;Badges^
42+
-assemblyfilters:-*Test*^
43+
44+
rem start %REPORTS%\index.htm
45+
46+
echo:
47+
echo:Succeeded.
48+
endlocal
49+
popd
50+
51+
if not "%1"=="-nopause" pause

BuildScripts/_main.bat

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
@echo off
2+
setlocal
3+
4+
rem Parse arguments:
5+
for %%A in (%*) do (
6+
if /i "%%A"=="-NOPAUSE" (set NOPAUSE=1) else (
7+
if /i "%%A"=="-PUBLISH" (set PUBLISH=1) else (
8+
set UNKNOWNARG=1 & echo:Unknown script argument: "%%A"
9+
))
10+
)
11+
if defined UNKNOWNARG (
12+
echo:ERROR: Unknown script arguments, allowed arguments: "-nopause", "-publish"
13+
exit 1
14+
)
15+
16+
echo:
17+
echo:Clean, build, run tests, etc. . .
18+
if defined PUBLISH echo:. . . and publish NuGet packages!
19+
echo:---------------------------------
20+
21+
set SCRIPTDIR="%~dp0"
22+
echo:
23+
echo:Switching to %SCRIPTDIR% . . .
24+
cd /d %SCRIPTDIR%
25+
26+
call Clean -nopause
27+
call :Check
28+
29+
call Build -nopause
30+
call :Check
31+
32+
call RunTestsWithCoverage -nopause
33+
call :Check
34+
35+
call NuGetPack -nopause
36+
call :Check
37+
38+
if defined PUBLISH (
39+
call NuGetPublish -nopause
40+
call :Check
41+
)
42+
43+
echo:------------
44+
echo:All Success.
45+
46+
if not defined NOPAUSE pause
47+
goto:eof
48+
49+
:Check
50+
51+
if %ERRORLEVEL% EQU 123 (
52+
echo:"* Strange MSBuild error 123 that could be ignored."
53+
exit /b
54+
)
55+
56+
if ERRORLEVEL 1 (
57+
echo:
58+
echo:ERROR: One of steps is failed with ERRORLEVEL==%ERRORLEVEL%!
59+
if not defined NOPAUSE pause
60+
exit 1
61+
) else (
62+
exit /b
63+
)

LICENSE renamed to LICENSE.txt

File renamed without changes.

NuGet/ImTools.dll.nuspec

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata>
4+
<id>ImTools.dll</id>
5+
<version>0.0.0</version>
6+
<!-- overridden by "NuGet pack -Version" flag -->
7+
<authors>Maksim Volkau</authors>
8+
<copyright>Copyright © 2016 Maksim Volkau</copyright>
9+
<projectUrl>https://github.com/dadhi/ImTools</projectUrl>
10+
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<description>
13+
Collection of Immutable persistent data structures, Ref, and array manipulations.
14+
Split from DryIoc: https://bitbucket.org/dadhi/dryioc
15+
</description>
16+
<tags>Immutability Persistent HashMap Avl Balanced Tree Map Dictionary Thread-safe Concurrency Functional Atomic</tags>
17+
<releaseNotes>Initial version.</releaseNotes>
18+
<dependencies>
19+
<group targetFramework="netstandard1.0">
20+
<dependency id="System.Collections" version="4.0.11" />
21+
<dependency id="System.Diagnostics.Debug" version="4.0.11" />
22+
<dependency id="System.Diagnostics.Tools" version="4.0.1" />
23+
<dependency id="System.Linq" version="4.1.0" />
24+
<dependency id="System.Linq.Expressions" version="4.1.0" />
25+
<dependency id="System.Reflection" version="4.1.0" />
26+
<dependency id="System.Reflection.Extensions" version="4.0.1" />
27+
<dependency id="System.Runtime" version="4.1.0" />
28+
<dependency id="System.Runtime.Extensions" version="4.1.0" />
29+
<dependency id="System.Threading" version="4.0.11" />
30+
</group>
31+
</dependencies>
32+
</metadata>
33+
<files>
34+
<file src="..\LICENSE.txt" />
35+
36+
<!-- netstandard1.0 (based on PCL 259) -->
37+
<file src="..\src\bin\Release\ImTools.dll" target="lib\netstandard1.0" />
38+
<file src="..\src\bin\Release\ImTools.pdb" target="lib\netstandard1.0" />
39+
<file src="..\src\bin\Release\ImTools.xml" target="lib\netstandard1.0" />
40+
41+
<!-- net35 -->
42+
<file src="..\src\bin\Release\ImTools.dll" target="lib\net35" />
43+
<file src="..\src\bin\Release\ImTools.pdb" target="lib\net35" />
44+
<file src="..\src\bin\Release\ImTools.xml" target="lib\net35" />
45+
46+
<!-- net40 -->
47+
<file src="..\src\bin\Release\ImTools.dll" target="lib\net40" />
48+
<file src="..\src\bin\Release\ImTools.pdb" target="lib\net40" />
49+
<file src="..\src\bin\Release\ImTools.xml" target="lib\net40" />
50+
51+
<!-- net45 -->
52+
<file src="..\src\bin\Release\ImTools.dll" target="lib\net45" />
53+
<file src="..\src\bin\Release\ImTools.pdb" target="lib\net45" />
54+
<file src="..\src\bin\Release\ImTools.xml" target="lib\net45" />
55+
56+
<!-- PCL Profile328 .NET Portable Subset (.NET Framework 4, Silverlight 5, Windows 8, Windows Phone 8.1, Windows Phone Silverlight 8) -->
57+
<file src="..\src\bin\Release\ImTools.dll" target="lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1" />
58+
<file src="..\src\bin\Release\ImTools.pdb" target="lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1" />
59+
<file src="..\src\bin\Release\ImTools.xml" target="lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1" />
60+
61+
<!-- PCL Profile259 .NET Portable Subset (.NET Framework 4.5, Windows 8, Windows Phone 8.1, Windows Phone Silverlight 8) -->
62+
<file src="..\src\bin\Release\ImTools.dll" target="lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1" />
63+
<file src="..\src\bin\Release\ImTools.pdb" target="lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1" />
64+
<file src="..\src\bin\Release\ImTools.xml" target="lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1" />
65+
66+
</files>
67+
</package>

NuGet/ImTools.nuspec

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata minClientVersion="3.3.0">
4+
<id>ImTools</id>
5+
<version>0.0.0</version>
6+
<!-- overridden by "NuGet pack -Version" flag -->
7+
<authors>Maksim Volkau</authors>
8+
<copyright>Copyright © 2016 Maksim Volkau</copyright>
9+
<projectUrl>https://github.com/dadhi/ImTools</projectUrl>
10+
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<description>
13+
Collection of Immutable persistent data structures, Ref, and array manipulations.
14+
Split from DryIoc: https://bitbucket.org/dadhi/dryioc
15+
</description>
16+
<tags>Immutability Persistent HashMap Avl Balanced Tree Map Dictionary Thread-safe Concurrency Functional Atomic</tags>
17+
<releaseNotes>Initial version.</releaseNotes>
18+
<contentFiles>
19+
<files include="cs/any/*.*" buildAction="Compile" />
20+
</contentFiles>
21+
</metadata>
22+
<files>
23+
<file src="..\LICENSE.txt" />
24+
25+
<!--net35-->
26+
<file src="..\src\ImTools\ImTools.cs" target="content\net35\ImTools" />
27+
<file src="..\src\ImTools\ImHashMap.cs" target="content\net35\ImTools" />
28+
29+
<!--net40-->
30+
<file src="..\src\ImTools\ImTools.cs" target="content\net40\ImTools" />
31+
<file src="..\src\ImTools\ImHashMap.cs" target="content\net40\ImTools" />
32+
33+
<!--net45-->
34+
<file src="..\src\ImTools\ImTools.cs" target="content\net45\ImTools" />
35+
<file src="..\src\ImTools\ImHashMap.cs" target="content\net45\ImTools" />
36+
37+
<!-- PCL Profile328: .NET Portable Subset (.NET Framework 4, Silverlight 5, Windows 8, Windows Phone 8.1, Windows Phone Silverlight 8) -->
38+
<file src="..\src\ImTools\ImTools.cs" target="content\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\ImTools" />
39+
<file src="..\src\ImTools\ImHashMap.cs" target="content\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\ImTools" />
40+
41+
<!-- PCL Profile259: .NET Portable Subset (.NET Framework 4.5, Windows 8, Windows Phone 8.1, Windows Phone Silverlight 8) -->
42+
<file src="..\src\ImTools\ImTools.cs" target="content\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\ImTools" />
43+
<file src="..\src\ImTools\ImHashMap.cs" target="content\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\ImTools" />
44+
45+
<!--uap10.0: Universal Windows Platform-->
46+
<file src="..\src\ImTools\ImTools.cs" target="contentFiles\cs\any" />
47+
<file src="..\src\ImTools\ImHashMap.cs" target="contentFiles\cs\any" />
48+
</files>
49+
</package>

build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.\BuildScripts\_main.bat

0 commit comments

Comments
 (0)