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

CreateMainClassAndOpenItInEditor #398

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

as3boyan
Copy link
Contributor

@as3boyan as3boyan commented Feb 2, 2016

CreateMainClassAndOpenItInEditor

HaxelibManager attempts to do something when creating a Java project
by adding a SDK check to sync project classpath function

Set run configuration module to current
Check if Main.hx is already in project
Set more project settings (probably some are not necessary)
class ${NAME} {
public static function main() {
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be invisible to user, only for project generation

@as3boyan
Copy link
Contributor Author

as3boyan commented Feb 2, 2016

I am not sure if it is a good way to do such stuff, but it is better than nothing, perhaps there are might be project templates, maybe in plugin.xml, but I don't know about it yet.

Basically it creates ready to use project, with proper run configuration, but on first compilation it fails, then after it, it is ok.

Also if user would do make using menu before compilation - it will work.

I don't really understand why it copies Main.hx to out/production and removes release directory even if I created it before project

Sdk sdk = HaxelibSdkUtils.lookupSdk(project);
boolean isHaxeSDK = sdk.getSdkType().equals(HaxeSdkType.getInstance());

if (!isHaxeSDK) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check which fixes #397

@EBatTiVo
Copy link
Contributor

EBatTiVo commented Feb 2, 2016

The CI build is failing because of the breaking API changes between 14.0.4 and 14.1.6. (Actually, 14.1.5 introduced the breaking changes.) So we're going to have to use the MethodWrapper class to cover it. The v15 stuff has a better implementation, so we can wait for that (in the next hour or two) before we submit.

@EBatTiVo
Copy link
Contributor

EBatTiVo commented Feb 2, 2016

OK, the v15 branch has been merged, so you can use it now.

@as3boyan
Copy link
Contributor Author

@EBatTiVo What if we will do this, only if project has no Haxe modules?

@EBatTiVo
Copy link
Contributor

@as3boyan How about a check box, in the "Create New Class" dialog? Maybe with the title: "Add main support"? Possibly even a secondary check box for "Add debugger support" and include the snippet from the README.md? Of course, they should only be available if the "Kind" field is Class or Enum.

@EBatTiVo
Copy link
Contributor

@as3boyan Also, the same code can be added to a warning dialog from the "Main class" selector on the module settings page.

@as3boyan
Copy link
Contributor Author

I don't know, it seems like good place for it is in project templates, but I don't know how to put it there

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

Successfully merging this pull request may close these issues.

None yet

2 participants