Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Higgins2Ant

Revision as of 17:21, 29 March 2008 by Vkokhan.aquasoft.dp.ua (Talk | contribs) (Java project targets)

{{#eclipseproject:technology.higgins}}

Higgins logo 76Wx100H.jpg

Introduction

higgins2ant is an Eclipse plug-in that the Higgins project uses to generate Ant build files which can be used either for developer builds or Automated Builds running on Eclipse build server.

Prerequisites

A number of prerequisites need to be installed on the build machine, as follows:

  1. J2SE 1.4.2
  2. Eclipse version 3.2 of higher
  3. Ant version 1.6.5 or higher

General Information

Higgins2ant plug-in generates following set of files:

build.xml

Higgins2ant generates ant build files which contains all required targets to build the project. Generated build.xml files can be used by both developers to build the project on local computer and automated build scripts running on build server. Actual set of targets generated depends on the type of the project. Latest version supports generation of build.xml files for the following types of projects:

  • java project
  • plug-in project
  • feature project

In order to extend capabilities of generated build files Higgins2ant plug-in automatically imports all build files in the project directory which contains <?eclipse.ant.import?> processing instruction as the first child. This allow to create any project specific targets in separated build file manually and they will be available to call from the generated build.xml

Java project targets

For the generic Java projects following set of targets are generated:

  • build - the default target which builds the source code of the project and subprojects. Output folder for project's binaries is build/bin.
  • jar - the target to pack project's binaries. It creates projectName_version.jar file in the build/lib folder.
  • javadoc - the target to create javadoc for the project. Uses build/doc folder as output destination.
  • clean - the target to clean build output folder of the project. This target deletes all files and subdirectories of build folder, including build itself.
  • copy.libs the target to copy all project required libraries to user defined folder. In order to use this target toDir parameter should be specified.
  • copy.all.jars - the target to copy all jars (project's jar and all jars of its dependencies) to user defined folder. In order to use this target toDir parameter should be specified.
  • cleanall - the target to clean build folders for the project and its dependencies.
  • fetch.dependencies fetches the dependencies of the projects from cvn repository.

Also there is a target -save.build.properties which saves information about all subprojects and features of current project. It give possibility to avoid duplicated builds and not to spend time for its.

Plug-in project targets

Into the plug-in project build.xml file following targets were added:

  • plugin builds the plug-in. Creates build/plugins (for jar-files of plug-ins), build/temp.dir (for copying temporary files to), build/temp.dir/builder (the Eclipse's IDE plug-ins are copying here, also here build.properties file is generated), build/temp.dir/plugins (for temporary building plug-ins) and build/temp.dir/features (for included features) directories

Feature project targets

There are targets in feature project build.xml file:

  • feature (default) builds feature project with features and projects which it includes. Creates build (for results of building), build/features, build/temp.dir, build/temp.dir/builder, build/temp.dir/plugins, build/temp.dir/features, build/temp.dir/build, build/temp.dir/tmp. As java project, to these directories the files of subprojects will copied, because Eclipse's IDE targets replaces ant build files (in subprojects) onto Eclipse's IDE build files.
  • fetch.dependencies fetches the dependencies of projects and subprojects

dependencies.xml

dependencies.xml provides the build process with information on required projects and/or libraries. See How_Autobuild_Gets_Dependencies

Build scripts use dependencies.xml file with the structure below as generated by Eclipse IDE.

<?xml version="1.0" encoding="UTF-8"?>
<dependencies id="org.eclipse.higgins.icard.provider.cardspace.common">
	<!-- list of projects that are required -->
    <higginsProjects>
        <project id="org.eclipse.higgins.registry"/>
        <project id="org.eclipse.higgins.icard"/>
    </higginsProjects>
	<!-- libs that should be downloaded to the project. can be multiple for different locations -->
    <remoteLibs location="lib">
        <library id="commons-logging-1.1.jar"/>
        <library id="serializer.jar"/>
        <library id="xalan.jar"/>
        <library id="xercesImpl.jar"/>
        <library id="xmlsec-1.4.0.jar"/>
    </remoteLibs>
</dependencies>

project.psf and projectWithDeps.psf

These files are created if you have installed the Subclipse plug-in.

Team Project Sets that are stored in the workspace can now be imported directly using the Import Project Set operation available in the context menu of any *.psf file. Higgins2ant automatically generates project.psf and projectWithDeps.psf files.

Build scripts use project.xml file with the structure below as generated by Eclipse IDE.

<?xml version="1.0" encoding="UTF-8"?>
<psf version="2.0">
    <provider id="org.tigris.subversion.subclipse.core.svnnature">
        <project reference="0.9.3,https://dev.eclipse.org/svnroot/technology/org.eclipse.higgins/trunk/plugins/org.eclipse.higgins.cache.api,org.eclipse.higgins.cache.api"/>
    </provider>
</psf>

Install information

With the prerequisites installed, follow these steps to setup your environment:

  1. Add the jre/bin directory of the installed JDK to your PATH environment variable.
  2. Add the ant/bin directory of the installed Ant to your PATH environment variable.

One cans install the plug-in by 2 ways:

  • setup locally
  • setup on-line

Install locally

Before setup locally, you must download higgins2ant.update.zip on local machine.

To Setup locally, follow the instructions below:

  • select (in main menu) Help -> Software Updates -> Find and Install...
Inst1.JPG
  • in window "Install/Update" select Search for new features to install -> Next
Inst2.JPG
  • select New Local Site... (New Archived Site... if site archived) and choose folder (.zip or .jar file), where your local site places
Inst3.JPG
  • Choose location for local site
Inst4a.JPG

or archived site

Inst4b.JPG
  • Edit name -> OK
Inst5.JPG
  • Finish
Inst6.JPG
  • in window "Updates" select Higgins Ant Files Generator Feature {installed version} in the treeview of features -> Next
Inst7.JPG
  • read license, if you accept the terms in the license agreements, select Next
Inst8.JPG
  • Finish
Inst9.JPG
  • in window "Verification" select Install or Install All
Inst10.JPG
  • Yes
Inst11.JPG

Install on-line

To Setup on-line, follow the instructions below:

  • select (in main menu) Help -> Software Updates -> Find and Install...
Inst1.JPG
  • in window "Install/Update" select Search for new features to install -> Next
Inst2.JPG
  • select New Remote Site...
Inst3.JPG
Inst4c.JPG
  • Finish
Inst6.JPG
  • in window "Updates" select Higgins Ant Files Generator Feature {installed version} in the treeview of features -> Next
Inst7.JPG
  • read license, if you accept the terms in the license agreements, select Next
Inst8.JPG
  • Finish
Inst9.JPG
  • in window "Verification" select Install or Install All
Inst10.JPG
  • Yes
Inst11.JPG

Generate files

To generate, select (from menu) Export

Gen1.JPG

(General) Higgins Buildfiles -> Next

Gen2.JPG

check projects (for which you wish to create the build file) -> Finish

Gen3.JPG

Run build files

With the prerequisites installed, follow these steps to setup your environment:

  1. Add the jre/bin directory of the installed JDK to your PATH environment variable.
  2. Add the ant/bin directory of the installed Ant to your PATH environment variable.

To build any project with build.xml, follow the instructions below:

  • cd yourproject
  • ant [params]

Where params can use for following types of projects:

  • for java/feature project (default): ant
  • for plugin project (must have parameter 'plugin'): ant plugin

Also one allows for following parameter:

  • -D<property>=<value> uses value for given property; usage: -DECLIPSE_HOME=C:/Eclise

Uninstall

To uninstall the Higgins2Ant plug-in, follow the instructions below:

  • select (in main menu) Help -> Software Updates -> Manager Configuration
Uninst1.JPG
  • in window "Product Configuration" select Higgins Ant Files Generator Feature {installed version} in the treeview of features
Uninst2.JPG
  • right click -> Uninstall
Uninst3.JPG
  • OK
Uninst4.JPG
  • Yes
Uninst5.JPG

See Also

Automated Builds

Back to the top