Alexander,

An even better solution would be to turn this into a function.

Gert
----- Original Message -----
From: "Alexander Korchemny" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Alexander Korchemny" <[EMAIL PROTECTED]>
Sent: Wednesday, July 21, 2004 9:06 AM
Subject: [Nant-users] Possible solution for the VSS project work folder in
the Nant project


Hi all,

Here's below the possible solution i've made for the problem mentioned in my
previously sent question
(http://www.mail-archive.com/nant-users%40lists.sourceforge.net/msg03839.htm
l) :

I have a nant build file with a couple of targets. One of them needs the
certain VSS project work folder. Sure, i can define this folder in one of
the nant project properties, i.e. to make it hard coded. But i don't want to
get it in that way. Instead, i want to get the work folder from the VSS
project itself. The VSS project is the IVSSItem object of the
SourceSafeTypeLib library. Its work folder is stored in the LocalSpec
properties of the IVSSItem object.

I've added the following task to the NantContrib:

using System;
using System.Collections;
using SourceSafeTypeLib;
using NAnt.Core;
using NAnt.Core.Types;
using NAnt.Core.Attributes;

namespace NAnt.Contrib.Tasks.SourceSafe {
    [TaskName("workfold")]
    public sealed class GetWorkFolder : BaseTask
    {
 protected override void ExecuteTask()
 {
  Open();

  PropertyDictionary pd = Project.Properties;
  pd.Add("work_fold","initial");
  pd.SetValue("work_fold",Item.LocalSpec.ToString());
 }
    }
}

Then in my nant project i call the workfold task in the get_work_fold target
and get the certain VSS project work folder in the work_fold nant project
property:

<?xml version="1.0"?>

<project name="test" default="build">

 <property name="vss_dbpath" value="C:\Program Files\Microsoft Visual
Studio\Common\VSS\srcsafe.ini"/>
 <property name="test_project" value="vss_test"/>
 <property name="basename" value="test.vbg"/>

 <target name="get_work_fold">
  <loadtasks assembly="${nant.dir}\NAnt.Contrib.Tasks.dll"/>
  <workfold dbpath="${vss_dbpath}" path="$/${vss_project}" user=""/>
 </target>

 <target name="build" depends="get_work_fold">
  <loadtasks assembly="${nant.dir}\NAnt.Contrib.Tasks.dll"/>
  <vb6
   project="${work_fold}\${basename}"
   outdir="${work_fold}\test_build"
  />
 </target>

</project>

Is there another simplest solution?

Any comments about this solution are welcome and will be very much
appreciated.

Thank you.

Regards,
AlexK




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to