imakerplugin/plugin-build-template.xml
author Matti Laitinen <matti.t.laitinen@nokia.com>
Thu, 04 Mar 2010 13:38:40 +0200
changeset 7 018264c44c89
parent 0 61163b28edca
permissions -rw-r--r--
HTI Connection v1.3.1 - Supporting Carbide 2.5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     1
<!--****************************************************************************
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     2
 * Configuration tool plugin build template
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     3
 * This ant pluging-build-template.xml will contain the common targets
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     4
 * to build a eclipse plugin
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     5
 ****************************************************************************-->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     6
 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     7
<project name="${pluginName}" default="all">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     8
 	<property file="../common.properties"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     9
  <property file="../${common.buildproperties}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    10
  <property file="build.properties"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    11
  <property file="plugin.properties"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    12
  <fileset id="plugin-resources" dir="." includes="${bin.includes}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    13
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    14
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    15
 <path id="project.class.path">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    16
    <!-- add lib jars to classpath -->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    17
    <fileset dir="${common.plugin-lib}" casesensitive="yes">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    18
      <include name="**/*.jar"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    19
    </fileset>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    20
    <!-- add also the generated Configuration Tool jars to classpath -->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    21
    <fileset dir="${common.plugin-dist}" casesensitive="yes">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    22
      <include name="**/*.jar"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    23
    </fileset>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    24
  </path>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    25
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    26
  <!-- Gets the svnversion with the svnversion command and stores the output to svnrevision. 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    27
       The target is executed only if the svnrevision has not been set. 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    28
       -->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    29
  <target name="get-svnversion" unless="common.svnversion">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    30
    <exec dir="." executable="svnversion" outputproperty="common.svnversion" />
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    31
    <echo message="svnversion from svn command = ${common.svnversion}" />
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    32
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    33
  <!-- Sets the buildate property if it has not been set by the common property file -->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    34
  <target name="get-builddate" unless="common.builddate">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    35
    <tstamp prefix="build"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    36
    <property name="common.builddate" value="${build.DSTAMP}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    37
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    38
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    39
    <!-- generate a build property file -->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    40
  <target name="update-properties" depends="get-svnversion">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    41
    <tstamp prefix="build"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    42
    <echo file="${common.buildproperties}">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    43
    common.svnversion     =${svnrevision}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    44
    </echo>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    45
  <!-- replace the possible : characters because the do not work in filenames-->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    46
    <replace file="${common.buildproperties}" token=":"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    47
    <property file="${common.buildproperties}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    48
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    49
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    50
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    51
  <!-- All target will clean and then commit all the build steps-->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    52
	<target name="all" depends="clean, build"/> 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    53
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    54
	<!-- Build target will commit all the build steps and can be used for incremental 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    55
	building, because ant recognized changed files -->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    56
	<target name="build" depends="init, resource, compile, jar"/> 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    57
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    58
  <target name="clean">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    59
    <delete dir="${common.plugin-target}" quiet="true" />
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    60
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    61
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    62
  <target name="info">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    63
    <echoproperties/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    64
  </target>    
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    65
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    66
  <target name="init" depends="get-svnversion,get-builddate">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    67
    <mkdir dir="${common.plugin-target}/bin" />
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    68
    <mkdir dir="${common.plugin-dist}" />
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    69
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    70
    
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    71
  <target name="resource" depends="init">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    72
    <copy todir="${common.plugin-target}/bin/">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    73
      <fileset refid="plugin-resources" /> 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    74
    </copy>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    75
    <manifest file="${common.plugin-target}/bin/META-INF/MANIFEST.MF" mode="update">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    76
    	<attribute name="Bundle-FOO" value="${common.plugin-version}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    77
    	<attribute name="Bundle-Version" value="${common.plugin-version}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    78
    	<attribute name="Bundle-Date" value="${common.builddate}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    79
    	<attribute name="Bundle-RepositoryVersion" value="${common.svnversion}"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    80
    </manifest>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    81
    
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    82
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    83
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    84
  <target name="compile" depends="init"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    85
    description="compile the source">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    86
    <!-- Compile the java code from ${src} into ${build} -->
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    87
    <javac srcdir="${source..}" destdir="${common.plugin-target}/bin">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    88
      <classpath refid="project.class.path"/>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    89
    </javac>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    90
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    91
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    92
  <target name="jar" depends="compile,resource">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    93
  	<jar jarfile="${common.plugin-dist}/${pluginName}_${common.plugin-version}.jar" 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    94
         basedir="${common.plugin-target}/bin"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    95
         manifest="${common.plugin-target}/bin/META-INF/MANIFEST.MF">
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    96
    </jar>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    97
  </target>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    98
    
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    99
</project>