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

target specific dependencies are not taken into account if there is multi build compilation for each target #357

Closed
atanaschristov opened this issue Jun 7, 2019 · 2 comments

Comments

@atanaschristov
Copy link

atanaschristov commented Jun 7, 2019

First thanks for the great work. So far for the people looking for an IntelliJ alternative, VSC provides the most advanced support for haxe language.

Here is the issue I currently observe: We have the following build.hxml

-cp src
-cp lib/common/src

--each

-D target1
-cp lib/target1/src/lib
-js bin/target1.js

--next

-D target2
-cp lib/target2/src/lib
-js bin/target2.js

--next

-D target3
-cp lib/target3/src/lib
-js bin/target3.js

etc....

So when importing a target specific dependency, it isn't found and an error is shown in the editor. The haxe compiler build all targets just fine. The common provided class paths before --each are recognized and taken into account by the plugin.

But if the build.xhml looks like this:

-cp lib/target3/src/lib
-cp lib/target2/src/lib
-cp lib/target1/src/lib
-cp src
-cp lib/common/src

--each

-D target1
-js bin/target1.js

--next

-D target2
-js bin/target2.js

--next

-D target3
-js bin/target3.js

The editor is able to handle the target specific dependencies.

I think the plugin should be able to handle all class paths not only the common ones.

It would be great as well if the plugin is able to find and process multiple hxml files if this makes sense. Currently if I have each target split in its own folder and each target has its own build.xhml file I need to open each separate target in a new window, which is not ideal. This makes sense if there is a project which provides a library/common code, and multiple small demo apps, demonstrating the usage of the library on different targets. What do you think?

Best regards.

@Gama11
Copy link
Member

Gama11 commented Jun 7, 2019

--next and --each are indeed not really supported, and I don't see how they could be. You would have to be able to actively select a particular "target" within the hxml file, as it's not safe to just merge arguments from the different branches into one. And that selection would be a bit awkward, as the sections don't even have names. At that point, it seems better to just split it up into multiple hxml files.

Currently if I have each target split in its own folder and each target has its own build.xhml file I need to open each separate target in a new window, which is not ideal.

As long as multi root workspaces (#170) are not supported, you can do something like this in settings.json:

"haxe.configurations": [
	["--cwd", "server", "server.hxml"],
	["--cwd", "client", "client.hxml"]
]

@atanaschristov
Copy link
Author

@Gama11 ,

Thanks for the answer and the hint.

Best regards

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

2 participants