Remove BundleDir/PublishDir at the end of ArchiveTests to save disk space (#39714)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 22 Jul 2020 19:13:38 +0000 (21:13 +0200)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2020 19:13:38 +0000 (21:13 +0200)
Hosted build agents have not a lot of free disk space and since we don't need these dirs anymore after we created the test archive we can delete it.

eng/testing/tests.targets
src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/System.Xml.Xsl.XslCompiledTransformApi.Tests.csproj
src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/ReaderType.cs [new file with mode: 0644]
src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/System.Xml.Xsl.XslTransformApi.Tests.csproj
src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs

index 1534c3aa0dadd9b4e5db273b0fd6ae5fd9c89c9d..757ff016360024521511ec6004263550d792feb0 100644 (file)
@@ -41,7 +41,6 @@
     <Error Condition="'$(TestArchiveTestsDir)' == ''" Text="TestArchiveTestsDir property to archive the test folder must be set." />
 
     <PropertyGroup>
-      <BundleDir>$([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle'))</BundleDir>
       <_ZipSourceDirectory>$(OutDir)</_ZipSourceDirectory>
       <_ZipSourceDirectory Condition="'$(TargetOS)' == 'Browser'">$(BundleDir)</_ZipSourceDirectory>
     </PropertyGroup>
@@ -50,6 +49,8 @@
     <ZipDirectory SourceDirectory="$(_ZipSourceDirectory)"
                   DestinationFile="$([MSBuild]::NormalizePath('$(TestArchiveTestsDir)', '$(TestProjectName).zip'))"
                   Overwrite="true" />
+    <!-- delete the BundleDir and PublishDir in CI builds to save disk space on build agents since they're no longer needed -->
+    <RemoveDir Condition="'$(ContinuousIntegrationBuild)' == 'true'" Directories="$(BundleDir);$(PublishDir)" />
   </Target>
 
   <UsingTask TaskName="GenerateRunScript" AssemblyFile="$(InstallerTasksAssemblyPath)"/>
index b372333e9628e501b593806081404f49ac25dd7e..d9d8f1aa2f51cb89d286623782cc82662121b758 100644 (file)
     <Compile Include="XsltSettings.cs" />
     <Compile Include="XunitAssemblyAttribute.cs" />
     <Compile Include="XslCompiledTransform.cs" />
+    <Compile Include="..\XslTransformApi\cthread.cs" />
+    <Compile Include="..\XslTransformApi\CThreads.cs" />
+    <Compile Include="..\XslTransformApi\DataHelper.cs" />
+    <Compile Include="..\XslTransformApi\ExceptionVerifier.cs" />
+    <Compile Include="..\XslTransformApi\MyNavigator.cs" />
+    <Compile Include="..\XslTransformApi\ReaderType.cs" />
+    <Compile Include="..\XslTransformApi\ThreadFunc.cs" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="..\TestFiles\**\*"
@@ -25,6 +32,5 @@
     <ProjectReference Include="$(CommonTestPath)System\Xml\ModuleCore\ModuleCore.csproj" />
     <ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
     <ProjectReference Include="$(CommonTestPath)System\Xml\XmlDiff\XmlDiff.csproj" />
-    <ProjectReference Include="..\XslTransformApi\System.Xml.Xsl.XslTransformApi.Tests.csproj" />
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/ReaderType.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/ReaderType.cs
new file mode 100644 (file)
index 0000000..719551b
--- /dev/null
@@ -0,0 +1,10 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.Xml.Tests
+{
+    public enum ReaderType
+    {
+        XmlTextReader, XmlNodeReader, XmlValidatingReader, XsltReader, Unknown
+    }
+}
\ No newline at end of file
index 12b7f905cb450aa1b815a4b3bca07cca7f0d88f8..904076419ca09131026b910f8bdb8562b735e8c5 100644 (file)
@@ -13,6 +13,7 @@
     <Compile Include="DataHelper.cs" />
     <Compile Include="ExceptionVerifier.cs" />
     <Compile Include="MyNavigator.cs" />
+    <Compile Include="ReaderType.cs" />
     <Compile Include="ThreadFunc.cs" />
     <Compile Include="XSLTransform.cs" />
     <Compile Include="XunitAssemblyAttributes.cs" />
index 8a8bbd8c93944c7865009ea6a8edb81b9ed75d6a..a0bac0cd72b7e22b7e44d919b43322ad6d5bc5de 100644 (file)
@@ -27,11 +27,6 @@ namespace System.Xml.Tests
         XmlDocument, XPathDocument, Unknown
     }
 
-    public enum ReaderType
-    {
-        XmlTextReader, XmlNodeReader, XmlValidatingReader, XsltReader, Unknown
-    }
-
     ////////////////////////////////////////////////////////////////
     // Module declaration for LTM usage
     //