You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Gökhan Özbulak <go...@gmail.com> on 2010/10/22 15:44:20 UTC

Something like "make install" in Ant

Hi,

I wonder if ant supports something like "make install" in make of GNU. I
examined various build.xml files from various well known projects like
Apache Tomcat etc., but couldn't see anything about installing files built
into somewhere like /usr/bin in GNU/Linux distros.

If there is no such target, could i ask "why not"? Because after compilation
with suitable target, say "ant compile", copying everything built into
correct paths is the work of those building the source with ant. Doesn't
automation of this process as in "make install" make the life easier?

--
go

Re: Something like "make install" in Ant

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-10-22, Gökhan Özbulak wrote:

> I wonder if ant supports something like "make install" in make of GNU. I
> examined various build.xml files from various well known projects like
> Apache Tomcat etc., but couldn't see anything about installing files built
> into somewhere like /usr/bin in GNU/Linux distros.

Most Java projects think differently about "install" than native apps.
Taking Ant for example, "installing" it means unpack the distribution
wherever you want, set the ANT_HOME environment variable if you feel
like it (otherwise the wrapper script will figure it out in most cases
anyway) and add the bin directory to the PATH environment variable.

I think Tomcat has Windows installers and there are various platform
dependent packages for popular Java tools/libraries usually not
maintained by the actual developers of the tool/library.

Unfortunately the Linux distributor's ideas of where to put things -
what would be closest to what "make install" would do - likely are very
different from the original developers' ideas.  The RPM packages for Ant
ship with different/modified wrapper scripts for example and if you
report a bug against Ant a normal first reaction will be "uninstall the
RPM and install an official distribution".

But I'm getting carried away (Hi Stephen ;-).

My guess as to why there is no "make install" equivalent in most Ant
build files is that there is no "make install" equivalent in the mindest
of the project's developers.  I don't have Tomcat anywhere close to
/usr/bin or /usr/local/bin or /opt and neither is Ant on my Linux
development box, they live somewhere under my home directory.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Something like "make install" in Ant

Posted by Stephen Connolly <st...@gmail.com>.
Oh how I look forward to rthe fun if you ever venture over to ask the
same of Maven! [Maven being "opinionated" software has the opinion
that installation of software onto your system is the responsibility
of a software installer and not the responsibility of Maven Core]

Apache ANT does not dictate what any of the targets in a build.xml
file are.  People who feel strongly about a set of standard targets
with standard meanings attached to those targets are often drawn to
build tools which are more "opinionated" than GNU Make or Apache ANT.

In the case of GNU Make and Apache ANT, people are free to choose from
at least the vast range of [A-Z][a-z][A-Za-z\-_0-9]* for their target
names.  Convention is all that keeps people using specific targets
with specific meanings.

There is a large body of Makefiles that use the target "install" to
copy binaries into place... but that is just a convention.  GNU Make
in and of itself does not force you to have a Makefile target called
"install" just as it does not force that target to actually install
binaries into place.

In the case of Apache ANT, typically the build.xml files support
running on multiple OSes where installation is not always trivial...
for example, on Windows to install software correctly you need to
interact with the windows registry correctly in order to add the
software to the "Add/Remove Programs" control panel... and different
OSes can have different install locations even keeping on unix
derivatives.

What most ANT projects do is produce an archive which is either
extracted to "some random folder" and contains the entire distribution
with shell scripts / batch files to start the application, or else
they produce a single artifact (.jar or .war or .ear or .rar - they're
all just .zip files under the covers anyway) that consists of the
entire application.

So you have an opinion that all ANT build files should have a target
called "install" and that target will install the software into the
"correct" location on anyones machine... that's great, I like
"opinionated software" [I am a Maven PMC], I have a different opinion
as to what a target of "install" should do... I think that "install"
should copy all the build artifacts to some random subfolder of
~/.m2/repository  while most ANT fans will say I'm wierd, you should
just trust me when I say "if you think my idea of what install means
is strange you should hear what I think deploy means"

Anywho, I don't think you will get far if you are campaining to change
ANT to enforce an "install" target that will always install the
software correctly on whatever OS the software is running on... you
might get somewhere pestering individual projects to add an "install"
target... but my experience is that picking standard name:symantic
associations for ANT targets is a bit like trying to agree on whether
the { should go on the same line as the if or on the next line...

Good luck

-Stephen

On 22 October 2010 14:44, Gökhan Özbulak <go...@gmail.com> wrote:
> Hi,
>
> I wonder if ant supports something like "make install" in make of GNU. I
> examined various build.xml files from various well known projects like
> Apache Tomcat etc., but couldn't see anything about installing files built
> into somewhere like /usr/bin in GNU/Linux distros.
>
> If there is no such target, could i ask "why not"? Because after compilation
> with suitable target, say "ant compile", copying everything built into
> correct paths is the work of those building the source with ant. Doesn't
> automation of this process as in "make install" make the life easier?
>
> --
> go
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org