Add a new class/file to xCode (AppCode) project

Hey,

I created a customized plugin for creating test files for my team, but I can't seem to find a way to add the new file to the project from within the plugin.

Anyone knows how to add files to the xcode project from the plugin?

Thanks!

0
Avatar
Permanently deleted user

bump

0

To get all the bells and whistles automatically, simply inherit from OCNewFileActionBase.
Is it possible in your case?

0
Avatar
Permanently deleted user

Sorry for the extremely late response.

I don't have OCNewFileActionBase.

I was under the impression the ObjectiveC related stuff are private and we can't access them directly (I used reflection)

How can I get ObjectiveC API?

0

You need to create a Plugin API and point it to AppCode installation (see the instructions here: http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/setting_up_environment.html)

1
Avatar
Permanently deleted user

This is awesome! thanks!

Is there any documentation for OC specific stuff?

0

AppCode (ObjC/C/CPP) doesn't have open API yet (and no documentation).

Feel free to ask your question in the AppCode forum (https://intellij-support.jetbrains.com/hc/en-us/community/topics/200379545-AppCode)

1
Avatar
Permanently deleted user

OK thanks!

You were really helpfull

0
Avatar
Permanently deleted user

Hey,

I implemented an action using OCNewFileActionBase as suggested.

How can I set the Group and/or Targets selected in the dialog that I open?

I can't seem to find a way to do it. I did see there is XcodeCreateFileDialog, but I didn't find a way to actually use it.

 

P.S: I am also a bit confused about what the getFileTemplate is expecting to get. I want to create a file on my own

 

Thanks! 

0

If you inherit from OCNewFileAction you can then override createDialog and return an instance of CreateFileDialogBase or its subclass, which has all necessary controls (such as target and group).

and  getFileTemplate is a name of .ft template file (without .ft extension) that you put in resources/fileTemplates/internal. (you can start with 'null' to create an empty file)

 

0
Avatar
Permanently deleted user

Thanks man, will try it out.

I found a solution for now, but yours sounds maybe cleaner.

I overridden myHelper and made it return the dialog I wanted.

0

请先登录再写评论。