Skip to content

Commit

Permalink
Доработки процесса сборки
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Ovsiankin committed Mar 18, 2021
1 parent 52f6cca commit ad7c226
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
21 changes: 12 additions & 9 deletions Build_Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
ItemName="BuildVariant"/>
</CreateItem>

<Exec Command="dotnet publish &quot;src/%(BuildVariant.Identity)/%(BuildVariant.ProjectFile)&quot; -f %(BuildVariant.Framework) -c $(Configuration) -p:Platform=%(BuildVariant.Platform) -o &quot;$(ArtifactsRoot)/fdd-%(BuildVariant.Suffix)/bin&quot;"/>
<Exec Command="dotnet publish &quot;src/%(BuildVariant.Identity)/%(BuildVariant.ProjectFile)&quot; -f %(BuildVariant.Framework) -c $(Configuration) -p:Platform=%(BuildVariant.Platform) -p:UseAppHost=false -o &quot;$(ArtifactsRoot)/fdd-%(BuildVariant.Suffix)/bin&quot;"/>
</Target>

<Target Name="MakeSCD">
Expand Down Expand Up @@ -103,16 +103,16 @@
<MakeDir Directories="$(LibDir)" />

<ItemGroup>
<Executable Include="$(ArtifactsRoot)/*/bin/oscript.exe"/>
<Executable Include="$(ArtifactsRoot)/*x64/bin/oscript.dll"/>
</ItemGroup>

<!-- упадет если ничего не нашлось, и это хорошо -->
<GetFirstItem Items="@(Executable)">
<Output TaskParameter="FirstItem" PropertyName="Runner"/>
</GetFirstItem>

<Exec Command="&quot;$(Runner)&quot; &quot;$(MSBuildProjectDirectory)/install/unicode-zipper.os&quot; unpack &quot;$(MSBuildProjectDirectory)/install/opm-0.16.2.ospx&quot; &quot;$(LibDir)/tmp&quot;"/>
<Exec Command="&quot;$(Runner)&quot; &quot;$(MSBuildProjectDirectory)/install/unicode-zipper.os&quot; unpack &quot;$(LibDir)/tmp/content.zip&quot; &quot;$(LibDir)/opm&quot;"/>
<Exec Command="dotnet &quot;$(Runner)&quot; &quot;$(MSBuildProjectDirectory)/install/unicode-zipper.os&quot; unpack &quot;$(MSBuildProjectDirectory)/install/opm-0.16.2.ospx&quot; &quot;$(LibDir)/tmp&quot;"/>
<Exec Command="dotnet &quot;$(Runner)&quot; &quot;$(MSBuildProjectDirectory)/install/unicode-zipper.os&quot; unpack &quot;$(LibDir)/tmp/content.zip&quot; &quot;$(LibDir)/opm&quot;"/>

<Copy SourceFiles="$(MSBuildProjectDirectory)\install\package-loader.os" DestinationFolder="$(LibDir)"/>
<Copy SourceFiles="$(MSBuildProjectDirectory)\install\opm.bat" DestinationFolder="%(Executable.RelativeDir)"/>
Expand Down Expand Up @@ -148,20 +148,23 @@

<Target Name="Test">
<ItemGroup>
<!--Executable Include="$(ArtifactsRoot)/fdd-x64/bin/oscript.exe" /-->
<Executable Include="$(ArtifactsRoot)/fdd-x86/bin/oscript.exe" />
<Executable Include="$(ArtifactsRoot)/*x64/bin/oscript.dll" />
<RemoveXMLTestResult Include="$(MSBuildProjectDirectory)\tests\*.os.xml" />
</ItemGroup>

<Delete Files="@(RemoveXMLTestResult)" />

<GetFirstItem Items="@(Executable)">
<Output TaskParameter="FirstItem" PropertyName="Runner"/>
</GetFirstItem>

<Exec WorkingDirectory="$(MSBuildProjectDirectory)\tests" Command="&quot;%(Executable.Identity)&quot; &quot;$(MSBuildProjectDirectory)\tests\testrunner.os&quot; -runall . xddReportPath ." IgnoreExitCode="true"/>
<Exec WorkingDirectory="$(MSBuildProjectDirectory)\tests" Command="dotnet &quot;$(Runner)&quot; &quot;$(MSBuildProjectDirectory)\tests\testrunner.os&quot; -runall . xddReportPath ." IgnoreExitCode="true"/>

</Target>

<Target Name="PackDistributions">
<ItemGroup>
<Executable Include="$(ArtifactsRoot)/*/bin/oscript.exe" />
<Executable Include="$(ArtifactsRoot)/*x64/bin/oscript.dll" />
<RuntimeID Include="fdd-x64"/>
<RuntimeID Include="fdd-x86"/>
<RuntimeID Include="win-x64"/>
Expand All @@ -182,7 +185,7 @@
<Output TaskParameter="FirstItem" PropertyName="Runner"/>
</GetFirstItem>

<Exec Command="&quot;$(Runner)&quot; &quot;$(MSBuildProjectDirectory)\install\unicode-zipper.os&quot; pack &quot;$(ArtifactsRoot)/%(RuntimeID.Identity)/*&quot; &quot;$(ArtifactsRoot)/OneScript-$(ReleaseNumber)-%(RuntimeID.Identity).zip&quot;"/>
<Exec Command="dotnet &quot;$(Runner)&quot; &quot;$(MSBuildProjectDirectory)\install\unicode-zipper.os&quot; pack &quot;$(ArtifactsRoot)/%(RuntimeID.Identity)/*&quot; &quot;$(ArtifactsRoot)/OneScript-$(ReleaseNumber)-%(RuntimeID.Identity).zip&quot;"/>
<RemoveDir Directories="$(ArtifactsRoot)/%(RuntimeID.Identity)" />
</Target>

Expand Down
4 changes: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ pipeline {
parallel{
stage('Windows testing') {
agent { label 'windows' }

environment {
OSCRIPT_CONFIG = 'systemlanguage=ru'
}
steps {
ws(env.WORKSPACE.replaceAll("%", "_").replaceAll(/(-[^-]+$)/, ""))
{
Expand Down
3 changes: 3 additions & 0 deletions tests/process.os
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ВсеТесты.Добавить("ТестДолжен_ПолучитьПутьКOscript");

СИ = Новый СистемнаяИнформация;
Сообщить(СИ.ВерсияОС);
Если Найти(СИ.ВерсияОС, "Windows") > 0 Тогда
ВсеТесты.Добавить("ТестДолжен_ПрочитатьВыводOscriptСразу");
ВсеТесты.Добавить("ТестДолжен_ПрочитатьВыводOscriptПострочно");
Expand Down Expand Up @@ -104,8 +105,10 @@

Функция ИмяПроцесса()
#Если NETFRAMEWORK Тогда
Сообщить("oscript");
Возврат "oscript";
#Иначе
Сообщить("dotnet");
Возврат "dotnet";
#КонецЕсли
КонецФункции
Expand Down

0 comments on commit ad7c226

Please sign in to comment.