You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Robert Smith <rs...@comnitel.com> on 2004/03/08 21:29:50 UTC

Any interest in a remote Ant server?

Hi all,

I've written an add-on for Ant that allows for remote builds. It consists of
an RMI based server application and a handful of custom Ant tasks on the
client side. My motivation for this was to allow C/C++ code to be built on
remote machines for multiple architectures from the comfort of the
developer's Eclipse IDE on Windows. I tried Rant, but found it too limiting,
so I've done my own version, complete with file transfers and synchronous
logging (which took some work to make it all serialize/deserialize properly
across RMI!)

Now that I've got it working, the question is, what do I do with it? Is
there even any interest out there for such a thing? Who should I talk to at
apache? Should I just throw it up on my own web page?

Here's how it works from the user's perspective. Please let me know how to
proceed. By the way, I have a new set of Ant tasks for Eclipse that allow
you to use the .classpath file from inside *or* outside the IDE. I needed
this to allow our continuous integration server to use the same build
process as the developer's IDE. Any interest there?

Cheers,

Robert

---------------------------------------

Successful build log from client:


Buildfile: C:\Program Files\eclipse\workspace\RemoteAnt2\build.xml

c-all:
        [echo] Begining remote build
[createSession] Created remote session: clare:192.168.1.97:20042872453
    [putFiles] Transfering 1 files to clare
    [putFiles] Transfering 3 files to clare
 [remoteBuild] Building on clare using SolarisCBuild.xml

clare.test:
  [clare.echo] Building C code for Sun Sparc Solaris
    [clare.cc] 2 total files to be compiled.
    [clare.cc] Starting link

c-all:
     [getFile] Recieving ctjava from clare
     [getFile] Copied ctjava from clare to C:\Program
Files\eclipse\workspace\RemoteAnt2/Configuration/bin/ctjava
[closeSession] Session clare:192.168.1.97:20042872453 closed.
BUILD SUCCESSFUL
Total time: 11 seconds


-----------------------------------------


Failed build log from client:

Buildfile: C:\Program Files\eclipse\workspace\RemoteAnt2\build.xml

c-all:
        [echo] Begining remote build
[createSession] Created remote session: clare:192.168.1.97:2004287186
    [putFiles] Transfering 1 files to clare
    [putFiles] Transfering 3 files to clare
 [remoteBuild] Building on clare using SolarisCBuild.xml

clare.test:
  [clare.echo] Building C code for Sun Sparc Solaris
    [clare.cc] 2 total files to be compiled.
BUILD FAILED: /tmp/builds/192.168.1.97/2004287186/SolarisCBuild.xml:6: Could
not launch gcc: java.io.IOException: gcc: not found
BUILD FAILED: file:C:/Program
Files/eclipse/workspace/RemoteAnt2/build.xml:89: Build failed on host clare.
Total time: 8 seconds


-----------------------------------------


Failed build log from server:


0    [main] INFO  com.rjmpsmith.ant.RemoteAntServer  - Starting server on
host clare port 2020.
1641 [main] INFO  com.rjmpsmith.ant.RemoteAntServer  - Bound
rmi://clare:2020/RemoteBuildServices
10439 [RMI TCP Connection(2)-192.168.1.97] INFO
com.rjmpsmith.ant.RemoteBuildServices  - Created remote session:
clare:192.168.1.97:200428713
10606 [RMI TCP Connection(2)-192.168.1.97] DEBUG
com.rjmpsmith.ant.RemoteBuildServices  - Recieving
/tmp/builds/192.168.1.97/200428713/SolarisCBuild.xml
10840 [RMI TCP Connection(2)-192.168.1.97] DEBUG
com.rjmpsmith.ant.RemoteBuildServices  - Recieving
/tmp/builds/192.168.1.97/200428713/c/ctjava/src/ctext.c
10858 [RMI TCP Connection(2)-192.168.1.97] DEBUG
com.rjmpsmith.ant.RemoteBuildServices  - Recieving
/tmp/builds/192.168.1.97/200428713/c/ctjava/src/ctext.h
10876 [RMI TCP Connection(2)-192.168.1.97] DEBUG
com.rjmpsmith.ant.RemoteBuildServices  - Recieving
/tmp/builds/192.168.1.97/200428713/c/ctjava/src/ctjexec.c
10903 [RMI TCP Connection(2)-192.168.1.97] INFO
com.rjmpsmith.ant.RemoteBuildServices  - Beggining Ant build for session
clare:192.168.1.97:200428713 using SolarisCBuild.xml
17602 [RMI TCP Connection(2)-192.168.1.97] ERROR
com.rjmpsmith.ant.RemoteBuildServices  - Build failed for session
clare:192.168.1.97:200428713
/tmp/builds/192.168.1.97/200428713/SolarisCBuild.xml:6: Could not launch
gcc: java.io.IOException: gcc: not found
        at net.sf.antcontrib.cpptasks.CUtil.runCommand(CUtil.java:476)
        at
net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler.runCommand(CommandLi
neCompiler.java:269)
        at
net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler.compile(CommandLineC
ompiler.java:226)

-----------------------------------------

Ant task usage:


    <!--========================================-->
    <!--=                 c-all                =-->
    <!--========================================-->

    <target name="c-all"
            description="Build C code for Sun Solaris">
        <property name="remotebuild.c.solaris.host" value="clare"/>
        <property name="remotebuild.c.solaris.port" value="2020"/>

        <taskdef resource="remoteant.taskdefs" classpath="classes"/>

        <echo message="Begining remote build"/>

        <createSession host="${remotebuild.c.solaris.host}" 
                       port="${remotebuild.c.solaris.port}" 
                       property="session.c.solaris"/>

        <putFiles session="${session.c.solaris}">
            <fileset dir="cfg">
                    <include name="SolarisCBuild.xml"/>
            </fileset>
            <fileset dir="${basedir}"
                     includes="**/c/**"
                     excludes="**/Makefile"/>
        </putFiles>
                    
        <remoteBuild session="${session.c.solaris}" 
                     buildfile="SolarisCBuild.xml"
                     targets="test"/>
                
        <getFile session="${session.c.solaris}" 
                 remoteFile="ctjava"
                 localFile="${basedir}/Configuration/bin/ctjava"/>
                
        <closeSession session="${session.c.solaris}"/>
    </target>




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


Re: Any interest in a remote Ant server?

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 09 Mar 2004, Steve Loughran <st...@iseran.com> wrote:

> I also think it could be one of the first subsidiary projects we
> host on the Ant site;

Sounds good.

> with its own cvs tree,

I'd prefer subversion, then.

Stefan

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


Re: Any interest in a remote Ant server?

Posted by Steve Loughran <st...@iseran.com>.
Robert Smith wrote:

This is very cool. another trick is that it should let you fork ant on 
the same machine, running stuff with isolation.

I do think it would be a valuable contribution to the codebase. I also 
think it could be one of the first subsidiary projects we host on the 
Ant site; with its own cvs tree, own redistributable and own release 
cycle. That would also mean we could let everyone who wants to work with 
it get write access to the project with relative ease. I'd work on it 
sporadically too.

-steve



> Hi all,
> 
> I've written an add-on for Ant that allows for remote builds. It consists of
> an RMI based server application and a handful of custom Ant tasks on the
> client side. My motivation for this was to allow C/C++ code to be built on
> remote machines for multiple architectures from the comfort of the
> developer's Eclipse IDE on Windows. I tried Rant, but found it too limiting,
> so I've done my own version, complete with file transfers and synchronous
> logging (which took some work to make it all serialize/deserialize properly
> across RMI!)
> 
> Now that I've got it working, the question is, what do I do with it? Is
> there even any interest out there for such a thing? Who should I talk to at
> apache? Should I just throw it up on my own web page?
> 
> Here's how it works from the user's perspective. Please let me know how to
> proceed. By the way, I have a new set of Ant tasks for Eclipse that allow
> you to use the .classpath file from inside *or* outside the IDE. I needed
> this to allow our continuous integration server to use the same build
> process as the developer's IDE. Any interest there?
> 
> Cheers,
> 
> Robert
> 
> ---------------------------------------
> 
> Successful build log from client:
> 
> 
> Buildfile: C:\Program Files\eclipse\workspace\RemoteAnt2\build.xml
> 
> c-all:
>         [echo] Begining remote build
> [createSession] Created remote session: clare:192.168.1.97:20042872453
>     [putFiles] Transfering 1 files to clare
>     [putFiles] Transfering 3 files to clare
>  [remoteBuild] Building on clare using SolarisCBuild.xml
> 
> clare.test:
>   [clare.echo] Building C code for Sun Sparc Solaris
>     [clare.cc] 2 total files to be compiled.
>     [clare.cc] Starting link
> 
> c-all:
>      [getFile] Recieving ctjava from clare
>      [getFile] Copied ctjava from clare to C:\Program
> Files\eclipse\workspace\RemoteAnt2/Configuration/bin/ctjava
> [closeSession] Session clare:192.168.1.97:20042872453 closed.
> BUILD SUCCESSFUL
> Total time: 11 seconds
> 
> 
> -----------------------------------------
> 
> 
> Failed build log from client:
> 
> Buildfile: C:\Program Files\eclipse\workspace\RemoteAnt2\build.xml
> 
> c-all:
>         [echo] Begining remote build
> [createSession] Created remote session: clare:192.168.1.97:2004287186
>     [putFiles] Transfering 1 files to clare
>     [putFiles] Transfering 3 files to clare
>  [remoteBuild] Building on clare using SolarisCBuild.xml
> 
> clare.test:
>   [clare.echo] Building C code for Sun Sparc Solaris
>     [clare.cc] 2 total files to be compiled.
> BUILD FAILED: /tmp/builds/192.168.1.97/2004287186/SolarisCBuild.xml:6: Could
> not launch gcc: java.io.IOException: gcc: not found
> BUILD FAILED: file:C:/Program
> Files/eclipse/workspace/RemoteAnt2/build.xml:89: Build failed on host clare.
> Total time: 8 seconds
> 
> 
> -----------------------------------------
> 
> 
> Failed build log from server:
> 
> 
> 0    [main] INFO  com.rjmpsmith.ant.RemoteAntServer  - Starting server on
> host clare port 2020.
> 1641 [main] INFO  com.rjmpsmith.ant.RemoteAntServer  - Bound
> rmi://clare:2020/RemoteBuildServices
> 10439 [RMI TCP Connection(2)-192.168.1.97] INFO
> com.rjmpsmith.ant.RemoteBuildServices  - Created remote session:
> clare:192.168.1.97:200428713
> 10606 [RMI TCP Connection(2)-192.168.1.97] DEBUG
> com.rjmpsmith.ant.RemoteBuildServices  - Recieving
> /tmp/builds/192.168.1.97/200428713/SolarisCBuild.xml
> 10840 [RMI TCP Connection(2)-192.168.1.97] DEBUG
> com.rjmpsmith.ant.RemoteBuildServices  - Recieving
> /tmp/builds/192.168.1.97/200428713/c/ctjava/src/ctext.c
> 10858 [RMI TCP Connection(2)-192.168.1.97] DEBUG
> com.rjmpsmith.ant.RemoteBuildServices  - Recieving
> /tmp/builds/192.168.1.97/200428713/c/ctjava/src/ctext.h
> 10876 [RMI TCP Connection(2)-192.168.1.97] DEBUG
> com.rjmpsmith.ant.RemoteBuildServices  - Recieving
> /tmp/builds/192.168.1.97/200428713/c/ctjava/src/ctjexec.c
> 10903 [RMI TCP Connection(2)-192.168.1.97] INFO
> com.rjmpsmith.ant.RemoteBuildServices  - Beggining Ant build for session
> clare:192.168.1.97:200428713 using SolarisCBuild.xml
> 17602 [RMI TCP Connection(2)-192.168.1.97] ERROR
> com.rjmpsmith.ant.RemoteBuildServices  - Build failed for session
> clare:192.168.1.97:200428713
> /tmp/builds/192.168.1.97/200428713/SolarisCBuild.xml:6: Could not launch
> gcc: java.io.IOException: gcc: not found
>         at net.sf.antcontrib.cpptasks.CUtil.runCommand(CUtil.java:476)
>         at
> net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler.runCommand(CommandLi
> neCompiler.java:269)
>         at
> net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler.compile(CommandLineC
> ompiler.java:226)
> 
> -----------------------------------------
> 
> Ant task usage:
> 
> 
>     <!--========================================-->
>     <!--=                 c-all                =-->
>     <!--========================================-->
> 
>     <target name="c-all"
>             description="Build C code for Sun Solaris">
>         <property name="remotebuild.c.solaris.host" value="clare"/>
>         <property name="remotebuild.c.solaris.port" value="2020"/>
> 
>         <taskdef resource="remoteant.taskdefs" classpath="classes"/>
> 
>         <echo message="Begining remote build"/>
> 
>         <createSession host="${remotebuild.c.solaris.host}" 
>                        port="${remotebuild.c.solaris.port}" 
>                        property="session.c.solaris"/>
> 
>         <putFiles session="${session.c.solaris}">
>             <fileset dir="cfg">
>                     <include name="SolarisCBuild.xml"/>
>             </fileset>
>             <fileset dir="${basedir}"
>                      includes="**/c/**"
>                      excludes="**/Makefile"/>
>         </putFiles>
>                     
>         <remoteBuild session="${session.c.solaris}" 
>                      buildfile="SolarisCBuild.xml"
>                      targets="test"/>
>                 
>         <getFile session="${session.c.solaris}" 
>                  remoteFile="ctjava"
>                  localFile="${basedir}/Configuration/bin/ctjava"/>
>                 
>         <closeSession session="${session.c.solaris}"/>
>     </target>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


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