Link to home
Start Free TrialLog in
Avatar of Saggi
Saggi

asked on

How to write a Build Script for .Net Web Service application using Ant tool?

I have C# .Net Web service and I need write a Build script using Ant tool. Iam new to this build script and Ant tool, appeciate if you can elaborate and explain the steps that needs to be done.
Avatar of Saggi
Saggi

ASKER

Can any one respond to my question please

Evilrix:    Please add the relative zones for my question or suggest me the appropriate zones to add.
Hm.

Now - the problem is that ANT is not exactly .NET friendly... why do you want to do it with ANT?

You can use http://ant.apache.org/antlibs/dotnet/ I suspect (never used it though) and http://nant.sourceforge.net/ is usually the way to go if you want ant-like stuff (had used it a few times in the past).

So let's take a step back and see what you need - why ANT?
Avatar of Saggi

ASKER

We already had the ANT build script for vc++ application, now we have new application in C#.net which we need a build script.

I have started writing the build script to get the code from SVN and build it, Iam getting the below error:
Poblem: 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.

Below is the script:
  <project name="IWRS" default="build" basedir=".">
  <description>IWRS Build</description>
  <!--  set global properties for this build
  -->
  <property name="svnant.IWRS.url" value="path of code" />
  <property name="basedir" value="C:\IWRS" />
  <property name="svnant.repository.user" value="UID" />
  <property name="svnant.repository.passwd" value="PWD" />
  <path id="svnant.classpath">
  <fileset dir="C:\software\apache-ant-1.8.0-bin\apache-ant-1.8.0\lib">
  <include name="**/*.jar" />
  </fileset>
  </path>
  <!--   load the svn task
  -->
  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
  <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
  <target name="getLatest">
  <echo message="Getting latest from SVN into directory ${basedir}." />
  <svn username="${svnant.repository.user}" password="${svnant.repository.passwd}">
  <checkout url="${svnant.IWRS.url}" revision="HEAD" destPath="C:\IWRS" />
  </svn>
  </target>
- <target name="build">
  <antcall target="getLatest" />
  </target>
  </project>
Avatar of Saggi

ASKER

prior to mentioned above error it has:
build:
  [typedef] Could not load definitions from resource org/tigris/subversion/svnan
t/svnantlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontri
b.properties. It could not be found.
Because it looks like ANT cannot find it - and your latest message confirms it.
Avatar of Saggi

ASKER

I do have SVN installed in my machine but I think class is not set with ANT, How to set/verify?
Also can you please tell me what  "http://subclipse.tigris.org/svnant.html" in my machine?
Avatar of Saggi

ASKER

It looks like SVN ANT lib (jar) files should be placed!
SOLUTION
Avatar of Venabili
Venabili
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> It looks like SVN ANT lib (jar) files should be placed!

If you mean that you should have them - yes, that is why I asked if you have the library.
Avatar of Saggi

ASKER

When I build the solution from script Iam getting error for one project ".vdproj error MSB4025 The project file could not be loaded. Data at root level is invalid".

It works fine If I build from VS2005 editor.?
That's an MSBuild error -- so I suspect it is something in the way ant is calling and/or using it in a task.

What kind of project is that? Can you post your build script now?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial