Frage

Using ant through eclipse. What I'm trying to do is to add files or subdirectories to a module that already exists in the repository.

The problem is that I do not know (or shouldn't) what kind of files or subdirectories the script is going to find in the previously checked-out module.

Checksout module -> Modifies it (adding files, subsdirs) -> Add that module to the control version -> Commits

I'm making an approach like this:

<target name="checkout" >

    <cvs cvsrsh="plink" cvsroot="${cvsroot}" package="${mymodule}" dest="${extract.dir}" command="checkout"/>

</target>


<target name="cvs_add" >

    <cvs cvsrsh="plink" cvsroot="${cvsroot}"  package="${mymodule}" dest="${extract.dir}" command="add -kb"/>

</target>

And getting this message:

[cvs] cvs add: in directory .:
[cvs] cvs [add aborted]: there is no version here; do 'cvs checkout' first

I also tried using ant-contrib's 'foreach', in order to navigate between files and subdirs, also not working.

I'd love a non-ant-contrib advice in this matter, or something not related with exec task. But I'm open minded.

War es hilfreich?

Lösung

I have came up with this solution:

    <ac:for param="file">

        <path>
            <fileset dir="${mymodule}">
                <!-- <include name="**/*.jar"/> -->
            </fileset>
        </path>

        <sequential>

            <local name="filename" />
            <basename property="filename" file="@{file}"/>
            <echo message="${filename}"/>
            <cvs cvsrsh="plink" cvsroot="${cvsroot}" dest="${mymodule}" command="add -kb ${filename}"/>

        </sequential>

    </ac:for>   

I finally surrender to ant-contrib. If anyone make a different approach, let me know.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top