This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Java program and ant.jar  RSS feed

 
Ranch Hand
Posts: 336
  • 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









 
Marshal
Posts: 63819
209
  • 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?
 
Sheriff
Posts: 5813
150
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: 336
  • 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: 336
  • 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: 336
  • 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: 336
  • 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
 



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

Tim Moores wrote:I guess it's too late now, but https://coderanch.com/wiki/660363/Ant-Task contains a simple Ant task written in Java.

The lesson might be to search the FAQ before asking questions



Better late than nevever, but who will bell the cat!!!

Hi
The ant build file is helpless inspite of all the precautions duly
adhered thus leaving for any body who can give some shape
to make the java prog execute its task.to offer my bonus
Thanks

The details are as under viz., buildfile,java prg and the succesful out put

with a minute error


As
CRMK


 
He baked a muffin that stole my car! And this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!