clemos / haxe-sublime-bundle

Sublime Text bundle for Haxe programming language
Apache License 2.0
235 stars 86 forks source link

Unable to select compile target for openfl project #157

Closed RudolfVonKrugstein closed 10 years ago

RudolfVonKrugstein commented 10 years ago

I am unable to build a openfl projet. In the root of my project, there is a file named "project.xml" (I can build the project using lime). I open a file (*.hx) in the Source subdirectory and press "Ctrl-Shift-B". Instead of listing possible targets, a "build.hxml" file is autocreated and presented.

How do I compile my openfl project?

clemos commented 10 years ago

Any output in the console ?

RudolfVonKrugstein commented 10 years ago
Unable to open [projectDirectory]/Source/build.hxml
Package Control: No updated packages

I noticed: When I open a file directly in the same directory of the "project.xml" (not in a subdirectory), it works.

clemos commented 10 years ago

It's weird. What is your exact directory layout ?

RudolfVonKrugstein commented 10 years ago

The layout:

(project root)
--> Assets
--> --> (...)
--> Export
--> --> (...)
--> project.xml
--> Source
--> --> Main.hx

I am editing "Main.hx".

clemos commented 10 years ago

And what's the content of your project.xml file ?

RudolfVonKrugstein commented 10 years ago
<?xml version="1.0" encoding="utf-8"?>
<project>

    <meta title="Fair Dice" package="de.woodengames.fairdice" version="1.0.0" company="Wooden games" unless="pro"/>
    <meta title="Fair Dice Pro" package="de.woodengames.fairdicepro" version="1.0.0" company="Wooden games" if="pro"/>
    <app main="Main" path="Export" file="FairDice" unless="pro"/>
    <app main="Main" path="Export" file="FairDicePro" if="pro"/>

    <window orientation="portrait"/>
    <window width="384" height="640" unless="mobile"/>

    <source path="Source" />

    <haxelib name="stablexui" />
    <haxelib name="openfl" />
    <haxelib name="actuate" />
    <haxelib name="firetongue" />
    <haxelib name="tink_core" />
    <haxelib name="haxe_mobilecore" unless="pro"/>

    <assets path="Assets" rename="assets" exclude="logo.png" />
    <assets path="gui/android" include="*" exclude="defaults.xml|skins.xml"/>
    <icon path="Assets/logo.png" />

</project>
clemos commented 10 years ago

You run Windows, right ?

clemos commented 10 years ago

... and you use the master branch, right ?

RudolfVonKrugstein commented 10 years ago

I installed it via package control

RudolfVonKrugstein commented 10 years ago

Ok, I might just be using sublime incorrectly. After scanning through "HaxeComplete.py", I tried this:

File -> Open Folder. Than open the project folder. In that folder open "Source/Main.hx". Now it works. So I may not open the file directly but I always have to have the project folder opened in sublime?

clemos commented 10 years ago

Yes, you need to open your project folder. If no folder is opened, the plugin will assume the project folder is the .hx file folder, hence the generation of this .hxml file. There are lots of ways to improve this behaviour, but for now, using "open folder" is the easiest way.

RudolfVonKrugstein commented 10 years ago

Ok thanks!!! I am unsure if it is just my complete sublime inexperience, but maybe it should be mentioned in the documentation?!?

clemos commented 10 years ago

It's subtle but it's mentionned in the docs ;) https://github.com/clemos/haxe-sublime-bundle#usage It could be more explicit, though.

RudolfVonKrugstein commented 10 years ago

Oh ... yes there it is. I miss interpreted that. But that is because I do not know sublime. I was unaware that one can open folders until I searched for it.