|
32 | 32 | <ProjectFile>oscript.csproj</ProjectFile> |
33 | 33 | <Framework>net6.0</Framework> |
34 | 34 | </PublishProjects> |
35 | | - <PublishProjects Include="TestApp"> |
| 35 | + <PublishProjects Include="TestApp" Condition="!$(Configuration.Contains('Linux'))"> |
36 | 36 | <ProjectFile>TestApp.csproj</ProjectFile> |
37 | 37 | <Framework>net6.0-windows</Framework> |
38 | 38 | </PublishProjects> |
|
51 | 51 |
|
52 | 52 | </Target> |
53 | 53 |
|
54 | | - <Target Name="MakeCPP"> |
| 54 | + <Target Name="MakeCPP" Condition="!$(Configuration.Contains('Linux'))"> |
55 | 55 | <MSBuild Projects="src\ScriptEngine.NativeApi\ScriptEngine.NativeApi.vcxproj" |
56 | 56 | Properties="Configuration=$(Configuration);Platform=%(PlatformItem.MSBuildNameCpp)"/> |
57 | 57 |
|
|
75 | 75 | <CppBinPrefix>$(MSBuildProjectDirectory)/src/ScriptEngine.NativeApi/bin/$(Configuration)</CppBinPrefix> |
76 | 76 | </PropertyGroup> |
77 | 77 |
|
78 | | - <ItemGroup> |
| 78 | + <ItemGroup Condition="!$(Configuration.Contains('Linux'))"> |
79 | 79 | <CppX86 Include="$(CppBinPrefix)/x86/*.dll"/> |
80 | 80 | <CppX64 Include="$(CppBinPrefix)/x64/*.dll"/> |
81 | 81 | </ItemGroup> |
82 | 82 |
|
83 | | - <Copy SourceFiles="@(CppX86)" DestinationFolder="$(ArtifactsRoot)/fdd-x86/bin" /> |
84 | | - <Copy SourceFiles="@(CppX64)" DestinationFolder="$(ArtifactsRoot)/fdd-x64/bin" /> |
| 83 | + <Copy SourceFiles="@(CppX86)" DestinationFolder="$(ArtifactsRoot)/fdd-x86/bin" Condition="!$(Configuration.Contains('Linux'))" /> |
| 84 | + <Copy SourceFiles="@(CppX64)" DestinationFolder="$(ArtifactsRoot)/fdd-x64/bin" Condition="!$(Configuration.Contains('Linux'))" /> |
85 | 85 |
|
86 | 86 | <ItemGroup> |
87 | | - <BatFilesFDD Include="$(MSBuildProjectDirectory)\install\opm.bat"/> |
88 | | - <BatFilesFDD Include="$(MSBuildProjectDirectory)\install\oscript.bat"/> |
89 | | - <ShFilesFDD Include="$(MSBuildProjectDirectory)\install\opm"/> |
90 | | - <ShFilesFDD Include="$(MSBuildProjectDirectory)\install\oscript"/> |
| 87 | + <BatFilesFDD Include="$(MSBuildProjectDirectory)/install/opm.bat" Condition="!$(Configuration.Contains('Linux'))"/> |
| 88 | + <BatFilesFDD Include="$(MSBuildProjectDirectory)/install/oscript.bat" Condition="!$(Configuration.Contains('Linux'))"/> |
| 89 | + <ShFilesFDD Include="$(MSBuildProjectDirectory)/install/opm"/> |
| 90 | + <ShFilesFDD Include="$(MSBuildProjectDirectory)/install/oscript"/> |
91 | 91 | </ItemGroup> |
92 | 92 |
|
93 | 93 | <Copy SourceFiles="@(BatFilesFDD);@(ShFilesFDD)" DestinationFolder="$(ArtifactsRoot)/fdd-x86/bin"/> |
|
106 | 106 | </ItemGroup> |
107 | 107 |
|
108 | 108 | <Exec Command="dotnet publish "src/oscript/oscript.csproj" -r %(RuntimeID.Identity) --self-contained -c $(Configuration) -o "$(ArtifactsRoot)/%(RuntimeID.Identity)/bin"" UseUtf8Encoding="Always"/> |
109 | | - <Exec Command="dotnet publish "src/TestApp/TestApp.csproj" -f net6.0-windows -c $(Configuration) -p:Platform=%(PlatformItem.MSBuildName) -p:UseAppHost=true -o "$(ArtifactsRoot)/win-%(PlatformItem.Identity)/bin"" UseUtf8Encoding="Always"/> |
| 109 | + <Exec Command="dotnet publish "src/TestApp/TestApp.csproj" -f net6.0-windows -c $(Configuration) -p:Platform=%(PlatformItem.MSBuildName) -p:UseAppHost=true -o "$(ArtifactsRoot)/win-%(PlatformItem.Identity)/bin"" UseUtf8Encoding="Always" Condition="!$(Configuration.Contains('Linux'))"/> |
110 | 110 |
|
111 | 111 | <PropertyGroup> |
112 | 112 | <CppBinPrefix>$(MSBuildProjectDirectory)/src/ScriptEngine.NativeApi/bin/$(Configuration)</CppBinPrefix> |
113 | 113 | </PropertyGroup> |
114 | 114 |
|
115 | | - <ItemGroup> |
| 115 | + <ItemGroup Condition="!$(Configuration.Contains('Linux'))"> |
116 | 116 | <CppX86 Include="$(CppBinPrefix)/x86/*.dll"/> |
117 | 117 | <CppX64 Include="$(CppBinPrefix)/x64/*.dll"/> |
118 | 118 | </ItemGroup> |
119 | 119 |
|
120 | | - <Copy SourceFiles="@(CppX86)" DestinationFolder="$(ArtifactsRoot)/win-x86/bin" /> |
121 | | - <Copy SourceFiles="@(CppX64)" DestinationFolder="$(ArtifactsRoot)/win-x64/bin" /> |
| 120 | + <Copy SourceFiles="@(CppX86)" DestinationFolder="$(ArtifactsRoot)/win-x86/bin" Condition="!$(Configuration.Contains('Linux'))" /> |
| 121 | + <Copy SourceFiles="@(CppX64)" DestinationFolder="$(ArtifactsRoot)/win-x64/bin" Condition="!$(Configuration.Contains('Linux'))" /> |
122 | 122 |
|
123 | 123 | <ItemGroup> |
124 | | - <BatFilesSCD Include="$(MSBuildProjectDirectory)\install\opm.bat"/> |
125 | | - <ShFilesSCD Include="$(MSBuildProjectDirectory)\install\opm"/> |
| 124 | + <BatFilesSCD Include="$(MSBuildProjectDirectory)/install/opm.bat" Condition="!$(Configuration.Contains('Linux'))"/> |
| 125 | + <ShFilesSCD Include="$(MSBuildProjectDirectory)/install/opm"/> |
126 | 126 | </ItemGroup> |
127 | 127 |
|
128 | 128 | <Copy SourceFiles="@(BatFilesSCD)" DestinationFolder="$(ArtifactsRoot)/win-x86/bin"/> |
|
169 | 169 | <CallTarget Targets="CleanIntermediates"/> |
170 | 170 | </Target> |
171 | 171 |
|
172 | | - <!-- Используется для поиска первого собранного oscript.exe --> |
173 | | - <UsingTask |
174 | | - TaskName="GetFirstItem" |
175 | | - TaskFactory="CodeTaskFactory" |
176 | | - AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" > |
177 | | - <ParameterGroup> |
178 | | - <Items ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" /> |
179 | | - <FirstItem ParameterType="System.String" Output="true" Required="false" /> |
180 | | - </ParameterGroup> |
181 | | - <Task> |
182 | | - <Reference Include="System.Xml"/> |
183 | | - <Using Namespace="System.Linq"/> |
184 | | - <Code Type="Fragment" Language="cs">FirstItem = Items.First().ItemSpec;</Code> |
185 | | - </Task> |
186 | | - </UsingTask> |
187 | | - |
| 172 | + |
188 | 173 | <Target Name="GatherLibrary"> |
189 | 174 | <MakeDir Directories="$(LibDir)" /> |
190 | 175 |
|
191 | 176 | <ItemGroup> |
192 | 177 | <Executable Include="$(ArtifactsRoot)/*x64/bin/oscript.dll"/> |
193 | 178 | </ItemGroup> |
194 | 179 |
|
195 | | - <!-- упадет если ничего не нашлось, и это хорошо --> |
196 | | - <GetFirstItem Items="@(Executable)"> |
197 | | - <Output TaskParameter="FirstItem" PropertyName="Runner"/> |
198 | | - </GetFirstItem> |
| 180 | + <!-- Use a simple workaround for getting first item --> |
| 181 | + <PropertyGroup> |
| 182 | + <ExecutableItems>@(Executable)</ExecutableItems> |
| 183 | + <Runner>$(ArtifactsRoot)/fdd-x64/bin/oscript.dll</Runner> |
| 184 | + </PropertyGroup> |
199 | 185 |
|
200 | 186 | <Exec Command="dotnet "$(Runner)" "$(MSBuildProjectDirectory)/install/unicode-zipper.os" unpack "$(MSBuildProjectDirectory)/install/opm.ospx" "$(LibDir)/tmp"" UseUtf8Encoding="Always"/> |
201 | 187 | <Exec Command="dotnet "$(Runner)" "$(MSBuildProjectDirectory)/install/unicode-zipper.os" unpack "$(LibDir)/tmp/content.zip" "$(LibDir)/opm"" UseUtf8Encoding="Always"/> |
202 | 188 |
|
203 | | - <Copy SourceFiles="$(MSBuildProjectDirectory)\install\package-loader.os" DestinationFolder="$(LibDir)"/> |
| 189 | + <Copy SourceFiles="$(MSBuildProjectDirectory)/install/package-loader.os" DestinationFolder="$(LibDir)"/> |
204 | 190 | <RemoveDir Directories="$(LibDir)/tmp"/> |
205 | 191 |
|
206 | 192 | <PropertyGroup> |
207 | | - <OpmEntryPoint>opm\src\cmd\opm.os</OpmEntryPoint> |
208 | | - <OpmLaunch>dotnet $(Runner) "$(LibDir)\$(OpmEntryPoint)"</OpmLaunch> |
| 193 | + <OpmEntryPoint>opm/src/cmd/opm.os</OpmEntryPoint> |
| 194 | + <OpmLaunch>dotnet $(Runner) "$(LibDir)/$(OpmEntryPoint)"</OpmLaunch> |
209 | 195 | </PropertyGroup> |
210 | 196 |
|
211 | 197 | <ItemGroup> |
|
237 | 223 | <LibraryFiles Include="$(LibDir)/**/*" Exclude="package-loader.os"/> |
238 | 224 | </ItemGroup> |
239 | 225 |
|
240 | | - <Copy SourceFiles="$(MSBuildProjectDirectory)\install\release-notes.md" DestinationFiles="$(ArtifactsRoot)/%(TargetDir.Identity)/release-notes.md" /> |
| 226 | + <Copy SourceFiles="$(MSBuildProjectDirectory)/install/release-notes.md" DestinationFiles="$(ArtifactsRoot)/%(TargetDir.Identity)/release-notes.md" /> |
241 | 227 |
|
242 | 228 | <!--Заставить Copy копировать batching-ом в несколько директорий рекурсивно - не удалось :(--> |
243 | 229 | <Copy SourceFiles="@(LibraryFiles)" DestinationFolder="$(ArtifactsRoot)/fdd-x64/lib/%(RecursiveDir)" /> |
|
295 | 281 |
|
296 | 282 | <Delete Files="@(RemoveXMLTestResult)" /> |
297 | 283 |
|
298 | | - <GetFirstItem Items="@(Executable)"> |
299 | | - <Output TaskParameter="FirstItem" PropertyName="Runner"/> |
300 | | - </GetFirstItem> |
| 284 | + <!-- Use a simple workaround for getting first item --> |
| 285 | + <PropertyGroup> |
| 286 | + <Runner>$(ArtifactsRoot)/fdd-x64/bin/oscript.dll</Runner> |
| 287 | + </PropertyGroup> |
301 | 288 |
|
302 | 289 | <Exec |
303 | | - WorkingDirectory="$(MSBuildProjectDirectory)\tests" |
304 | | - Command="dotnet "$(Runner)" "$(MSBuildProjectDirectory)\tests\testrunner.os" -runall . xddReportPath ." |
| 290 | + WorkingDirectory="$(MSBuildProjectDirectory)/tests" |
| 291 | + Command="dotnet "$(Runner)" "$(MSBuildProjectDirectory)/tests/testrunner.os" -runall . xddReportPath ." |
305 | 292 | IgnoreExitCode="true" |
306 | 293 | ContinueOnError="true" |
307 | 294 | UseUtf8Encoding="Always"> |
|
331 | 318 | ItemName="BuildVariant"/> |
332 | 319 | </CreateItem> |
333 | 320 |
|
334 | | - <!-- упадет если ничего не нашлось, и это хорошо --> |
335 | | - <GetFirstItem Items="@(Executable)"> |
336 | | - <Output TaskParameter="FirstItem" PropertyName="Runner"/> |
337 | | - </GetFirstItem> |
| 321 | + <!-- Use a simple workaround for getting first item --> |
| 322 | + <PropertyGroup> |
| 323 | + <Runner>$(ArtifactsRoot)/fdd-x64/bin/oscript.dll</Runner> |
| 324 | + </PropertyGroup> |
338 | 325 |
|
339 | | - <Exec Command="dotnet "$(Runner)" "$(MSBuildProjectDirectory)\install\unicode-zipper.os" pack "$(ArtifactsRoot)/%(RuntimeID.Identity)/*" "$(ArtifactsRoot)/OneScript-$(ReleaseNumber)-%(RuntimeID.Identity).zip"" UseUtf8Encoding="Always"/> |
| 326 | + <Exec Command="dotnet "$(Runner)" "$(MSBuildProjectDirectory)/install/unicode-zipper.os" pack "$(ArtifactsRoot)/%(RuntimeID.Identity)/*" "$(ArtifactsRoot)/OneScript-$(ReleaseNumber)-%(RuntimeID.Identity).zip"" UseUtf8Encoding="Always"/> |
340 | 327 | <RemoveDir Directories="$(ArtifactsRoot)/%(RuntimeID.Identity)" /> |
341 | 328 | <Delete Files="@(VsixSources)" /> |
342 | 329 | </Target> |
|
0 commit comments