Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BundleResource not working correctly MacOS #1789

Closed
hamarb123 opened this issue Sep 19, 2020 · 2 comments · Fixed by #1794
Closed

BundleResource not working correctly MacOS #1789

hamarb123 opened this issue Sep 19, 2020 · 2 comments · Fixed by #1794
Labels
Milestone

Comments

@hamarb123
Copy link
Contributor

Expected Behavior

Compiles without any issues and places libEGL.dylib in bin\Debug\netcoreapp3.1\TestEtoProgram.Mac.app\Contents\Resources

Actual Behavior

Error while building

Error | MSB3021 | Unable to copy file "C:\Users\Hamish\Downloads\libEGL.dylib" to "bin\Debug\netcoreapp3.1\TestEtoProgram.Mac.app\Contents\Resources\C:\Users\Hamish\Downloads\libEGL.dylib". The given path's format is not supported. | TestEtoProgram.Mac | C:\Users\Hamish\.nuget\packages\eto.platform.mac64\2.5.6\build\Eto.Platform.Mac64.targets | 232 |  

Steps to Reproduce the Problem / Code that Demonstrates the Problem

  1. Create an eto project with standard Mac64 target with .net core
  2. Add the following to the project file (with the absolute path to a file that exists)
	<ItemGroup>
		<BundleResource Include="C:\Users\Hamish\Downloads\libEGL.dylib">
			<Link>libEGL.dylib</Link>
		</BundleResource>
	</ItemGroup>
  1. Attempt to build

Specifications

  • Version: 2.5.6
  • Platform(s): Mac, .NET Core 3.1
  • Operating System(s): (built on) Windows 10

This behaviour deviates to what a Visual Studio for Mac cocoa app does, which copies to program.app/Contents/Resources/linkpath if linkpath is specified.
I do believe that the error is somewhere near this line

@hamarb123
Copy link
Contributor Author

I got this to work (in this file)

    <!-- copy resource files -->
    <ItemGroup>
      <ResourceFiles Include="@(BundleResource)" Condition="'%(BundleResource.Link)' != ''" Link="@(BundleResource -> '%(Link)')" />
      <ResourceFiles Include="@(BundleResource)" Condition="'%(BundleResource.Link)' == ''" />
      <ResourceFiles Include="@(Content)" Condition="'%(Content.Link)' != ''" Link="@(Content -> '%(Link)')" />
      <ResourceFiles Include="@(Content)" Condition="'%(Content.Link)' == ''" />
    </ItemGroup>
    <Copy SourceFiles="@(ResourceFiles)" DestinationFolder="$(OutputResourcesPath)%(Link.RelativeDir)" SkipUnchangedFiles="true" Condition="'%(ResourceFiles.Link)' != ''" />
    <Copy SourceFiles="@(ResourceFiles)" DestinationFolder="$(OutputResourcesPath)%(ResourceFiles.RelativeDir)" SkipUnchangedFiles="true" Condition="'%(ResourceFiles.Link)' == ''" />

It also happened for content on the cocoa project, so I've added that as well (I've only tested it with the BundleResource bit modified, not the Content bit).

@hamarb123
Copy link
Contributor Author

I've created a fix for this, with the permission of an owner, I'll open a PR.

cwensley added a commit that referenced this issue Oct 7, 2020
@cwensley cwensley added this to the 2.5.7 milestone Nov 17, 2020
@cwensley cwensley added the bug label Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants