Moonshine-IDE / HaxeTemplateApplication

Other
0 stars 0 forks source link

Default Haxe Application Code #2

Open JoelProminic opened 1 year ago

JoelProminic commented 1 year ago

@rat-moonshine started working on the default Haxe template here. This code should be moved to this project. Watch out for Prominic-specific URLs or other references in the template.

rat-moonshine commented 1 year ago

For the reference, here's the original issue on Haxe implementation side.

Aszusz commented 1 year ago

@rat-moonshine Is your code going to work with released versions of hxcpp/lime/openfl/feathersui? Or do I have to fetch development versions of those dependencies?

rat-moonshine commented 1 year ago

The codes do not has any development dependencies, so yes you can use the production versions only.

For the moment I stuck at one problem, so you want to wait until I have that fixed.

piotrzarzycki21 commented 1 year ago

@rat-moonshine we have been looking with @Aszusz into the code of DemoProminicApplication, ProminicApplication and HaxeTemplateApplication. Here are our recommendations and steps we would like you to take on:

Haxelib

Haxelib is a place where people upload release versions of stable, self-contained libraries. They need to be oriented around one topic (like logging). We shouldn’t use haxelib in a way that we are using right now – with switch ‘-git’ where you download source code of some project and it’s being build as part of yours code. YES, we do that in several places, because we don’t have too much choices, but in case of this project we do have a choice. The answer is NO you shouldn’t use haxelib for this project UNLESS - you do make a release and upload it to haxelib officially. Your project which contains ProminicApplication and Updater is not a library, but rather a TEMPLATE – a project which presents some way of exception handling, logging, update handling etc.

Here’s what you should do and why

ProminicApplication [from AIR-prominic-native repository]

What to do with it:

  1. Extract from AIR-prominic-native
  2. Rename it to BaseApplication
  3. Duplicate its code to HaxeTemplateApplication (you already did that part, that’s great!)
  4. Don’t publish to haxelib

Why:

HaxeTemplateApplication

What to do with it:

  1. Duplicate all code from ProminicApplication in here (you already did that part, that’s great!)
  2. Put code from src\HaxeTemplateApplication.hx and put it src\base\BaseApplication.hx
  3. Don’t publish to haxelib (remove info from readme about using it with haxelib)

Why:

DemoProminicApplication [from AIR-prominic-native repository]

What to do with it:

  1. Remove completely from AIR-prominic-native
  2. Put code from DemoProminicApplication.hx to HaxeTemplateApplication.hx in HaxeTemplateApplication repository

Why:

rat-moonshine commented 1 year ago

We are not going to release the library to Haxelib, but using it as haxelib mostly for an easy of use.

I have some thought over the proposal; I need some time to write in.

Meanwhile, @Aszusz you can test the sample application here, if you want. You will need to install it as library before-hand, though. I still needing to do some tweaks, though.

JoelProminic commented 1 year ago

I did a test with @rat-moonshine's example project, and I see that I have to install the library manually at the moment. If we went with this solution, we would presumabily need to automate this with Moonshine.

I also found that the project had a dependency on hxcpp, which is not installed automatically be MSDKI.

Now I am stuck with this error on macOS Monterey. I updated XCode, but it installed the latest version instead, "macosx13.1". Is there a way to change with version Haxe is using? I didn't see any references to this SDK in the projects.

: Creating /Users/-user-/Documents/workspace/HaxeTemplateApplication/test/openfl/bin/macos/obj/obj/darwin64/__pch/haxe/hxcpp.h.gch...
: 2023-07-21 15:36:05.110 xcodebuild[16365:8854396] Writing error result bundle to /var/folders/_g/39dkp5w56sx0qg501b5bxmcm0000gn/T/ResultBundle_2023-21-07_15-36-0005.xcresult
: xcodebuild: error: SDK "macosx13" cannot be located.
: xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk macosx13 -find clang++ 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
: xcrun: error: unable to find utility "clang++", not a developer tool or in PATH
: Error: Could not create PCH

The project built on macOS Catalina, but could not run with an error like this:

: Link: ApplicationMain
: Could not initialize SDL: The video driver did not add any displays.
: Could not create SDL window: The video driver did not add any displays.
: [0;36m[2023-07-21 12:28:43][DEBUG] Prominic application started
: Haxe build has completed successfully.

However, I can't run other recent Haxe applications on this workstation. This is an old version of macOS, so we shouldn't spend much time on this. I need to find some time (and diskspace) to update.

JoelProminic commented 1 year ago

I can see the reasoning for making this a plain template and for making it a library, and I dont' have a strong sense of which is better here. In the interest of not getting bogged down on this solution, my vote is that we start with the plain template and refactor it (or components, like the crash report) into a library as needed. I think the template is more in the spirit of @JustinProminic's goal of having some example code that is easily editable to help the user get started.

rat-moonshine commented 1 year ago

Okay. I have updated the structure as everyone suggested. Please, check.

Aszusz commented 1 year ago

@JoelProminic now I see that there is something wrong with the build artifact. I'll let you know when this is fixed.

Aszusz commented 1 year ago

@JoelProminic I fixed the artifacts on GHA. They should work without problems now.