You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by blackwater dev <bl...@gmail.com> on 2005/02/18 19:46:23 UTC

cvs checkout

I am using the cvs task:

<cvs cvsRoot="/home/dev/"
         package="pollywog"
       dest="web/package/"
  />

The problem is, when I check it out..I get web/package/pollywog...etc
but I want to grab all of the files under pollywog but not the actual
root folder of pollywog...can I specify this in the task?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re[2]: import question

Posted by Andrew Solonchuk <so...@ibis.ua>.
> Andrew, from my not so extensive usage of <import> I
> know that targets in the importee overload targets in
> imported. It is like extending a class in Java and
> calling a method defined in the base class results in
> a call to a method in the child class. (The imported
> is like a base class and the importee is like a child
> class).

> You can however do what you want. You have to rewrite
> project name="imported-test" like this:
> <project name="imported-test" default="imported"
basedir=".">>
>  <target name="imported" depends="imported-test.test"
>>
>     <echo message="In imported target" />
>   </target>
>   <target name="test">
>      <echo message="target 'test' in imported-test
progect" />>
>   </target>
> </project>
Yes, I tried this and it's work, but if I want to use project
"imported-test" as standalone project it say
"Target `imported-test.test' does not exist in this project. It is
used from target `imported'." I think it's not good and maybe a bug.

And i dont want switch off target overriding, but I think if some
project has target depends on another target it must be from the same
project.

I have N small build files(projects) and one common. In common project
I call <ant buildfile="xxx" target="all">

in small projects i have target
 <target name="all" depends="target1,target2,target2"/>

and in describing by you behaviour of ANT I need look thru all
importing projects to find if they have some target with the same name,
and I think this is not logically. (In c++ or java I have keywords as
"virtual" or "protect" or "abstract" ) to avoid those
misunderstandings in _runtime_. So I dont agree with you that
importing look like extends in java, It more look like include in @c@.

> Please, note the depends clause of target
> name="imported". It states that it depends on target
> test in a project named imported-test, i.e. on "test"
> target in imported.xml. You could read this in [1],
> section Target Overriding.

> I am curious why you want to switch off target
> overriding. I am writing some ant scripts for our
> project and use it quite a lot to reuse code.

> HTH Ivan

> [1]http://ant.apache.org/manual/CoreTasks/import.html
> --- Andrew Solonchuk <so...@ibis.ua> wrote:

>> 
>> Hi I've tested <import> for using in my build file
>> and don't
>> understood some thing
>> 
>> if i have
>> <project name="import-test" default="main"
>> basedir=".">
>>   <import file="imported.xml"/>
>>   <target name="main">
>>     <echo message="In main"/>
>>     <antcall target="imported"/>
>>   </target>
>>   <target name="test">
>>      <echo message="target 'test' in import-test
>> progect" />
>>   </target>
>> </project>
>> 
>> <project name="imported-test" default="imported"
>> basedir=".">
>>   <target name="imported" depends="test" >
>>     <echo message="In imported target" />
>>   </target>
>>   <target name="test">
>>      <echo message="target 'test' in imported-test
>> progect" />
>>   </target>
>> </project>
>> 
>> I have output
>> Buildfile: import.xml
>> main:
>>      [echo] In main
>> test:
>>      [echo] target 'test' in import-test progect
>> imported:
>>      [echo] In imported target
>> 
>> 
>> But I need if target name="imported" depends="test"
>> to be executed
>> "test" from file where demends where declared,...
>> not having
>> overloading target.
>> 
>> How to do that? or import is simply include and not
>> more?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: import question

Posted by Ivan Ivanov <ra...@yahoo.com>.
Andrew, from my not so extensive usage of <import> I
know that targets in the importee overload targets in
imported. It is like extending a class in Java and
calling a method defined in the base class results in
a call to a method in the child class. (The imported
is like a base class and the importee is like a child
class).

You can however do what you want. You have to rewrite
project name="imported-test" like this:
<project name="imported-test" default="imported"
basedir=".">
 <target name="imported" depends="imported-test.test"
>
    <echo message="In imported target" />
  </target>
  <target name="test">
     <echo message="target 'test' in imported-test
progect" />
  </target>
</project>

Please, note the depends clause of target
name="imported". It states that it depends on target
test in a project named imported-test, i.e. on "test"
target in imported.xml. You could read this in [1],
section Target Overriding.

I am curious why you want to switch off target
overriding. I am writing some ant scripts for our
project and use it quite a lot to reuse code.

HTH Ivan

[1]http://ant.apache.org/manual/CoreTasks/import.html
--- Andrew Solonchuk <so...@ibis.ua> wrote:

> 
> Hi I've tested <import> for using in my build file
> and don't
> understood some thing
> 
> if i have
> <project name="import-test" default="main"
> basedir=".">
>   <import file="imported.xml"/>
>   <target name="main">
>     <echo message="In main"/>
>     <antcall target="imported"/>
>   </target>
>   <target name="test">
>      <echo message="target 'test' in import-test
> progect" />
>   </target>
> </project>
> 
> <project name="imported-test" default="imported"
> basedir=".">
>   <target name="imported" depends="test" >
>     <echo message="In imported target" />
>   </target>
>   <target name="test">
>      <echo message="target 'test' in imported-test
> progect" />
>   </target>
> </project>
> 
> I have output
> Buildfile: import.xml
> main:
>      [echo] In main
> test:
>      [echo] target 'test' in import-test progect
> imported:
>      [echo] In imported target
> 
> 
> But I need if target name="imported" depends="test"
> to be executed
> "test" from file where demends where declared,...
> not having
> overloading target.
> 
> How to do that? or import is simply include and not
> more?
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


import question

Posted by Andrew Solonchuk <so...@ibis.ua>.
Hi I've tested <import> for using in my build file and don't
understood some thing

if i have
<project name="import-test" default="main" basedir=".">
  <import file="imported.xml"/>
  <target name="main">
    <echo message="In main"/>
    <antcall target="imported"/>
  </target>
  <target name="test">
     <echo message="target 'test' in import-test progect" />
  </target>
</project>

<project name="imported-test" default="imported" basedir=".">
  <target name="imported" depends="test" >
    <echo message="In imported target" />
  </target>
  <target name="test">
     <echo message="target 'test' in imported-test progect" />
  </target>
</project>

I have output
Buildfile: import.xml
main:
     [echo] In main
test:
     [echo] target 'test' in import-test progect
imported:
     [echo] In imported target


But I need if target name="imported" depends="test" to be executed
"test" from file where demends where declared,... not having
overloading target.

How to do that? or import is simply include and not more?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: cvs checkout

Posted by Bijo Alex Thomas <bi...@dsrc.co.in>.
I don't know how relevant it is now, but this is a way

<cvs
  cvsRoot="/home/dev/"
  package="pollywog"
  dest="httpd"
  command="checkout -d htdocs"/>

Regards, 
Bijo 

_________________________________ 
Bijo Alex Thomas 
DSRC, 6, Smith Road, Chennai - 2 
Mail: bijoalex@dsrc.co.in 
Website: http://dsrc.com 


----- Original Message ----- 
From: "Yves Martin" <yv...@elca.ch>
To: "blackwater dev" <bl...@gmail.com>
Cc: "Ant Users List" <us...@ant.apache.org>
Sent: Tuesday, February 22, 2005 12:55 PM
Subject: Re: cvs checkout


> blackwater dev <bl...@gmail.com> writes:
> 
> > Yes but this still creates the pollywog main directory...for example,
> > I have a project in cvs named pollywog.  I want to check out it's
> > contents to the root of apache so I would use:
> >
> >  <cvs
> >    cvsRoot="/home/dev/"
> >    package="pollywog"
> >    dest="httpd/htdocs"
> >    command="checkout -d pollywog"/>
> >
> >
> > After this checkout, I have httpd/htdocs/pollywog which is what I
> > don't want...I don't want the top level pollywog directory, just want
> > all if it's contents checked out to htdocs.




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: cvs checkout

Posted by Yves Martin <yv...@elca.ch>.
blackwater dev <bl...@gmail.com> writes:

> Yes but this still creates the pollywog main directory...for example,
> I have a project in cvs named pollywog.  I want to check out it's
> contents to the root of apache so I would use:
>
>  <cvs
>    cvsRoot="/home/dev/"
>    package="pollywog"
>    dest="httpd/htdocs"
>    command="checkout -d pollywog"/>
>
>
> After this checkout, I have httpd/htdocs/pollywog which is what I
> don't want...I don't want the top level pollywog directory, just want
> all if it's contents checked out to htdocs.

 Sorry - my answer was silly, I have not realized it changes nothing.

 You may create a CVS alias in CVSROOT/modules like this:
   pollywog-htdocs   -d  htdocs  pollywog

 Now you have to write:
 <cvs
   cvsRoot="/home/dev/"
   package="pollywog-htdocs"
   dest="httpd"/>


 If it does not suit you neither, you have to list the content of 'pollywog' in
 a CVS alias (suppose pollywog contains directories A, B and C):

  pollywog-content   -a   pollywog-A
                          pollywog-B
                          pollywog-C
  pollywog-A         -d   A      pollywog/A
  pollywog-B         -d   B      pollywog/A
  pollywog-C         -d   C      pollywog/A

 Now the following command will work as you expects (I hope so):
 <cvs
   cvsRoot="/home/dev/"
   package="pollywog-content"
   dest="httpd/htdocs"/>

 But of course, you have maintenance to do on CVSROOT/modules when a directory
 appears or goes out.  I have no better solution to propose you.

 For more details, please report the CVS documentation about CVSROOT/modules.
 Regards
-- 
Yves Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: cvs checkout

Posted by blackwater dev <bl...@gmail.com>.
Yes but this still creates the pollywog main directory...for example,
I have a project in cvs named pollywog.  I want to check out it's
contents to the root of apache so I would use:

 <cvs
   cvsRoot="/home/dev/"
   package="pollywog"
   dest="httpd/htdocs"
   command="checkout -d pollywog"/>


After this checkout, I have httpd/htdocs/pollywog which is what I
don't want...I don't want the top level pollywog directory, just want
all if it's contents checked out to htdocs.

Thanks!

On Mon, 21 Feb 2005 13:08:28 +0100, Yves Martin <yv...@elca.ch> wrote:
> blackwater dev <bl...@gmail.com> writes:
> 
> > I am using the cvs task:
> >
> > <cvs cvsRoot="/home/dev/"
> >          package="pollywog"
> >        dest="web/package/"
> >   />
> >
> > The problem is, when I check it out..I get web/package/pollywog...etc
> > but I want to grab all of the files under pollywog but not the actual
> > root folder of pollywog...can I specify this in the task?
> 
>  You should invoke cvs that way:
> 
> <cvs
>   cvsRoot="/home/dev/"
>   package="pollywog"
>   dest="web/package/"
>   command="checkout -d pollywog"/>
> 
>  Regards,
> --
> Yves Martin
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: cvs checkout

Posted by Yves Martin <yv...@elca.ch>.
blackwater dev <bl...@gmail.com> writes:

> I am using the cvs task:
>
> <cvs cvsRoot="/home/dev/"
>          package="pollywog"
>        dest="web/package/"
>   />
>
> The problem is, when I check it out..I get web/package/pollywog...etc
> but I want to grab all of the files under pollywog but not the actual
> root folder of pollywog...can I specify this in the task?

 You should invoke cvs that way:

<cvs 
  cvsRoot="/home/dev/" 
  package="pollywog" 
  dest="web/package/"
  command="checkout -d pollywog"/>

 Regards,
-- 
Yves Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org