Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] FTP-transfer after building .exe

Hi Norbert,

You can you use an  ant script to upload the executable to your target.
Steps
1 - create the ant build xml-file (see file content below)
2 - open the builders page of your projects properties
3 - add a new builder (select "ant build")
4 - select the proper "buildfile" (file created above) and "base directory" (your project directory) 5 - make sure you changed the properties to your needs! (you can enter your properties on "Properties"-page in the "Edit launch configuration properties" dialog or you can change it in the xml-file)

Thats it.
Regads Olav

P.S. better is to enter the upload as an external tool --> "Run / External Tools / External Tools" and use import in Step 3



<?xml version="1.0"?>
<project name="upload executable" default="ftpupload" basedir=".">

   <target name="init_1" unless="filepath">
       <property name = "filepath" value = "Debug"/>
   </target>

   <target name="init_2" unless="filename">
       <property name = "filename" value = "your executable"/>
   </target>

   <target name="init_3" unless="remote_ip">
<property name = "remote_ip" value = "target-ip e.g. 192.168.200.1"/>
   </target>

   <target name="init_4" unless="local_ip">
<property name = "local_ip" value = "pc-ip und port e.g. 192.168.200.64:1234"/>
   </target>

   <target name="init" depends="init_1, init_2, init_3, init_4">
       <property name = "username"    value = "your login username"/>
       <property name = "password"    value = "your login password"/>
   </target>


   <target name="ftpupload" depends="init">
   <echo>--- using setting ---</echo>
   <echo>filepath  : ${filepath}  </echo>
   <echo>filename  : ${filename}  </echo>
<echo>local ip : ${local_ip} </echo> <echo>remote ip : ${remote_ip} </echo> <echo>username : ${username} </echo> <echo>password : ${password} </echo> <ftp action = "put"
            server    = "${remote_ip}"
            userid    = "${username}"
            password  = "${password}"
            remotedir = "/tmp">
           <fileset dir      = "."
                     includes = "${filepath}/${filename}"
           />
       </ftp>
   </target>


   <target name="startprogram" depends="init,ftpupload">
       <telnet
           server   = "${remote_ip}"
           userid   = "${username}"
           password = "${password}">
           <read>#</read>
<write>cd tmp;chmod a+x ${filename};gdbserver ${local_ip} ${filename} &amp; </write> <read>#</read> </telnet> </target>

</project>

Ploett Norbert schrieb:

Hello all,

I am using eclipse for C/C++ development for an embedded platform. After building the .exe target it must be moved to the target using ftp. I would like eclipse to automatically move the .exe to the target as part of the managed build.

This was my scheme (which failed, so far):

1. Get the C sources translated to .o with the gcc compiler (works fine).
2. Get the .o files linked to .exe with gcc (works fine, too).
3. Define another tool in the toolchain, a shell script which will take .exe as source, transfer it to the target, and, on success creates a little .txt file to let make know that even the last stage of the build succeeded.

I managed to create a plugin which defines a new project type, containing my own definitions for configuration, tool chain and "ftp beamer script". What happens when I build the project is this:

1. The C files are compiled to .o (that should be so).
2. The beamer script is called with the .o files instead of first building the .exe and then calling the script.

So it seems to me that a) I am making a mistake or b) the current MBS system cannot figure out that it has to make a three-stage build process.

I am aware that the planned features for CDT 3.0 include support for "custom build steps". So here are my questions:

- Am I doing something wrong? Can anybody help me?
- Is there another workaround for what I am planning to do?
- Or should I just wait for CDT 3.0?

Thanks for your advice!


Norbert Plött

=======================
Dr.-Ing. Norbert Plött
Siemens A&D ATS 1
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-dev





Back to the top