Run build/test from command line

How to clean/make/test some (ipr/.idea) project from command line?

There is GUI-menu option "generate ant", but incremental build from Ant is not so reliable as idea can do. Seems IDEA incremental build is much-much-much more reliable than Ant can. IDEA can see what should be recomplied by dependencies, and recompile only needed *.class, delete orphan *.class without java (even nested/anonymous).

Also there is no command line option "generate ant build", so I have to manually "generate ant build" after any change in the project, so this option is not available.

Maybe there is some java -jar idea.jar Some.Class.For.Buld way, or may be import jar from java, like

import jetbrains.Some.Class.To.Run.For.Build 
import jetbrains.Idea.Project
Build.SomeMethod(new jetbrains.Idea.Project( "myproject.ipr" ))


This solution is fine too, if available.

Thanks!

7 comments
Comment actions Permalink

May be option "ant" is supposed to automatically export ant-build.xml file?

But when I run from ~/idea{version}/bin/

./idea.sh ant ~/projzip/testbuild.xml ~/projzip/build.xml

it prints to stdout "Starting app..." (on idea Ubuntu/Community Edition idea-IC-103.255 or Windows/Ultimate Edition 103.255  ) and nothing is happened,  ~/projzip/build.xml is not created.
or it complains "about java.awt.HeadlessException" ( on Ubuntu/Ultimate Edition 103.255 )   (see attached idea_10.0.3_build_UI103.255.err.txt)

projzip.tar.gz: small idea project,  I tested on which
idea_10.0.3_build_UI103.255.err.txt.zip - log from Ulitimate Editon on ubuntu
idea.log - log from Community Edition
strace_write_open - strace log of Community Edition, grepped by "open" and "write" (  strace -s 200 -f ./idea.sh ant ~/projzip/testbuild.xml ~/projzip/build.xml   2> stderr.txt ; grep  '\b\(write\|open\)\b'  stderr.txt > strace_write_open.txt )



Attachment(s):
projzip.tar.gz
idea_10.0.3_build_UI103.255.err.txt.zip
strace_write_open.txt.zip
idea.log.zip
0
Comment actions Permalink

Hello Ivan,

This option is completely unsupported and shouldn't have been included in
the product at all in its current state.

May be option "ant" is supposed to automatically export ant-build.xml
file?

But when I run from ~/idea/bin/

/idea.sh ant ~/projzip/testbuild.xml ~/projzip/build.xml

it prints to stdout "Starting app..." (on idea Ubuntu/Community
Edition idea-IC-103.255 or Windows/Ultimate Edition 103.255  ) and
nothing is happened,  ~/projzip/build.xml is not created.

or it complains "about java.awt.HeadlessException" ( on
Ubuntu/Ultimate Edition 103.255 )   (see attached
idea_10.0.3_build_UI103.255.err.txt)


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


0
Comment actions Permalink

А почему, кстати? Мы сейчас мучаемся, так как не можем сделать банальную вещь: билд для автоматической сборки проекта, который выкладывает результат в виде jars.
Как это по задумке следует делать?

0
Comment actions Permalink

The suggested way to do this is to use this build system: https://github.com/shafirov/JPS ( You may see the discussion here (russian) :  http://community.livejournal.com/ru_java/1025531.html?thread=14895099#t14895099 )

I tryed to build this build system, but first try failed:)

sudo apt-get install git
git clone https://github.com/shafirov/JPS.git
sudo apt-get install gant

then:
gant -P lib:plugin:antLayout/src:src

And i got the following error output:  (see attached   gant_stderr.txt )

IMHO, this system seems to be under development, and not very stable, requires specific gant/jdk libraries to build/run. At the same time, old way "idea.sh ant project.xml antbuild.xml " is dropped.



Attachment(s):
gant_stderr.txt.zip
0
Comment actions Permalink

Hello Timur,

Note that this is an English language forum.

А почему, кстати? Мы сейчас мучаемся, так как не можем сделать
банальную вещь: автоматическую сборку проекта в jars на билдерах.

Как это по задумке следует делать?


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


0
Comment actions Permalink

I c.
But english is not our native language. I try to avoid misunderstandings due to foreign language.
If it had the support of russian, I'd use it. But it is not.

0
Comment actions Permalink

Hello Timur,

You can discuss IntelliJ IDEA in Russian, for example, in the ru_intellijidea
LiveJournal community.

But english is not our native language. I try to avoid
misunderstandings due to foreign**  language.
If it had the support of russian, I'd use it. But it is not.


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


0

Please sign in to leave a comment.