• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

check out from svn using ant

 
Ranch Hand
Posts: 226
1
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have just starting to explore ant to automate my build.

In my mind, the first thing to do for a build is to checkout the latest source version from the repository (svn in my case). However I have found the documentation scant on this.

I have been able to get the ant executable below to work, however the web advice from which this is derived said that executables are best avoided.

So my questions are
1) is it normal to commence a build by checking the source out of the repository?
2) if so, is there a better way then using an ant executable?


Thanks

Marten


 
author & internet detective
Posts: 41125
848
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it is normal to start a build by checking out the code from the repository.

You are using the SVN executable in your example (not the Ant executable) via Ant's exec task. That's one way of doing it. The other way is to use the SVN Ant task. I used the command line SVN in my Ant builds - that approach is certainly viable.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The other possibility is using a continuous integration tool, such as Jenkins, to check out the sources from Subversion and it starts Ant to do the build. Besides, isn't the Ant script in the project's base directory and thus to get the script you have to first check out the project?
 
Jeanne Boyarsky
author & internet detective
Posts: 41125
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:Besides, isn't the Ant script in the project's base directory and thus to get the script you have to first check out the project?


For me, it wasn't. We had a generic script that got passed the the projects that it needed to pull. Even if the project is checked out, it might not be the latest copy.
 
marten koomen
Ranch Hand
Posts: 226
1
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne, Thanks Peter

So, I have
1) checked my version of svn as 1.8.0
2) downloaded SvnAnt 1.3.x which is bound against subversion 1.6.x, but there is no 1.8.x available
3) unzipped svnant-1.3.1.zip into my ant/lib folder
4) put the following in my build file


5) and get the following message:
BUILD FAILED
C:\Users\USER\Desktop\antrproject\build.xml:12: Problem: failed to create task or type svn
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Any clues? I find this all a little bit secret java business.

Thanks

Marten

PS also tried adding to the build.xml the following line, but not sure what it means and it doesn't work



I have my svn ant in "C:\ant\apache-ant-1.9.3-bin\apache-ant-1.9.3\lib\svnant.jar" ... to which I changed my classpathref but it still doesn't work
 
marten koomen
Ranch Hand
Posts: 226
1
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I finally got it to work, although it doesn't seem very best practice



The respponse is
 
marten koomen
Ranch Hand
Posts: 226
1
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For information - this does it



Thanks again
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic