-
Notifications
You must be signed in to change notification settings - Fork 4
/
BuildAll.csproj
169 lines (116 loc) · 5.64 KB
/
BuildAll.csproj
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<Configuration>Release</Configuration>
<OutputPathForDist>$(MSBuildProjectDirectory)\install\build\</OutputPathForDist>
<DistPath>$(MSBuildProjectDirectory)\dist\</DistPath>
<Solution>$(MSBuildProjectDirectory)\src\1Script.sln</Solution>
<InstallerStandartPath>"C:\Program Files (x86)\Inno Setup 5\iscc.exe"</InstallerStandartPath>
<Major>1</Major>
<Minor>0</Minor>
<Build>9</Build>
<Revision>0</Revision>
</PropertyGroup>
<PropertyGroup Condition=" '$(BUILD_NUMBER)' != '' ">
<!-- CI Build Number -->
<Revision>$(BUILD_NUMBER)</Revision>
</PropertyGroup>
<ItemGroup>
<DefaultExclude Include="**\.git\**" />
<DefaultExclude Include="**\.git*" />
<DefaultExclude Include="**\*.pdb" />
<DefaultExclude Include="**\*.XML" />
<DefaultExclude Include="*.zip" />
<DefaultExclude Include="$(OutputPathForDist)\*.pdb" />
<DefaultExclude Include="$(OutputPathForDist)\*.XML" />
</ItemGroup>
<Target Name="VersionGenerate">
<Time>
<Output TaskParameter="Month" PropertyName="Month" />
<Output TaskParameter="Day" PropertyName="Day" />
<Output TaskParameter="Year" PropertyName="Year" />
</Time>
<AssemblyInfo CodeLanguage="CS"
OutputFile="src\GlobalAssemblyInfo.cs"
GenerateClass="true"
AssemblyCompany="BeaverSoft"
AssemblyCopyright="Copyright (c) 2014 BeaverSoft"
AssemblyConfiguration="Configuration=$(Configuration) Commit $(CommitHash)"
AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)"
AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)"
AssemblyInformationalVersion="$(Major).$(Minor).$(Build).$(Revision)" />
</Target>
<Target Name="Configure">
<GitVersion LocalPath="$(MSBuildProjectDirectory)">
<Output TaskParameter="CommitHash" PropertyName="CommitHash" />
</GitVersion>
<!--CI server will be generate build numbaer and regenerate all AssemblyInfo without commit-->
<CallTarget Targets="VersionGenerate" Condition=" '$(BUILD_NUMBER)' != '' "/>
<Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
<Message Text="Commit Hash: $(CommitHash)"/>
</Target>
<Target Name="Build" DependsOnTargets="CleanAll;Configure;Compile;CreateInstall" >
<CallTarget Targets="ContinueBuild" />
</Target>
<Target Name="Compile">
<MSBuild Projects="$(Solution)" Properties="Configuration=$(Configuration);OutputPath=$(OutputPathForDist)" />
<CreateItem Include="$(OutputPathForDist)\*.pdb;$(OutputPathForDist)\*.XML">
<Output TaskParameter="Include" ItemName="RemoveUnnessesaryFiles" />
</CreateItem>
<Delete Files="@(RemoveUnnessesaryFiles)" />
<!--TODO Why Snheopat.Engine build into source dir -->
<ItemGroup>
<SnegopatEngine Include="$(MSBuildProjectDirectory)\src\Release\ScriptEngine.Snegopat.dll"/>
</ItemGroup>
<Copy SourceFiles="@(SnegopatEngine)" DestinationFolder="$(OutputPathForDist)\" />
</Target>
<Target Name="CleanAll">
<CreateItem Include="$(OutputPathForDist)\*">
<Output TaskParameter="Include" ItemName="RemoveFiles" />
</CreateItem>
<CreateItem Include="$(DistPath)\*">
<Output TaskParameter="Include" ItemName="RemoveDistrs" />
</CreateItem>
<CreateItem Include="$(MSBuildProjectDirectory)\tests\*.os.xml">
<Output TaskParameter="Include" ItemName="RemoveXMLTestResultOnClean" />
</CreateItem>
<Delete Files="@(RemoveFiles)" />
<Delete Files="@(RemoveDistrs)" />
<Delete Files="@(RemoveXMLTestResultOnClean)" />
<MSBuild Projects="$(Solution)" Targets="Clean" Properties="Configuration=$(Configuration);OutputPath=$(OutputPathForDist)"/>
</Target>
<Target Name="CreateInstall">
<Exec Command="$(InstallerStandartPath) $(MSBuildProjectDirectory)\install\install.iss /o./dist" />
</Target>
<Target Name="ContinueBuild">
<!--TODO Add Wix cretation MSI-->
</Target>
<!--aditional tasks-->
<Target Name="xUnitTest">
<ItemGroup>
<TestFiles Include="$(MSBuildProjectDirectory)\tests\*.os" Exclude="$(MSBuildProjectDirectory)\tests\testrunner.os"/>
</ItemGroup>
<CreateItem Include="$(MSBuildProjectDirectory)\tests\*.os.xml">
<Output TaskParameter="Include" ItemName="RemoveXMLTestResult" />
</CreateItem>
<Delete Files="@(RemoveXMLTestResult)" />
<Exec WorkingDirectory="$(MSBuildProjectDirectory)\tests" Command="$(OutputPathForDist)\oscript.exe $(MSBuildProjectDirectory)\tests\testrunner.os -run %(TestFiles.FullPath) xddReportPath ." IgnoreExitCode="true"/>
</Target>
<Target Name="CreateZipForUpdateDll">
<CreateItem Include="$(DistPath)\*.zip">
<Output TaskParameter="Include" ItemName="RemoveUnnessesaryFiles" />
</CreateItem>
<Delete Files="@(RemoveUnnessesaryFiles)" />
<CreateItem Include="$(OutputPathForDist)\*.*" Exclude="$(DefaultExclude)" >
<Output TaskParameter="Include" ItemName="ZipFiles" />
</CreateItem>
<GitBranch>
<Output TaskParameter="Branch" PropertyName="GitBranch" />
</GitBranch>
<Message Text="Current GIT branch $(GitBranch)"/>
<!--$(GitBranch.Replace('\','-').Replace('/','-'))-->
<Zip Files="@(ZipFiles)"
WorkingDirectory="$(OutputPathForDist)"
ZipFileName="$(DistPath)OneScript-latest.zip" />
</Target>
</Project>