forked from NEventStore/NEventStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
119 lines (103 loc) · 6.53 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@echo off
set FRAMEWORK_PATH=C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319
set PATH=%PATH%;%FRAMEWORK_PATH%;
:target_config
set TARGET_CONFIG=Release
IF x==%1x goto framework_version
set TARGET_CONFIG=%1
:framework_version
set FRAMEWORK_VERSION=v4.0
set ILMERGE_VERSION=v4,%FRAMEWORK_PATH%
if x==%2x goto build
set FRAMEWORK_VERSION=%2
set ILMERGE_VERSION=%3
:build
if exist output ( rmdir /s /q output )
if exist output ( rmdir /s /q output )
if exist publish ( rmdir /s /q publish )
if exist publish ( rmdir /s /q publish )
mkdir output
mkdir "output\bin"
echo === COMPILING ===
echo Compiling / Target: %FRAMEWORK_VERSION% / Config: %TARGET_CONFIG%
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /p:TargetFrameworkVersion=%FRAMEWORK_VERSION%
echo.
echo === TESTS ===
echo Unit Tests
"bin/machine.specifications-bin/.NET 4.0/mspec.exe" src/tests/EventStore.Core.UnitTests/bin/%TARGET_CONFIG%/EventStore.Core.UnitTests.dll
echo Acceptance Tests
"bin/machine.specifications-bin/.NET 4.0/mspec.exe" src/tests/EventStore.Persistence.AcceptanceTests/bin/%TARGET_CONFIG%/EventStore.Persistence.AcceptanceTests.dll
call acceptance-serialization.cmd
echo.
echo === MERGING ===
echo Merging Primary Assembly
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore/bin/%TARGET_CONFIG%/EventStore.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Core/bin/%TARGET_CONFIG%/EventStore.Core.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Serialization/bin/%TARGET_CONFIG%/EventStore.Serialization.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Persistence.SqlPersistence/bin/%TARGET_CONFIG%/EventStore.Persistence.SqlPersistence.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Wireup/bin/%TARGET_CONFIG%/EventStore.Wireup.dll"
(echo.|set /p =EventStore.*)>exclude.txt
"bin/ilmerge-bin/ILMerge.exe" /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.dll %FILES_TO_MERGE%
del exclude.txt
echo Rereferencing Merged Assembly
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /p:ILMerged=true /p:TargetFrameworkVersion=%FRAMEWORK_VERSION%
mkdir output\plugins\persistence\mongo
echo Merging Mongo Persistence
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Persistence.MongoPersistence/bin/%TARGET_CONFIG%/EventStore.Persistence.MongoPersistence.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Persistence.MongoPersistence.Wireup/bin/%TARGET_CONFIG%/EventStore.Persistence.MongoPersistence.Wireup.dll"
echo EventStore.*>exclude.txt
(echo.|set /p =MongoDB.*)>>exclude.txt
"bin/ilmerge-bin/ILMerge.exe" /keyfile:src/EventStore.snk /internalize:"exclude.txt" /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/plugins/persistence/mongo/EventStore.Persistence.MongoPersistence.dll %FILES_TO_MERGE%
del exclude.txt
copy "src\proj\EventStore.Persistence.MongoPersistence\bin\%TARGET_CONFIG%\MongoDB*.dll" "output\plugins\persistence\mongo"
copy "lib\MongoDB\license.txt" "output\plugins\persistence\mongo"
mkdir output\plugins\persistence\raven
echo Merging Raven Persistence
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Persistence.RavenPersistence/bin/%TARGET_CONFIG%/EventStore.Persistence.RavenPersistence.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Persistence.RavenPersistence.Wireup/bin/%TARGET_CONFIG%/EventStore.Persistence.RavenPersistence.Wireup.dll"
echo EventStore.*>exclude.txt
(echo.|set /p =Raven.*)>>exclude.txt
"bin/ilmerge-bin/ILMerge.exe" /keyfile:src/EventStore.snk /internalize:"exclude.txt" /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/plugins/persistence/raven/EventStore.Persistence.RavenPersistence.dll %FILES_TO_MERGE%
del exclude.txt
copy "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\MissingBitsFromClientProfile.dll" "output\plugins\persistence\raven"
copy "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\Newtonsoft*.dll" "output\plugins\persistence\raven"
copy "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\Raven*.dll" output\plugins\persistence\raven"
copy "lib\RavenDB\license.txt" "output\plugins\persistence\raven"
copy "lib\Json.NET\license.txt" "output\plugins\persistence\raven\Json.NET License.txt"
mkdir output\plugins\serialization\json-net
echo Merging Newtonsoft Json.NET Serialization
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Serialization.Json/bin/%TARGET_CONFIG%/EventStore.Serialization.Json.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Serialization.Json/bin/%TARGET_CONFIG%/Newtonsoft.Json*.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Serialization.Json.Wireup/bin/%TARGET_CONFIG%/EventStore.Serialization.Json.Wireup.dll"
(echo.|set /p =EventStore.*)>>exclude.txt
"bin/ilmerge-bin/ILMerge.exe" /keyfile:src/EventStore.snk /internalize:"exclude.txt" /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/plugins/serialization/json-net/EventStore.Serialization.Json.dll %FILES_TO_MERGE%
del exclude.txt
copy "lib\Json.NET\license.txt" "output\plugins\serialization\json-net"
mkdir output\plugins\serialization\servicestack
echo Merging ServiceStack.Text Serialization
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Serialization.ServiceStack/bin/%TARGET_CONFIG%/EventStore.Serialization.ServiceStack.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Serialization.ServiceStack/bin/%TARGET_CONFIG%/ServiceStack.Text.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src/proj/EventStore.Serialization.ServiceStack.Wireup/bin/%TARGET_CONFIG%/EventStore.Serialization.ServiceStack.Wireup.dll"
(echo.|set /p =EventStore.*)>>exclude.txt
"bin/ilmerge-bin/ILMerge.exe" /keyfile:src/EventStore.snk /internalize:"exclude.txt" /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/plugins/serialization/servicestack/EventStore.Serialization.ServiceStack.dll %FILES_TO_MERGE%
del exclude.txt
copy "lib\ServiceStack\license.txt" "output\plugins\serialization\servicestack"
echo.
echo === FINALIZING ===
echo Copying
mkdir "output\doc"
copy "doc\*.*" "output\doc"
move output publish
echo.
echo === CLEANUP ===
echo Cleaning Build
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean
echo.
echo === DONE ===