|
9 | 9 | <ArtifactsRoot>$(MSBuildProjectDirectory)/built</ArtifactsRoot> |
10 | 10 | <Solution>$(MSBuildProjectDirectory)/src/1Script.sln</Solution> |
11 | 11 | <Configuration>Release</Configuration> |
12 | | - <Platform>x86</Platform> |
13 | 12 | </PropertyGroup> |
14 | 13 |
|
| 14 | + <ItemGroup> |
| 15 | + <PlatformItem Include="x86"> |
| 16 | + <MSBuildName>x86</MSBuildName> |
| 17 | + <BinFolder>bin32</BinFolder> |
| 18 | + </PlatformItem> |
| 19 | + <PlatformItem Include="x64"> |
| 20 | + <MSBuildName>Any CPU</MSBuildName> |
| 21 | + <BinFolder>bin</BinFolder> |
| 22 | + </PlatformItem> |
| 23 | + </ItemGroup> |
| 24 | + |
15 | 25 | <Target Name="CleanAll"> |
16 | 26 |
|
17 | 27 | <ItemGroup> |
|
20 | 30 |
|
21 | 31 | <Delete Files="@(TestsResults)" /> |
22 | 32 | <DeleteTree Directories="$(ArtifactsRoot)" Condition="Exists($(ArtifactsRoot))" /> |
23 | | - |
24 | | - <MSBuild Projects="$(Solution)" Targets="Clean" Properties="ReleaseNumber=$(ReleaseNumber);Configuration=$(Configuration);Platform=$(Platform)"/> |
| 33 | + |
| 34 | + <MSBuild Projects="$(Solution)" Targets="Clean" Properties="ReleaseNumber=$(ReleaseNumber);Configuration=$(Configuration);Platform=%(PlatformItem.MSBuildName)"/> |
25 | 35 |
|
26 | 36 | </Target> |
27 | 37 |
|
28 | 38 | <Target Name="Make"> |
29 | | - <MSBuild Projects="$(Solution)" Targets="restore;Build" Properties="ReleaseNumber=$(ReleaseNumber);Configuration=$(Configuration);Platform=$(Platform)"/> |
| 39 | + <MSBuild Projects="$(Solution)" Targets="restore;Build" Properties="ReleaseNumber=$(ReleaseNumber);Configuration=$(Configuration);Platform=%(PlatformItem.MSBuildName);"/> |
30 | 40 | </Target> |
31 | 41 |
|
32 | 42 | <Target Name="CreateDistributions" DependsOnTargets="CreateInstaller;CreateNuget;CreateZip"> |
|
40 | 50 | <Target Name="PrepareArtifactsRoot"> |
41 | 51 | <PropertyGroup> |
42 | 52 | <TempFolder>$(ArtifactsRoot)/tmp</TempFolder> |
43 | | - <BinFolder>$(TempFolder)/bin</BinFolder> |
44 | 53 | <LibFolder>$(TempFolder)/lib</LibFolder> |
| 54 | + <ToolFolder>$(TempFolder)/bin</ToolFolder> |
45 | 55 | <ExamplesFolder>$(TempFolder)/examples</ExamplesFolder> |
46 | 56 | <DocFolder>$(TempFolder)/doc</DocFolder> |
47 | 57 | <DebugDest>$(ArtifactsRoot)\vscode\</DebugDest> |
|
62 | 72 |
|
63 | 73 | <!-- Собирает отовсюду содержимое папки bin --> |
64 | 74 | <Target Name="GatherBinaries" DependsOnTargets="Make;PrepareArtifactsRoot"> |
65 | | - <MakeDir Directories="$(BinFolder)" /> |
66 | | - |
67 | 75 | <ItemGroup> |
68 | 76 | <BuiltProjects Include="oscript" /> |
69 | 77 | <BuiltProjects Include="TestApp" /> |
70 | | - <BinaryFiles Include="$(MSBuildProjectDirectory)/src/%(BuiltProjects.Identity)/bin/x86/$(Configuration)/net452/**"/> |
71 | | - <BinaryFiles Include="$(MSBuildProjectDirectory)/src/ASPNETHandler/bin/$(Configuration)/net452/ASPNETHandler.dll"/> |
| 78 | + <BinaryFiles Include="$(MSBuildProjectDirectory)/src/%(BuiltProjects.Identity)/bin/$(Configuration)/net452/**"> |
| 79 | + <Dest>$(TempFolder)/bin</Dest> |
| 80 | + </BinaryFiles> |
| 81 | + <BinaryFiles Include="$(MSBuildProjectDirectory)/src/%(BuiltProjects.Identity)/bin/x86/$(Configuration)/net452/**"> |
| 82 | + <Dest>$(TempFolder)/bin32</Dest> |
| 83 | + </BinaryFiles> |
| 84 | + <AspFiles Include="$(MSBuildProjectDirectory)/src/ASPNETHandler/bin/$(Configuration)/net452/ASPNETHandler.dll"/> |
72 | 85 | </ItemGroup> |
73 | 86 |
|
74 | | - <Copy SourceFiles="@(BinaryFiles)" DestinationFolder="$(BinFolder)" /> |
| 87 | + <Copy SourceFiles="@(BinaryFiles)" DestinationFiles="@(BinaryFiles->'%(Dest)/%(Filename)%(Extension)')" /> |
| 88 | + <Copy SourceFiles="@(AspFiles)" DestinationFolder="%(BinaryFiles.Dest)"/> |
75 | 89 | <!-- Копирование скрипта запуска для opm --> |
76 | | - <Copy SourceFiles="$(MSBuildProjectDirectory)\install\opm.bat" DestinationFolder="$(BinFolder)"/> |
| 90 | + <Copy SourceFiles="$(MSBuildProjectDirectory)\install\opm.bat" DestinationFolder="%(BinaryFiles.Dest)"/> |
77 | 91 |
|
78 | 92 | <PropertyGroup> |
79 | 93 | <DebugSrc>$(MSBuildProjectDirectory)/src/DebugServer/bin/$(Configuration)/net452</DebugSrc> |
|
91 | 105 | <Copy SourceFiles="@(DbgPackageFiles)" DestinationFolder="$(DebugDest)"/> |
92 | 106 | <Copy SourceFiles="@(DbgImageFiles)" DestinationFolder="$(DebugDest)/images"/> |
93 | 107 |
|
| 108 | + <CallTarget Targets="CleanIntermediates"/> |
| 109 | + |
| 110 | + <Exec WorkingDirectory="$(TempFolder)" Command=""$(ToolFolder)/oscript.exe" -version > VERSION"/> |
94 | 111 | </Target> |
95 | | - |
| 112 | + |
96 | 113 | <!-- Собирает в целевой папке содержимое папки lib --> |
97 | | - <Target Name="GatherLibrary" DependsOnTargets="Make;PrepareArtifactsRoot"> |
| 114 | + <Target Name="GatherLibrary" DependsOnTargets="Make;GatherBinaries"> |
98 | 115 |
|
99 | 116 | <MakeDir Directories="$(LibFolder)" /> |
100 | | - <Exec Command=""$(BinFolder)/oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" unpack "$(MSBuildProjectDirectory)\install\opm-0.14.4.ospx" "$(LibFolder)\tmp""/> |
101 | | - <Exec Command=""$(BinFolder)/oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" unpack "$(LibFolder)\tmp\content.zip" "$(LibFolder)/opm""/> |
| 117 | + <Exec Command=""$(ToolFolder)/oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" unpack "$(MSBuildProjectDirectory)\install\opm-0.14.4.ospx" "$(LibFolder)\tmp""/> |
| 118 | + <Exec Command=""$(ToolFolder)/oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" unpack "$(LibFolder)\tmp\content.zip" "$(LibFolder)/opm""/> |
102 | 119 | <Copy SourceFiles="$(MSBuildProjectDirectory)\install\package-loader.os" DestinationFolder="$(LibFolder)"/> |
103 | 120 | <DeleteTree Directories="$(LibFolder)\tmp"/> |
104 | 121 |
|
|
132 | 149 | <!-- Генерирует необходимую документацию --> |
133 | 150 | <Target Name="GenerateDocs"> |
134 | 151 |
|
135 | | - <Exec Command="$(OneScriptDocumenter) $(TMP)\tempdoc.xml "$(BinFolder)\ScriptEngine.dll" "$(BinFolder)\ScriptEngine.HostedScript.dll" "$(BinFolder)\oscript.exe""/> |
| 152 | + <Exec Command="$(OneScriptDocumenter) $(TMP)\tempdoc.xml "$(ToolFolder)\ScriptEngine.dll" "$(ToolFolder)\ScriptEngine.HostedScript.dll" "$(ToolFolder)\oscript.exe""/> |
136 | 153 | <MakeDir Directories="$(MDDocFolder)"/> |
137 | 154 | <Exec Command="$(OneScriptDocumenter) markdown $(TMP)\tempdoc.xml "$(MDDocFolder)" /syntax/page"/> |
138 | 155 |
|
139 | 156 | </Target> |
140 | 157 |
|
141 | 158 | <!-- Чистка промежуточных файлов --> |
142 | | - <Target Name="CleanIntermediates" AfterTargets="PrepareDistributionContent"> |
| 159 | + <Target Name="CleanIntermediates"> |
143 | 160 | <ItemGroup> |
144 | | - <ExcludedArtifacts Include="$(BinFolder)/*.pdb" /> |
145 | | - <ExcludedArtifacts Include="$(BinFolder)/*.xml" /> |
| 161 | + <ExcludedArtifacts Include="$(TempFolder)/%(PlatformItem.BinFolder)/*.pdb" /> |
| 162 | + <ExcludedArtifacts Include="$(TempFolder)/%(PlatformItem.BinFolder)/*.xml" /> |
| 163 | + <ExcludedArtifacts Include="$(TempFolder)/%(PlatformItem.BinFolder)/Costura.dll" /> |
146 | 164 | <!-- остается от документера. Надо починить его чтобы писал куда-то в другое место --> |
147 | 165 | <ExcludedArtifacts Include="$(MSBuildProjectDirectory)/map.json"/> |
148 | 166 | </ItemGroup> |
149 | 167 | <Delete Files="@(ExcludedArtifacts)"/> |
150 | 168 | </Target> |
151 | 169 |
|
152 | 170 | <!-- Инсталлятор --> |
153 | | - <Target Name="CreateInstaller" DependsOnTargets="PrepareArtifactsRoot"> |
| 171 | + <Target Name="CreateInstaller" DependsOnTargets="PrepareDistributionContent"> |
154 | 172 | <Error Text="No installer path is specified" Condition="'$(InnoSetupPath)' == ''"/> |
155 | 173 | <PropertyGroup> |
156 | 174 | <InstallerStandardPath>"$(InnoSetupPath)\iscc.exe"</InstallerStandardPath> |
157 | 175 | <DistPath>$(ArtifactsRoot)</DistPath> |
158 | 176 | </PropertyGroup> |
159 | | - <Exec Command="$(InstallerStandardPath) "$(MSBuildProjectDirectory)\install\install.iss" /o"$(DistPath)"" /> |
| 177 | + |
| 178 | + <Exec Command="$(InstallerStandardPath) /o"$(DistPath)" /DSuffix=%(PlatformItem.Identity) "$(MSBuildProjectDirectory)\install\install.iss""/> |
| 179 | + |
160 | 180 | </Target> |
161 | 181 |
|
162 | 182 | <!-- Nuget --> |
163 | 183 | <Target Name="CreateNuget" DependsOnTargets="PrepareArtifactsRoot"> |
164 | 184 | <ItemGroup> |
165 | 185 | <NugetAbleProject Include="ScriptEngine"/> |
166 | 186 | <NugetAbleProject Include="ScriptEngine.HostedScript"/> |
| 187 | + <NugetAbleProject Include="OneScript.Language"/> |
167 | 188 | </ItemGroup> |
168 | 189 |
|
169 | 190 | <MSBuild Projects="src/%(NugetAbleProject.Identity)/%(NugetAbleProject.Identity).csproj" Targets="pack" Properties="PackageOutputPath=$(ArtifactsRoot);ReleaseNumber=$(ReleaseNumber)"/> |
170 | 191 |
|
171 | 192 | </Target> |
172 | 193 |
|
173 | 194 | <!-- ZIP --> |
174 | | - <Target Name="CreateZip" DependsOnTargets="PrepareArtifactsRoot"> |
175 | | - <Exec Command=""$(BinFolder)\oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" pack "$(TempFolder)/*" "$(ArtifactsRoot)/OneScript-$(ReleaseNumber).zip""/> |
176 | | - <Exec Command=""$(BinFolder)\oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" pack "$(MDDocFolder)/*" "$(ArtifactsRoot)/mddoc-$(ReleaseNumber).zip""/> |
| 195 | + <Target Name="CreateZip" DependsOnTargets="PrepareArtifactsRoot"> |
| 196 | + |
| 197 | + <Exec Command=""$(MSBuildProjectDirectory)\install\prepare-zip.cmd" $(TempFolder) %(PlatformItem.Identity)"/> |
| 198 | + |
| 199 | + <Exec Command=""$(ToolFolder)\oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" pack "$(TempFolder)/zip%(PlatformItem.Identity)/*" "$(ArtifactsRoot)/OneScript-$(ReleaseNumber)-%(PlatformItem.Identity).zip""/> |
| 200 | + <Exec Command=""$(ToolFolder)\oscript.exe" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" pack "$(MDDocFolder)/*" "$(ArtifactsRoot)/mddoc-$(ReleaseNumber).zip""/> |
177 | 201 | </Target> |
178 | 202 |
|
179 | 203 | <!-- MSI --> |
|
191 | 215 |
|
192 | 216 | <Delete Files="@(RemoveXMLTestResult)" /> |
193 | 217 |
|
194 | | - <Exec WorkingDirectory="$(MSBuildProjectDirectory)\tests" Command=""$(BinFolder)/oscript.exe" "$(MSBuildProjectDirectory)\tests\testrunner.os" -runall . xddReportPath ." IgnoreExitCode="true"/> |
| 218 | + <Exec WorkingDirectory="$(MSBuildProjectDirectory)\tests" Command=""$(ToolFolder)/oscript.exe" "$(MSBuildProjectDirectory)\tests\testrunner.os" -runall . xddReportPath ." IgnoreExitCode="true"/> |
195 | 219 |
|
196 | 220 | </Target> |
197 | 221 |
|
|
0 commit comments