Re: classfile has wrong name WRT package?



I also got the jar task working :)

However, the jarfile and Main-Class attributes are hard coded, rather
than using properties :(


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

C:\java>
C:\java>
C:\java>ant
Buildfile: build.xml

clean:
[delete] Deleting directory C:\java\build

prepare:
[mkdir] Created dir: C:\java\build\prod

compile:
[javac] Compiling 1 source file to C:\java\build\prod

package:
[jar] Building jar: C:\java\HelloWorldApp.jar

BUILD SUCCESSFUL
Total time: 27 seconds
C:\java>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java

06/25/2006 05:52p <DIR> .
06/25/2006 05:52p <DIR> ..
06/25/2006 05:51p <DIR> build
06/19/2006 03:25p 677 build.groovy
06/25/2006 05:51p 1,310 build.xml
06/24/2006 11:07p 1,324 build.xml.HelloWorldApp
06/25/2006 05:52p 967 HelloWorldApp.jar
06/25/2006 05:41p <DIR> src
06/24/2006 10:05p <DIR> vendor
4 File(s) 4,278 bytes
5 Dir(s) 816,582,656 bytes free

C:\java>java -jar HelloWorldApp.jar
Hello World!

C:\java>type build.xml
<?xml version="1.0"?>
<!--

Just a simple HelloWorld app

-->

<project name="Hello" default="package" basedir=".">

<property name="build.dir" location="build"/>
<property name="build.prod.dir" location="${build.dir}/prod"/>
<property name="doc.dir" location="doc"/>
<property name="index.dir" location="index"/>
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="vendor.lib.dir" location="vendor/lib"/>

<property name="pkg.dir" location="thufir.bonjour"/>
<property name="mainClass" location="HelloWorldApp"/>

<path id="project.classpath">
<pathelement location="${build.prod.dir}" />
</path>

<target name="clean">
<delete dir="${build.dir}" />
</target>

<target name="prepare" depends="clean">
<mkdir dir="${build.prod.dir}"/>
</target>


<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.prod.dir}">
<classpath refid="project.classpath" />
</javac>
</target>


<target name="package" depends ="compile">
<jar jarfile="HelloWorldApp.jar"
basedir="${build.prod.dir}" >
<manifest>
<attribute name="Main-Class"
value="thufir.bonjour.HelloWorldApp" />
</manifest>
</jar>
</target>
</project>

C:\java>
C:\java>
C:\java>
C:\java>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++


-Thufir

.



Relevant Pages

  • Re: problem in creating Services
    ... If the compiler does not emit warning or errors, ... that the code has been written in a *clean* way. ... class, or even KNOW the parent class at all, are horrors that compile. ... and I insisted we do only INTERFACE reviews. ...
    (microsoft.public.vc.mfc)
  • Re: Configuring imap-uw difficulties
    ... >> a configuration file. ... >> understanding of the Ports system or of how to compile. ... Thanks for the lightening fast response. ... Doing 'make clean' ...
    (freebsd-questions)
  • Re: Followup on KDE 3.2 and 4-STABLE
    ... Sorry if I was unclear, I consider a 'link' or a 'compile' to be "clean" when ... ddp% ld -o foo foo.o ... That was considered a "clean compile and link." ...
    (freebsd-questions)
  • Re: Object pooling
    ... > Another option would be to "compile" a finalizer per class, ... The cost of the "clean up" of a pooled object ... is directly added to the cost of its "set up". ...
    (borland.public.delphi.language.basm)
  • Re: Possibilities for Attendance-Tracking Calendar Form?
    ... I think you'll have to first import it into Access 2.0, clean up any compile ... Access 2003 will not read/convert an Access 2.0 ... database, and I don't remember whether Access 2002 will. ...
    (comp.databases.ms-access)