Oh, great thx, xmlpeek is may be solution, I will think about use file
for every propery and use load into propertie, xml file is better
solution and may be the boot.build is better for me. I can prepare all
stuff properies and so for main build and than do thinks like before.

Many many thanks.

Best regards Ales.


Bob Archer napsal(a):
> Oh right... I didn't think of that. So, you have 3 build files...
>
> boot.build <- run the exec to generate rev.build
> rev.source <- the template file for rev.source
> main.build <- your primary build file which has an include rev.build at the 
> top.
>
> So, you start your build calling boot.build. It runs the exec that creates 
> rev.build. Then it uses the nant task to run mail.build. You can pass the 
> target you want boot.build to run in main.build by having a property.
>
> Another option rather than the above and probably better is to just have 
> rev.xml.template and create rev.xml using the exec as your are but make it a 
> POX (plain old XML) file. Then use XML peek to grab the values and put them 
> into your properties. This way you don't need the boot.build indirection 
> stiff.
>
> BOb
>
>
>   
>> -----Original Message-----
>> From: Ales Vojacek [mailto:al...@fbl.cz]
>> Sent: Friday, August 28, 2009 10:35 AM
>> To: Bob Archer
>> Cc: nant-users@lists.sourceforge.net
>> Subject: Re: [NAnt-users] Nant properties Evaluation
>>
>> Yes that is what I want to do, but include is not possible to do inside
>> target and I cannot to do that on top of build file since the file does
>> not exists.
>> A.
>>
>> Bob Archer napsal(a):
>>     
>>>> Bob Archer napsal(a):
>>>>
>>>>         
>>>>>> Hi all,
>>>>>> I have another problem.
>>>>>> I have nant build script which uses subwcrev, which take revision,
>>>>>>
>>>>>>             
>>>> last
>>>>
>>>>         
>>>>>> date change and so from svn and use this for replace some strings
>>>>>>             
>> in
>>     
>>>>>> file.
>>>>>> I use this way.
>>>>>> I have source file named rev.source like this :
>>>>>> <?xml version="1.0"?>
>>>>>> <project xmlns="http://nant.sf.net/release/0.85/nant.xsd";
>>>>>> default="SetProp" name="MarkGetProp" >
>>>>>>   <target name="SetProp">
>>>>>>     <property name="revisionXSLTemplates" value="$WCREV$" />
>>>>>>     <property name="revisionXSLTemplatesDate"
>>>>>> value="$WCDATE=%Y%m%d%H%M$" />
>>>>>>     <property name="revisionXSLTemplatesDateString"
>>>>>>             
>> value="$WCDATE$"
>>     
>>>> />
>>>>
>>>>         
>>>>>>   </target>
>>>>>> </project>
>>>>>> Nant build use subwcrev on that file:
>>>>>> <exec program="${subwcrev}" commandline="${SourceCodeDir}
>>>>>>             
>> rev.source
>>     
>>>>>> rev.build" />
>>>>>> So now I have build file which looks like :
>>>>>> <?xml version="1.0"?>
>>>>>> <project xmlns="http://nant.sf.net/release/0.85/nant.xsd";
>>>>>> default="SetProp" name="MarkGetProp" >
>>>>>>   <target name="SetProp">
>>>>>>     <property name="revision" value="35172" />
>>>>>>     <property name="revisionDate" value="200908271759" />
>>>>>>     <property name="revDateString" value="2009/08/27 17:59:32" />
>>>>>>   </target>
>>>>>> </project>
>>>>>> I cannot include that file in my build beacause on build script
>>>>>>
>>>>>>             
>>>> statrs
>>>>
>>>>         
>>>>>> file rev.build does not exists yet.
>>>>>> So I try to use
>>>>>> <nant buildfile="rev.build" />
>>>>>> in my build task, but there is a problem, nant will ends with this
>>>>>> error:
>>>>>> Property 'revisionDate' has not been set.
>>>>>>
>>>>>> Can you help me with that?
>>>>>>
>>>>>> A.
>>>>>>
>>>>>>
>>>>>>             
>>>>> Are you sure you have the namespace specified in all the build
>>>>>           
>> files?
>>     
>>>>> BOb
>>>>>
>>>>>           
>>>> Yes I have
>>>>
>>>> xmlns="http://nant.sf.net/release/0.85/nant.xsd";
>>>> in all files, but the projcet name is not same, anyway if I set same
>>>> name of project id works same.
>>>> I saw on Inet some sort of problems with namespaces in 0.86, but I
>>>>         
>> have
>>     
>>>> it in all files and It is same.
>>>> May be the problem is that after nant task (<nant
>>>>         
>> buildfile="rev.build"
>>     
>>>> />) is that file unloaded,as you wrote before, but I cannot know how
>>>>         
>> to
>>     
>>>> make it another way.
>>>>
>>>>         
>>> Ok,
>>>
>>> So, let me walk through what I would do and you tell me what you are
>>>       
>> doing different. I am not quite understanding what you are saying...
>>     
>>> In your build file say main.build you have the following code:
>>>
>>>
>>> <exec program="${subwcrev}" commandline="${SourceCodeDir} rev.source
>>>       
>> rev.build" />
>>     
>>> Then you should do:
>>>
>>> <include buildfile="rev.build" />
>>>
>>> From that point on the three properties set in the rev.build file
>>>       
>> will be available to main.build.
>>     
>>> BOb
>>>
>>>
>>>       

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to