Intellij Project files creation though ant

Hi,

I am looking to generate .ipr .iml and .iws files thorough ant custom task, which at the end of the build execution looks at certain ant paths and generate these files.

I am sure such thing must be very much possible..  but not sure where to go deeper..

As a start, I am looking for intellij api which are used by the UI (Project Setting swing UI) to generate/update these files.
Could any one point me to these api in case they are exposed to public

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

5 comments
Comment actions Permalink

Hello Nagendra,

Of course you can generate the .ipr/.iml files programmatically - they are
just regular XML files. The Project Settings Swing UI doesn't update these
files directly - it modifies in-memory components which are then serialized
to XML. It's far easier for you to generate the files directly rather than
try to use any of the code in IntelliJ from an external script.

I am looking to generate .ipr .iml and .iws files thorough ant custom
task, which at the end of the build execution looks at certain ant
paths and generate these files.

I am sure such thing must be very much possible..  but not sure where
to go deeper..

As a start, I am looking for intellij api which are used by the UI
(Project Setting swing UI) to generate/update these files.

Could any one point me to these api in case they are exposed to public


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

>Of course you can generate the .ipr/.iml files programmatically - they are
just regular XML files. The Project Settings Swing UI doesn't update these
files directly - it modifies in-memory components which are then serialized
to XML. It's far easier for you to generate the files directly rather than
try to use any of the code in IntelliJ from an external script.

Nice..Could you pl. point me to these api which does through creation of the xml though in-memory components. Direct xml generation approach would result in compatablity issues and hence using the in-memory components is the right way to go. In case these components are not public already.. it would be very good to expose them to the developers as it helps in moving to intellij very easy.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

0
Comment actions Permalink

Hello Nagendra,

+>Of course you can generate the .ipr/.iml files programmatically -
they are+ +just regular XML files. The Project Settings Swing UI
doesn't update these+ +files directly - it modifies in-memory
components which are then serialized+ +to XML. It's far easier for you
to generate the files directly rather than+ +try to use any of the
code in IntelliJ from an external script.+

Nice..Could you pl. point me to these api which does through creation
of the xml though in-memory components. Direct xml generation approach
would result in compatablity issues and hence using the in-memory
components is the right way to go.


No, it is not. IDEA project files are backwards compatible, so if you generate
the project files in the current format, any future version of IntelliJ will
be able to open it.

You're welcome to try it to do it your way (create a project, use classes
like ProjectRootManager and ModuleRootManager to set up its modules, content
roots and libraries, and then call Project.save() to save the data to XML),
but it'll be much harder and slower than generating XML directly, with no
real benefits.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thank you for the api details. I see these are part of openapi of intellij.. which is a very good news to my needs.

Dmitry, I am unable to find the javadoc for the latest version of the openapi on google search (finding few for .x and 6.x).. Could you pl. point me to right openapi location pl.

Regards,
Nagendra

0
Comment actions Permalink

Hello Nagendra,

Since the release of the Community Edition, we're no longer publishing the
javadocs online. Please refer to http://www.jetbrains.org/ to get the source
code of IntelliJ IDEA Community Edition.

Thank you for the api details. I see these are part of openapi of
intellij.. which is a very good news to my needs.

Dmitry, I am unable to find the javadoc for the latest version of the
openapi on google search (finding few for .x and 6.x).. Could you pl.
point me to right openapi location pl.

Regards,
Nagendra
---
Original message URL:
http://www.jetbrains.net/devnet/message/5251263#5251263

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.