• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java program and ant.jar  RSS feed

 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Comal Rajagopalaratnam Muthukumar wrote:. . . I created java prg as under just to get  a style-pattern /specimen sample
that can be developed further . . .
Not in its present state it can't. The formatting is really bad. Please format the whole thing correctly and post it again.


//package mtp;

Hi
Please go through the same code removing the two lines of code shown here below and
write the command to compile and execute the same compiled  code to get the out put as under


  // System.out.println ("Project proj:" + proj.getProject());  (this is to show it has a link with Ant api especially on execution)
      //System.out.println ("Target targ:" + targ.getTarget());  (this is to show it has a link with Ant api especially on execution)
    
ie)

********************************
javac mtp/ChapterAntProjectTestDrive.java
java mtp/ChapterAntProjectTestDrive

**********************************
  output
************************************
<project name="MyTask" base.dir="*.*" default="jar">
</project>
<target name="dist" depends="compile" />
</target>
**********************
As you see the build file so created contains only two lines of out put indicatiing a lot more to be java coded to get full build.xml
Also I mentioned (under the coded note)that this is not a classicalpattern of any type,but it is very raw And not formattedhully  to any  in its state and  meant
for amateured developers only.
They are not to be treated as a regular pattern wih its format.
Thanks
AS
CRMK









 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Comal Rajagopalaratnam Muthukumar wrote:. . . Please go through the same code removing the two lines  . . .
No, thank you. It is your job to supply decent code, not mine.
And not formattedhully  to any  in its state and  meant
for amateured developers only.
They are not to be treated as a regular pattern wih its format.
Thanks
AS
CRMK
So you are happy to write illegible code?
 
Knute Snortum
Sheriff
Posts: 3947
92
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your program really needs to be formatted correctly, I agree with Campbell here.  Besides that, you have a method that looks like a constructor, and you are comparing variables to themselves.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:Your program really needs to be formatted correctly, I agree with Campbell here.  Besides that, you have a method that looks like a constructor, and you are comparing variables to themselves.


Hi
This is  the  final modihied prg for your perusal with thanks

Building a buildfile for ant  via java prg programatically using ant api
is rather rare and ant is not to be treated as a programming language
So formating the code was not main crieteria since execution and out put
were given priority while coding
Thanks
As
CRMK




 
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Comal Rajagopalaratnam Muthukumar wrote:
Knute Snortum wrote:Your program really needs to be formatted correctly, I agree with Campbell here.  Besides that, you have a method that looks like a constructor, and you are comparing variables to themselves.


Hi
In order to be a a result oriented lines of code as below
I have used File class
Also used less space
for perusal with thanks

As
CRMK


 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

   Hi
    Though the java prg shown below is supposed to give buildfile
    but it only compiles ok
    So in order to validate this java prog
    the build.xml (manually made) is used
    It shows ok and build a jar file
    So if any one is able to edit further     this java program
    to render build.xml
    it is appreciatd with thanks
    As
    CRMK















 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Comal Rajagopalaratnam Muthukumar wrote:. . . I created java prg as under just to get  a style-pattern /specimen sample
that can be developed further . . .
Not in its present state it can't. The formatting is really bad. Please format the whole thing correctly and post it again.



Hi
 
  So far we discussed about build file using java prg .
  Though the programtic attempt ended with  formaating error
  Also no further try/edit  was made by any one!Hence inplace of build.xml
   a new way to explore  ant build script file which were meticulaosly
  coded with formating in particular But even here result is rather not so clear since the Null pointer
  exception prevails proving that it is quite monumental.
  In the event of making it successfull, i shall remain thankful
 
  This is for your perusal with thanks
  As
  CRMK
 



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!