Use RecursiveDir property to create app bundle for Helix (#89508)
authorMilos Kotlar <kotlarmilos@gmail.com>
Thu, 27 Jul 2023 12:00:29 +0000 (14:00 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Jul 2023 12:00:29 +0000 (14:00 +0200)
eng/testing/tests.ioslike.targets
src/tests/build.proj

index 192e936..18d7ebc 100644 (file)
     </PropertyGroup>
 
     <ItemGroup>
-      <!-- 
-        Checks if the directory name "AppleAssembliesToBundle" is equal to the "AssemblyName",
-        if they match, consider it as the root directory and copy the files there,
-        otherwise, copy the files to a subdirectory.
-      -->
-      <BundleFiles Condition="'%(AppleAssembliesToBundle._IsNative)' != 'true' and ($([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('%(AppleAssembliesToBundle.Identity)')))) == '$(AssemblyName)' or '$(IsRuntimeTests)' != 'true')"
-              Include="@(AppleAssembliesToBundle)"                    TargetDir="publish" />
-      <BundleFiles Condition="'%(AppleAssembliesToBundle._IsNative)' != 'true' and $([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('%(AppleAssembliesToBundle.Identity)')))) != '$(AssemblyName)' and  '$(IsRuntimeTests)' == 'true'"
-                   Include="@(AppleAssembliesToBundle)"               TargetDir="publish\$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('%(AppleAssembliesToBundle.Identity)'))))" />
-
-      <BundleFiles Include="@(AppleNativeFilesToBundle)"              TargetDir="publish" />
-
-      <BundleFiles Include="$(MonoProjectRoot)\msbuild\apple\data\*"  TargetDir="publish" />
+      <BundleFiles Condition="'%(AppleAssembliesToBundle._IsNative)' != 'true'"
+                   Include="@(AppleAssembliesToBundle)"         TargetDir="publish\%(AppleAssembliesToBundle.RecursiveDir)" />
+      <BundleFiles Include="@(AppleNativeFilesToBundle)"        TargetDir="publish\%(AppleNativeFilesToBundle.RecursiveDir)" />
+      <BundleFiles Include="$(RuntimeConfigFilePath)"           TargetDir="publish" />
+      <BundleFiles Include="$(MonoProjectRoot)\msbuild\apple\data\*" TargetDir="publish" />
       <ExtraFiles Condition="'%(AppleAssembliesToBundle._IsNative)' == 'true'"
-                  Include="@(AppleAssembliesToBundle)"                TargetDir="extraFiles" />
+                   Include="@(AppleAssembliesToBundle)"          TargetDir="extraFiles\%(AppleAssembliesToBundle.RecursiveDir)" />
     </ItemGroup>
 
     <ItemGroup Condition="'$(DebuggerSupport)' == 'true'">
index e20d07c..b054938 100644 (file)
 
   <Target Name="BuildMonoiOSApp">
     <PropertyGroup>
+      <IntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)'))</IntermediateOutputPath>
       <CMDDIR_Grandparent>$([System.IO.Path]::GetDirectoryName($([System.IO.Path]::GetDirectoryName($(_CMDDIR)))))</CMDDIR_Grandparent>
       <CategoryWithSlash>$([System.String]::Copy('$(_CMDDIR)').Replace("$(CMDDIR_Grandparent)/",""))</CategoryWithSlash>
       <Category>$([System.String]::Copy('$(CategoryWithSlash)').Replace('/','_'))</Category>