Skip to content

Allow building with non-xcode workflow #48

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

Closed
andrewdavidmackenzie opened this issue Apr 28, 2018 · 9 comments
Closed

Allow building with non-xcode workflow #48

andrewdavidmackenzie opened this issue Apr 28, 2018 · 9 comments

Comments

@andrewdavidmackenzie
Copy link

Flutter allows build/run on Android/iOS from Android Studio and IntelliJ, would it be possible to build on macOS also using those tools?

@stuartmorgan-g
Copy link
Collaborator

The original design of this project was targeting desktop developers who wanted to embed Flutter within a traditionally-developed desktop project. However, so far most of the interest seems to be from people who are looking for a Flutter-like development experience where the wrapper app is largely an implementation detail, so I do expect us in the future to support something that looks much more like the existing Flutter workflow.

(In the short term, you could easily make a simple Makefile or similar that invokes xcodebuild on your project, and trigger that from the editor of your choice.)

@krisgiesing
Copy link
Contributor

krisgiesing commented Apr 30, 2018

To add some nuance to the answer: Xcode tools installation will always be required because Apple requires them to build applications for macOS (and iOS). (Unless Apple changes this policy.)

@stuartmorgan-g stuartmorgan-g changed the title Allow building with non-xcode tools Allow building with non-xcode workflow Apr 30, 2018
@andrewdavidmackenzie
Copy link
Author

Thank you. My main goal was to avoid installing and having to use full xcode to build, and get by with command line tools instance plus IntelliJ with flutter plugin

@sgon00
Copy link

sgon00 commented Dec 9, 2018

I want command line tools. I hate GUI. Can we have a command line tools, please? something like: flutter run, flutter build. GUI tools are too complicated to me. I really can't figure out how to compile MacOS and WIndows versions. They are too complicated without screenshots doc. Thank you very much.

@stuartmorgan-g
Copy link
Collaborator

something like: flutter run, flutter build

These tools work because the native embedding code for mobile is created and managed by Flutter, which is not currently the design of this project (as discussed both in my comment above and the README). Making command-line wrappers to build the example or the library would be easy, but wouldn't really help someone trying to use this library in their own project; there would still be the step of creating new macOS, Linux, and/or Windows embedding applications.

For that there will need to be something that serves the purpose of flutter create, which is substantially more work since it needs to be able to create (and later update) native projects for each platforms from templates. Given that two of the three embedders are currently placeholders that will likely be entirely rewritten, it doesn't make sense to work on making templates from them at this point. It would also probably not make sense to do that before there are binary releases of the libraries.

As I noted above I do think that kind of tooling will come in the future, but right now the focus is still primarily on building out functionality.

@sgon00
Copy link

sgon00 commented Dec 10, 2018

@stuartmorgan thanks a lot for the detail reply. Yeah, I figured out I needed flutter-desktop create, otherwise, I have no idea how to use this with my existing project. I have no ideas how to create those .h, .swift and .plist files. I am just really confused how to use this at all.

@dcharkes
Copy link
Member

Yeah, I figured out I needed flutter-desktop create, otherwise, I have no idea how to use this with my existing project. I have no ideas how to create those .h, .swift and .plist files. I am just really confused how to use this at all.

I tried copying over the macos_fde folder, setting FDE_ROOT in Xcode, and fixing some paths in Xcode. But I couldn't that to work.

Can we have a command line tools, please?

I tried running the build through xcodebuild from the command line, but that did not yield the same results as running from within Xcode.

xcodebuild -configuration Debug -target Example\ Embedder

...

/Users/dacoharkes/flt/engine/flutter-desktop-embedding/example/macos_fde/Example Embedder-Bridging-Header.h:16:9: error: 'FlutterEmbedderColorPanel/FlutterEmbedderColorPanel.h' file not found
#import <FlutterEmbedderColorPanel/FlutterEmbedderColorPanel.h>
        ^
1 error generated.
<unknown>:0: error: failed to emit precompiled header '/Users/dacoharkes/flt/engine/flutter-desktop-embedding/example/macos_fde/build/SharedPrecompiledHeaders/Example Embedder-Bridging-Header-swift_2A2APZ7VJ8VYG-clang_69D6YMFET0U9.pch' for bridging header '/Users/dacoharkes/flt/engine/flutter-desktop-embedding/example/macos_fde/Example Embedder-Bridging-Header.h'

<unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **


The following build commands failed:
	PrecompileSwiftBridgingHeader normal x86_64
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)

Side note: I don't need the fde in the end, but I'm using dart:ffi which is not supported on arm yet. I'll manage with using the fde on Linux for the time being.

@stuartmorgan-g
Copy link
Collaborator

But I couldn't that to work.

If you email the mailing list with specific errors, I may be able to figure out from the errors what you missed updating.

I tried running the build through xcodebuild from the command line, but that did not yield the same results as running from within Xcode.

The error you have there indicates that the dependencies (plugins) aren't using the same build location as the application. This xcodebuild command works fine on the CI machines:
https://github.com/google/flutter-desktop-embedding/blob/master/.travis.yml#L48
so either you have non-standard Xcode-level settings for build locations, or xcodebuild behaves differently without the scheme flag.

I'll likely add an example shell script to the repository soon that does an xcodebuild to a known location, as part of adding some information about how to set up a build/run/debug cycle from within VS Code, which would address the original request in this bug.

@stuartmorgan-g
Copy link
Collaborator

Moved to flutter/flutter#30706

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants