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.
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?
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?
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.us er" value="UID" />
<property name="svnant.repository.pa sswd" value="PWD" />
<path id="svnant.classpath">
<fileset dir="C:\software\apache-an t-1.8.0-bi n\apache-a nt-1.8.0\l ib">
<include name="**/*.jar" />
</fileset>
</path>
<!-- load the svn task
-->
<typedef resource="org/tigris/subve rsion/svna nt/svnantl ib.xml" classpathref="svnant.class path" />
<taskdef resource="net/sf/antcontri b/antcontr ib.propert ies" />
<target name="getLatest">
<echo message="Getting latest from SVN into directory ${basedir}." />
<svn username="${svnant.reposit ory.user}" password="${svnant.reposit ory.passwd }">
<checkout url="${svnant.IWRS.url}" revision="HEAD" destPath="C:\IWRS" />
</svn>
</target>
- <target name="build">
<antcall target="getLatest" />
</target>
</project>
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.us
<property name="svnant.repository.pa
<path id="svnant.classpath">
<fileset dir="C:\software\apache-an
<include name="**/*.jar" />
</fileset>
</path>
<!-- load the svn task
-->
<typedef resource="org/tigris/subve
<taskdef resource="net/sf/antcontri
<target name="getLatest">
<echo message="Getting latest from SVN into directory ${basedir}." />
<svn username="${svnant.reposit
<checkout url="${svnant.IWRS.url}" revision="HEAD" destPath="C:\IWRS" />
</svn>
</target>
- <target name="build">
<antcall target="getLatest" />
</target>
</project>
ASKER
prior to mentioned above error it has:
build:
[typedef] Could not load definitions from resource org/tigris/subversion/svna n
t/svnantlib.xml. It could not be found.
[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontr i
b.properties. It could not be found.
build:
[typedef] Could not load definitions from resource org/tigris/subversion/svna
t/svnantlib.xml. It could not be found.
[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontr
b.properties. It could not be found.
Do you have http://subclipse.tigris.org/svnant.html in the system?
Because it looks like ANT cannot find it - and your latest message confirms it.
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?
Also can you please tell me what "http://subclipse.tigris.org/svnant.html" in my machine?
ASKER
It looks like SVN ANT lib (jar) files should be placed!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> 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.
If you mean that you should have them - yes, that is why I asked if you have the library.
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.?
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?
What kind of project is that? Can you post your build script now?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Evilrix: Please add the relative zones for my question or suggest me the appropriate zones to add.