scripts/build.xml
author Eugene Ostroukhov <eugeneo@symbian.org>
Wed, 07 Apr 2010 11:51:12 -0700
changeset 298 d4abe1c863d1
parent 195 f02192d5e8f8
permissions -rw-r--r--
Bug 2429 - debug output sent to console
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
157
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
<!--
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
    This program and the accompanying materials are made available
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
    under the terms of the Eclipse Public License v1.0 which
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
    accompanies this distribution, and is available at
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
      http://www.eclipse.org/legal/epl-v10.html
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
    
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
    This build script creates a build directory containing the plugins
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     8
    and features to be built, and then kicks off the PDE build process.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
    You could just as easily do this from a shell script or cron job.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
    
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
    Also, the script can be run inside the Eclipse IDE by choosing 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
    Run As -> Ant Build from the context menu. It could obviously be
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
    run outside of the IDE if you have ANT installed on your path.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
    
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
    If you have any questions about this build, feel free to contact me
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
    at patrick@rcpquickstart.com.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
    
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
    Modified by Lukas Zapletal <lzapletal@pikeelectronic.com>.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
    
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    20
	Retrieved from an article on Google Knol (http://knol.google.com/k/automating-eclipse-pde-build#). 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    21
	Customized from the Symbian Foundation by John Kern (johnk@symbian.org). 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
-->
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    23
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    24
<project name="org.symbian.tools.wrttools" default="build">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
    <property file="build.properties" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
    <!--
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
        PDE Build expects that the build directory contains a "plugins" 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
        directory and a "features" directory. These directories should contain
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
        the various plug-ins and features to be built.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    31
        
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
        It's possible to use the CVS checkout process that is built into 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    33
        PDE Build. This is done with map files and is beyond the scope of 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
        this tutorial. 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
        
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
        This tutorial simply copies the projects directly from your workspace
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
        into the appropriate build directory folders.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
    -->
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    39
159
137ed78712d1 shepard should define build and source directory
John Kern <johnk@symbian.org>
parents: 157
diff changeset
    40
157
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    41
   <target name="init">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    42
        <mkdir dir="${buildDirectory}" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    43
        <mkdir dir="${buildDirectory}/plugins" />
159
137ed78712d1 shepard should define build and source directory
John Kern <johnk@symbian.org>
parents: 157
diff changeset
    44
	<echo message="source dir: ${sourceDirectory}" />
137ed78712d1 shepard should define build and source directory
John Kern <johnk@symbian.org>
parents: 157
diff changeset
    45
	<echo message="build dir: ${buildDirectory} " />
157
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    46
        <copy todir="${buildDirectory}/plugins">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    47
            <fileset dir="${sourceDirectory}">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    48
                <include name="org.chromium**/**/*" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    49
                <include name="org.symbian**/**/*" />
195
f02192d5e8f8 Fixed build script to include new CSS plugin
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 193
diff changeset
    50
                <include name="org.w3c.css**/**/*" />
157
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    51
		<exclude name="org.symbian.tools.wrttools.feature/**/*" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    52
            </fileset>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    53
        </copy>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    54
	<mkdir dir="${buildDirectory}/features" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    55
        <copy todir="${buildDirectory}/features">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    56
            <fileset dir="${sourceDirectory}">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    57
                <include name="org.symbian.tools.wrttools.feature/**" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    58
            </fileset>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    59
        </copy>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    60
    </target>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    61
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    62
    <!--
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    63
        This target actually executes the PDE Build process by launching the 
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    64
        Eclipse antRunner application.
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    65
    -->
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    66
    <target name="pde-build">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    67
        <echo message="Executing ${eclipseLocation}/plugins/org.eclipse.equinox.launcher_${equinoxLauncherPluginVersion}.jar"/>
159
137ed78712d1 shepard should define build and source directory
John Kern <johnk@symbian.org>
parents: 157
diff changeset
    68
	<echo message="source dir: ${sourceDirectory}" />
137ed78712d1 shepard should define build and source directory
John Kern <johnk@symbian.org>
parents: 157
diff changeset
    69
	<echo message="build dir: ${buildDirectory} " />
157
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    70
        <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    71
            <arg value="-application" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    72
            <arg value="org.eclipse.ant.core.antRunner" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    73
            <arg value="-buildfile" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    74
            <arg value="${eclipseLocation}/plugins/org.eclipse.pde.build_${pdeBuildPluginVersion}/scripts/productBuild/productBuild.xml" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    75
            <arg value="-Dtimestamp=${timestamp}" />
160
9229a5237a62 explicitly pass source and build to equinox
John Kern <johnk@symbian.org>
parents: 159
diff changeset
    76
	    <arg value="-DbuildDirectory=${buildDirectory}" />
9229a5237a62 explicitly pass source and build to equinox
John Kern <johnk@symbian.org>
parents: 159
diff changeset
    77
            <arg value="-DsourceDirectory=${sourceDirectory}" />
157
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    78
            <classpath>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    79
                <pathelement location="${eclipseLocation}/plugins/org.eclipse.equinox.launcher_${equinoxLauncherPluginVersion}.jar" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    80
            </classpath>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    81
        </java>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    82
    </target>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    83
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    84
    <target name="clean">
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    85
        <delete dir="${buildDirectory}" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    86
    </target>
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    87
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    88
    <target name="build" depends="init, pde-build" />
c68f6790ea55 ant build scripts
John Kern <johnk@symbian.org>
parents:
diff changeset
    89
</project>