Eclipse

From GRASS-Wiki
Jump to navigation Jump to search

Eclipse is an Integrated Development Environment (IDE) for software development.

See also Using Eclipse to develop GRASS Python programs
See also Using Eclipse 4.5 (Mars) on Windows 7

The CDT-plugin enables support for C/C++ development. While CVS-support is built in, additional plugins have to included to allow for access of SVN repositories.

Eclipse/CDT can be used as a convenient frontend for platform independent GRASS GIS development.

It can handle:

  • Checkout of the latest sources from the SVN
  • Code editing and refactoring
  • GRASS-spedific Configure/Make/Make-Install - toolchain via wrapping in Ant-XML-fragements.
  • Running of a freshly compiled GRASS-build from within Eclipse.

Please note: This approach aims at software development, not the development of a fat GRASS plugin within the Eclipse environment. If this is you interest, you might want to look up the JGRASS project.

What's needed -- Howto

  • A sample Ant-wrapper-file -> paths etc which needs to be updated to local settings (see below). It's pretty much self explanatory. The file should be included in the Eclipse-project (top level).
  • The build process is started from the GUI via ->Run ->External Tools ->Run As -> AntBuild -> Select the file "build.xml" here.
  • When invoked, the file defaults to do the configuration step and stops afterwards.
  • Use the OUTLINE window to fire up the following steps of compilation etc.
  • The tasks (configure/make/make install) can also be concatenated -> "launch" shows how this is done: It includes the whole building chain and eventually starts the newly build GRASS from within Eclipse.

Note: Please be aware that building on a Windows machine will require a bit of fiddling with MSYS. The attached build.xml comes from a linux-environment.

Ant project file "build.xml"

 <?xml version="1.0"?>
 <project name="GRASS-Builder ant Wrapper for GRASS trunk (Peter Loewe 2008)" default="configure">
   <description>
           Ant Adapter fuer GRASS make
   </description>
       <target name="configure" description="GRASSbuilder: Configure">
               <exec executable="configure">
                       <arg value="--program-suffix=RE_eclipse" />
                       <arg value="--without-tcltk" />
                       <arg value="--without-fftw" />
               </exec>
       </target>
       <target name="configure-help" description="GRASSbuilder: Configure: Print  Help">
               <exec executable="configure">
                       <arg value="--help" />
               </exec>
        </target>
        <target name="make" description="GRASSbuilder: make" depends="configure">
              <exec executable="make">
              </exec>
        </target>
        <target name="make_solo" description="GRASSbuilder: make (solo)">
               <exec executable="make">
               </exec>
           </target>
        <target name="make_solo backup" description="GRASSbuilder: make (solo)">
               <exec executable="/home/grass/workspace/grass_trunk/make">
                   <arg value="-f"/>
                   <arg value="unix/Makefile"/>
                  <arg value="generic"/>
               </exec>
           </target>
          <target name="install" description="GRASSbuilder: install" depends="make">
           <exec executable="make">
                           <arg value="install"/>
                   </exec>
                   </target>
          <target name="install_solo" description="GRASSbuilder: install (solo)">
           <exec executable="make">
                           <arg value="install"/>
           </exec>
          </target>
          <target name="clean" description="GRASSbuilder: install" depends="make">
             <exec executable="make">
                   <arg value="clean"/>
                </exec>
               </target>
         <target name="clean_solo" description="GRASSbuilder: install (solo)">
                 <exec executable="make">
                     <arg value="clean"/>
                 </exec>
         </target>
       <target name="launch_solo" description="GRASSbuilder: launch (solo)">
                         <exec executable="./bin.i686-pc-linux-gnu/grass70">
                             <arg value="-gui"/>
                         </exec>
       </target>
       <target name="launch" description="GRASSbuilder: launch" depends="make">
                                 <exec executable="./bin.i686-pc-linux-gnu/grass70">
                                     <arg value="-gui"/>
                                 </exec>
       </target>
 </project>


References

pages 26 - 28: Coming of Age: The positive legacy of free and open-source software geographic information systems.