synchronizing dependencies between ant and internal compiler
Hello,
We have a fairly large (huge really) project that we build using ant. When
building from clean to test run the app, we usually incurr 2 compilation
cycles, one from ant, and one from idea. Our project is structured using
multiple output directories shared by both ant and idea.
Is there a way of avoiding the "second" build - for some reason, idea's
internal build system seems to think that the class files in the output
directory are older than the source and undergoes the full compilation
(which takes several minutes) even though the files are up-to-date.
It is convenient to use idea to update the project (our jars are mostly
required to read plugin configuration data), but it is fairly painful to
wait for the two builds.
/a
请先登录再写评论。
Hi Alberto,
Are there any reasons why you use Ant instead of building everything in IDEA
when developing? From your post I conclude that everything can be built by
IDEA's "make" or "rebuild" actions.
--
Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"
"Alberto Ricart" <aricart@smartsoft.com> wrote in message
news:asg52o$49p$1@is.intellij.net...
>
>
>
>
>
>
>
>
Not really, the application is extensible and has numerous plugins and
things that must be put in the right place as jars if the app is to find its
external code. That is, if things are not packaged, we don't look for
certain configuration files that are necessary for the app to work. So
everytime the configuration file changes, we do need to rebuild, and the
double build is painful.
/a
"Eugene Zhuravlev" <jeka@intellij.com> wrote in message
news:asgb8e$g4k$1@is.intellij.net...
>
IDEA
>
>
>
When
>
>
Well, you may exclude from compilation those files/packages that are
compiled with Ant...
--
Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"
"Alberto Ricart" <aricart@smartsoft.com> wrote in message
news:asgbik$gm5$1@is.intellij.net...
its
>
>
>
by
compilation
using
idea's
output
mostly
to
>
>
This is not possible. Why doesn't the compiler look at the timestamp to see
if it is already up to date?
/a
"Eugene Zhuravlev" <jeka@intellij.com> wrote in message
news:asge9m$l36$1@is.intellij.net...
>
>
>
>
in
built
ant.
compilation
painful
>
>
see
We are using javac / jikes for compilation so the question should be
addressed to other developers :-).
In fact, if the files are compiled externally, how would IDEA know whether
they are up-to-date with the sources or not? IDEA maintains its own data
caches what files were compiled and what were not and what sources have been
modified since. This information is used and updated by the "make" feature.
If the sources were compiled by another process (e.g. Ant), there is no way
for IDEA to determine whether the current classes really correspond to the
current sources.
--
Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"
This is why I am for the total integration with Ant.
In any case, IntelliJ could check its own caches and also the file date
stamp. If a .class file is older than the .java file, compilation is
required. This is how Visual C++ works and it works fine.
Remember that all of this would be gone if Ant seemless integration would be
achieved.
Amnon
"Eugene Zhuravlev" <jeka@intellij.com> wrote in message
news:asi2nt$2vk$1@is.intellij.net...
>
been
feature.
way
>
>
>
>
>
I don't fully agree that ant should be the only solution. For one thing, the
goal of an IDE is to avoid writing scripts and other things that are not
"code". IF the IDE uses ant to do builds, but provides UI for me to build my
scripts without writing the script, then such solution is acceptable.
Otherwise, I want to write code, and push a button and have things work.
In our case, we have a fairly complex build, and we do use ant. Our ant
build files contain a number of essoteric targets which probably most people
would never need or want. The real need is for the IDE to do most of the
things developers require an ant script for and provide the facilities right
from the IDE.
3.0 already took the first step, it now copies resource files to the
output/build directories. Which in many cases covers about 90% of all the
smaller projects.
Perhaps what is needed is additional target functionality:
1) Build jars from a specified source tree (feature should allow adding
additional files from other source trees)
2) Move generated files (jars) to specified directories.
With these 2 additional features we could easily eliminate most ant targets
(even on larger projects). Ant would still be required for more complex
builds with conditional compilation, etc. But that seems fair.
How-about-it Eugene? Do a jar plugin that allows jars to be built from
specified output directories, and provide a "move" target that
copies/replaces out of date files in a particular directory?
/a
Yep, it is possible. More general, we are talking about the Open API for
Compiler subsystem.
You are welcome to fill in the SCR.
--
Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"
In an off-line discussion with Eugene, he pointed me to the 3.x facility
that allows executing an ant target before or after compilation. Just right
click on the Ant target list to enable this.
With a few tweaks of ant, I can have idea compile, and jar my files with
ant.
Brilliant.
/a
That's what we do. We don't compile with IJ internal compilation.
"Alberto Ricart" <aricart@smartsoft.com> wrote in message
news:aslb2k$gkm$1@is.intellij.net...
right
>
>
>
>
>
>