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

How to use the Eto-develop source and get Mac bundle? #1431

Closed
spotcatbug opened this issue Jun 6, 2019 · 5 comments
Closed

How to use the Eto-develop source and get Mac bundle? #1431

spotcatbug opened this issue Jun 6, 2019 · 5 comments

Comments

@spotcatbug
Copy link

I'm very excited about using Eto for an app I'm working on. However, I'm having great difficulty using the Eto source (not packages.)

I'm trying to build for Gtk (Linux), Wpf (PC) and Mac (Mac64). Gtk seems to be working fine. Wpf I haven't really tested yet. My main platform is Mac and I'm getting hung-up there.

My problem is, I don't know how to get the Mac project to create the .app bundle after it builds. It works fine when I reference the Eto.Platform.Mac64 package, but when I switch to using the Eto.Mac64 project, it doesn't do the mac bundle after the build.

I found the MacTemplate.targets file (which is apparently somehow incorporated into the package), but I can't figure out how to use it and Google isn't helping me. I've never used .targets before. You would think some Googling would make it obvious, but I'm really at a loss.

Any help would be greatly appreciated.

More generally, there's a wiki section on contributing, but there's no information about how to switch from using the pre-compiled packages to using the Eto-develop source. I think that would be really helpful and would possibly get more contributors.

@cwensley
Copy link
Member

cwensley commented Jun 7, 2019

Hey @spotcatbug, thanks for the question! Yes, there aren't any official instructions for using Eto.Forms from source, and you're right there should be.

To use the MacTemplate.targets, simply modify your launcher .csproj and add the following line:

<Import Project="Path\To\MacTemplate.targets"/>

If you are using an SDK-style csproj, you may need to split it up and add that after the Sdk.targets file. I haven't tested it though, so it very well might work without doing that.

Eto's Eto.Test.Mac64.csproj imports it by using a Directory.Build.targets file, which imports the MacTemplate.targets file based on the <UseMacTemplate> property, which may be another option if using manual Sdk.targets imports is not preferred.

Hope this helps!

@spotcatbug
Copy link
Author

Thanks for the prompt response! Awesome. After I asked about this, I kept fiddling (of course) and I did manage to figure out to add that import line to the .cproj. It still isn't building, though. I'll keep investigating - feels like I'm super-close to getting it. It's failing at the mkbundle step, which is basically the end.

@spotcatbug
Copy link
Author

Well, I tried hard. I can't get it to build. It gets to the mkbundle step and then errors-out: can't load System.Globalization.Extensions referenced by netstandard.dll. I don't even know if that's the only issue that's going to crop-up, although mkbundle is pretty much the end, so I imagine if I could get the references to connect, that'd be it.

I really wish I could build from source for debugging into the Eto stuff (I found some little issues already), but trying to wrap my head around getting the Mac build to work while wanting to actually develop my own app is a real bummer. I need Mac builds right away, for testing, so the fact that Gtk works, doesn't help me, unfortunately.

I think for now I'll stick with the NuGet packages and hopefully somebody smarter than I will figure this out and I'll join-in then :-). I'll work around the little issues I found within the constraints of the built packages.

P.S. Dev environment is MonoDevelop on Ubuntu - probably relevant!

@borjafdezgauna
Copy link

Rather late, but I also faced the same problem you did and this is what worked for me. I created a Directory.Build.targets file in my Mac.64 app's directory:

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  
  <Import Project="PATH-TO\build\MSBuildTaskHelper.props" Condition="'$(MSBuildTaskHelpersImported)'!='true'"/>
  <Import Project="PATH-TO\Eto.Mac\build\BundleDotNetCore.targets"/>
  <Import Project="PATH-TO\Eto.Mac\build\Mac.props" />
  <Import Project="PATH-TO\Eto.Mac\build\Mac.targets" />
  
  <ItemGroup>
    <PackageReference Include="RoslynCodeTaskFactory" Version="2.0.7" />
  </ItemGroup>
</Project>

Not sure this is the intended use, but this did it for me. Just in case it helps someone...

@cwensley
Copy link
Member

Closing as I think this has been answered. Also, please take a look at Eto.Test.Mac64.csproj -- it does exactly what you'd need and no longer relies on stuff outside of the .csproj to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants