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

Improve HaxeDevelop/FlashDevelop integration #128

Open
Yanrishatum opened this issue Jan 10, 2018 · 5 comments
Open

Improve HaxeDevelop/FlashDevelop integration #128

Yanrishatum opened this issue Jan 10, 2018 · 5 comments

Comments

@Yanrishatum
Copy link

Yes, it does generate hxproj files, but I'd prefer having proper Kha platform template. I already partially made it with a batch wrapper monstrosity, but without few changes/additions in khamake itself, proper support is impossible. What I'm talking about:

  • Add either --display flag or display platform target, which prints hxml file with paths relative to khafile.js (not from build folder) to stdout.
    Current workaround: Printing it from build/project-<target>.hxml and adding -D kha_output=build\<platform>\dummy in order to fix asset macro errors. (It have broken -cp <target>-build/Sources path, but it's empty anyway in regards of Haxe code)
  • Make it possible to do --run without forced compilation.
    It is required, as "Test Project" in FD for such frameworks works in 2 passes, first it run build command (--compile) and then run command (--run), and currently khamake have now way of making run command without compilation.
    Current workaround: For windows doing direct launch of build/<target>/<Projectname>.exe, for other platforms - still uses forced compilation.
  • (optional, but preferable) Add --clean command that would clean up build directory from target files.
    Current workaround: Just plain delete those files manually.

What is wrong with current generated hxproj approach? A lot, actually.

  • They are not in root folder and because of that Project panel is completely messed up with build folders being shown always and actual sources hidden in References.
  • Each call of khamake regenerates said file.
  • Windows proj file in Test Project tries to run run_windows.bat, which does not exists.
  • Compilation directly from FD is problematic (for example I can't compile it at all as my OS have Haxe4-preview2 installed as main haxe which FD uses for compilation)
  • It generates it's own hxproj for each and every target. FD have a support for several targets (right next to Release/Debug build dropdown), which renders that generation pretty redundant.

Benefits from making proper template? As noted above - one hxproj file, guaranteed compilation (as long as it works for khamake), guaranteed launch, haxe completion, compilation and running managed directly by khamake.

@RobDangerous
Copy link
Member

ok, let's take it step by step.
Today's agenda: Compilation directly from FD. That actually shouldn't be a problem, the generated projects point to Kha's Haxe via the preferredSDK option. So that nonetheless tries to use your globally configured Haxe path?

@Yanrishatum
Copy link
Author

No, it refers to Kha's Haxe, yet compilation fails with common.ml error:

Running process: E:\Program\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\_work\2017\khatest\build\Khatest-windows.hxproj" -ipc 4af93ebb-a494-4290-ab6e-743cb05b710f -version "0.0" -compiler "E:\HaxeToolkit\kha\Tools\haxe" -notrace -library "E:\Program\FlashDevelop\Library"
Building Khatest-windows
haxe --connect 6000 -cp E:/HaxeToolkit/kha/Sources -cp E:/HaxeToolkit/kha/Backends/Kore -cp ../Sources -cpp C:/_work/2017/khatest/build/windows-build/Sources -main Main -D no-compilation -D sys_windows -D sys_kore -D sys_g1 -D sys_g2 -D sys_g3 -D sys_g4 -D sys_a1 -D sys_a2 -D kha_cpp -D kha_windows -D kha_windows_cpp -D kha_default -D kha_kore -D kha_g1 -D kha_g2 -D kha_g3 -D kha_g4 -D kha_a1 -D kha_a2 -D kha -D kha_version=1611 -D kha_output="C:\_work\2017\khatest\build\windows-build\Sources" -debug
File "src/context/common.ml", line 834, characters 21-27: Assertion failed
Build halted with errors (haxe.exe).
Done(1)

It does compile and run properly if I use kha --compile, as well as my own Kha template (welp, it does run kha --compile, so no surprise).

@sh-dave
Copy link
Contributor

sh-dave commented Jan 11, 2018

A workaround for a root level project file i use, is to simply create an hxml based FD project and forward to build/project-flash.hxml:

--cwd build
project-flash.hxml

@RobDangerous
Copy link
Member

Can you verify which haxe.exe is actually used for example by renaming the executables? For me it uses Kha's Haxe like it should. Also please test using one of the samples ala https://github.com/Kha-Samples/Empty so we can make sure the issue is not in Khatest-windows.

@Yanrishatum
Copy link
Author

Confirming. Even after adding Kha's Haxe to SDK list and selecting it - building via FD does not work. Both with my (actually pretty much same empty) project and empty repo. Both with recursive cloning and with external kha repo. Same goes to any target. Do not I use development builds of FD, because stable lacks features a lot. (Plus usability fixes since recently)

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