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!

10 comments
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

This is awesome! thanks!

Is there any documentation for OC specific stuff?

0
Comment actions Permalink

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
Comment actions Permalink

OK thanks!

You were really helpfull

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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

Please sign in to leave a comment.