• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to create the tar file in the dist directory.

 
Sumit Ranjan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I want to use ANT to interact with Subversion(It is the configuration management software we are using). I want to get the latest source files from Subversion and then compile the source code and create a tar file that I want to keep in a folder called dist.

I am able to compile all the code and put the class files in the build directory but when I try to tar the class files and put it into dist folder it says -
compress:
[tar] Nothing to do: D:\PTCS_PRISM\trunk\dist\Prism.tar.gz is up to date.

Now, when I check the dist folder, I cant find any tar file there. So, I am a bit confused as to why it gives this output and why I am not able to create the tar file in the required folder.

The part of my build.xml for performing this task looks like this -

<target name="update"
depends="prepare"
description="update from subversion">
<echo message="update src directory"/>
<svn>
<update dir="${src.dir}"
revision="${svn.revision}"/>
</svn>
</target>

<target name="compile"
depends="prepare"
description="Build all the source files for the Prism Project">
<javac srcdir="${src.dir}"
destdir="${build.dir}"
compiler="modern"
source="1.5"
deprecation="on">
<classpath>
<path refid="ant.classpath"/>
<path refid="project.classpath"/>
</classpath>
</javac>
</target>

<target name="compress"
depends="prepare,compile"
description="Create the project's tar file">
<tar
destfile = "${dist.dir}/Prism.tar.gz"
basedir = "${build.dir}"
includes = "*.class"
compression = "gzip" />
</target>

Can anyone help me in this regard?
 
Sumit Ranjan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just modified the includes attribute of tar as shown below and it worked !!!

<target name="compress"
depends="prepare,compile"
description="Create the project's tar file">
<tar
destfile = "${dist.dir}/Prism.tar.gz"
basedir = "${build.dir}"
includes = "**/*.class"compression = "gzip" />
</target>

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic