<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Automating PWSAD Plug-in build,Exporting P4WSAD plugins" />
<link rel="shortcut icon" href="http://localhost/favicon.ico" />
<title>Automating PWSAD Plug-in build - P4WSADWiki</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/skins/monobook/main.css?9"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="../skins/common/commonPrint.css" />
<!--[if lt IE 5.5000]><style type="text/css">@import "/skins/monobook/IE50Fixes.css";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "/skins/monobook/IE55Fixes.css";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "/skins/monobook/IE60Fixes.css";</style><![endif]-->
<!--[if IE 7]><style type="text/css">@import "/skins/monobook/IE70Fixes.css?1";</style><![endif]-->
<!--[if lt IE 7]><script type="text/javascript" src="/skins/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type="text/javascript">var skin = 'monobook';var stylepath = '/skins';</script>
<script type="text/javascript" src="../skins/common/wikibits.js@1"><!-- wikibits js --></script>
<script type="text/javascript" src="../index.php@title=-&action=raw&gen=js"><!-- site js --></script>
<style type="text/css">/*<![CDATA[*/
@import "/index.php?title=MediaWiki:Common.css&action=raw&ctype=text/css&smaxage=18000";
@import "/index.php?title=MediaWiki:Monobook.css&action=raw&ctype=text/css&smaxage=18000";
@import "/index.php?title=-&action=raw&gen=css&maxage=18000";
/*]]>*/</style>
<!-- Head Scripts -->
</head>
<body class="ns-0 ltr">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<h1 class="firstHeading">Automating PWSAD Plug-in build</h1>
<div id="bodyContent">
<h3 id="siteSub">From P4WSADWiki</h3>
<div id="contentSub"></div>
<div id="jump-to-nav">Jump to: <a href="Automating_PWSAD_Plug-in_build.html#column-one">navigation</a>, <a href="Automating_PWSAD_Plug-in_build.html#searchInput">search</a></div> <!-- start content -->
<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#Introduction"><span class="tocnumber">1</span> <span class="toctext">Introduction</span></a></li>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#Use_cases_for_headless_build"><span class="tocnumber">2</span> <span class="toctext">Use cases for headless build</span></a></li>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#Background_Reading"><span class="tocnumber">3</span> <span class="toctext">Background Reading</span></a></li>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#Environmental_Setup"><span class="tocnumber">4</span> <span class="toctext">Environmental Setup</span></a></li>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#P4WSAD_Project_Setup"><span class="tocnumber">5</span> <span class="toctext">P4WSAD Project Setup</span></a></li>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#Build_artifacts"><span class="tocnumber">6</span> <span class="toctext">Build artifacts</span></a></li>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#Script_files"><span class="tocnumber">7</span> <span class="toctext">Script files</span></a></li>
<li class="toclevel-1"><a href="Automating_PWSAD_Plug-in_build.html#Steps_to_Run_script"><span class="tocnumber">8</span> <span class="toctext">Steps to Run script</span></a></li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=1" title="Edit section: Introduction">edit</a>]</div><a name="Introduction"></a><h2> Introduction </h2>
<p>One way to generate distribution version of P4WSAD is to invoke External menu item "Export" from Eclipse. This is documented here <a href="http://localhost/index.php?title=Exporting_P4WSAD_plugins&action=edit" class="new" title="Exporting P4WSAD plugins">Exporting P4WSAD plugins</a>. However, if you need to construct automated build (for example, generating daily build or automating test), you need to build plug-ins without running inside Eclipse itself. This is known as "headless" build. This articles will show step by step for running P4WSAD headless build.
</p>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=2" title="Edit section: Use cases for headless build">edit</a>]</div><a name="Use_cases_for_headless_build"></a><h2> Use cases for headless build </h2>
<ul><li> Generate plug-ins for Eclipse 3.0 or greater
</li></ul>
<ul><li> Generate plug-ins for Eclipse 2.1.3 (WSAD 5.1 compatiable)
</li></ul>
<ul><li> Run set of unit tests for Eclipse 3.0 plug-ins
</li></ul>
<ul><li> Run sets of unit tests for Eclipse 2.1.3
</li></ul>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=3" title="Edit section: Background Reading">edit</a>]</div><a name="Background_Reading"></a><h2> Background Reading </h2>
<p>Here is list of background materials necessary for understanding this article.
</p>
<ul><li> <a href="http://www.eclipse.org/articles/Article-PDE-Automation/automation.html" class="external autonumber" title="http://www.eclipse.org/articles/Article-PDE-Automation/automation.html" rel="nofollow">[1]</a> This articles talks about build and test automation of plug-ins in general. Althought it is out of date, principle remains same.
</li></ul>
<ul><li> <a href="http://wiki.eclipse.org/index.php/Platform-releng-faq" class="external autonumber" title="http://wiki.eclipse.org/index.php/Platform-releng-faq" rel="nofollow">[2]</a> Wiki FAQ page for PDE build.
</li></ul>
<ul><li> <a href="http://dev.eclipse.org/mhonarc/lists/pde-build-dev/maillist.html" class="external autonumber" title="http://dev.eclipse.org/mhonarc/lists/pde-build-dev/maillist.html" rel="nofollow">[3]</a> PDE build mailing list.
</li></ul>
<ul><li> <a href="http://www.qualityeclipse.com/?page=ant/tools/content.html" class="external autonumber" title="http://www.qualityeclipse.com/?page=ant/tools/content.html" rel="nofollow">[4]</a> Techniques for supporting multiple versions of Eclipse.
</li></ul>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=4" title="Edit section: Environmental Setup">edit</a>]</div><a name="Environmental_Setup"></a><h2> Environmental Setup </h2>
<p>We need to set up following environment to run P4WSAD build automation scripts. The script should work on all supported Eclipse platforms but it is only tested on Windows platform.
</p>
<ul><li> Install Java 1.4 or greater from <a href="http://java.sun.com" class="external text" title="http://java.sun.com" rel="nofollow">java.sun.com</a>
</li></ul>
<ul><li> Install Ant. We will be using <a href="http://ant.apache.org/" class="external text" title="http://ant.apache.org/" rel="nofollow">Ant</a> as main script for build. Ant is replacement for 'Make' and is standard for building Java applications. Make sure 'ant' command is on executable path. To test it, open command shell and type 'ant -version'. Ant should be version 1.6 or greater because our script take advantage of 'import' capability which are only present in version 1.6.
</li></ul>
<ul><li> Set up Eclipe environment
<ul><li> Download Eclipse <a href="http://download.eclipse.org/eclipse/downloads/drops/R-3.2-200606291905/index.php" class="external text" title="http://download.eclipse.org/eclipse/downloads/drops/R-3.2-200606291905/index.php" rel="nofollow">3.2</a> distribution file.
</li><li> Download Eclipse <a href="http://archive.eclipse.org/eclipse/downloads/drops/R-2.1.3-200403101828/index.php" class="external text" title="http://archive.eclipse.org/eclipse/downloads/drops/R-2.1.3-200403101828/index.php" rel="nofollow">2.1.3</a> distribution file.
</li><li> Install Eclipse 3.2 from distribution file by expanding zip or .gz file. Keep original distribution files as we are going to construct test eclipse setup for running junit test.
</li></ul>
</li></ul>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=5" title="Edit section: P4WSAD Project Setup">edit</a>]</div><a name="P4WSAD_Project_Setup"></a><h2> P4WSAD Project Setup </h2>
<ul><li> Check out P4WSAD using appropriate p4 commands
</li><li> modify file "common.properties" in the top level directory
</li></ul>
<ul><li><ul><li> <b>eclipse.home</b> Location of Eclipse 3.2 location
</li><li> <b>eclipse.sdk.zip.32</b> Location of Eclipse 3.2 SDK zip(.gz) location
</li><li> <b>eclipse.sdk.zip.213</b> Location of Eclipse 2.1.3 SDK zip(.gz) location
</li><li> <b>p4wsad.plugin.site</b> Directory where p4WSAD site would be built
</li><li> <b>os</b> Name of Os.
</li><li> <b>arch</b> CPU Architecture
</li><li> <b>ws</b> Window System
</li></ul>
</li></ul>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=6" title="Edit section: Build artifacts">edit</a>]</div><a name="Build_artifacts"></a><h2> Build artifacts </h2>
<p>All build related requires files and resulting artifacts are stored in the top level directory "/build".
</p>
<ul><li> <b>/frameworks</b> This directory contains all required library files
<ul><li> <b>/objfac</b> This directory contains open source plug-in that can apply preprocesss java files depends on rule
</li><li> <b>eclipse-test-framework-3.2.zip'</b> This zip file contains Eclipse 3.2 test harness framework
</li><li> <b>eclipse-test-framework-213.zip'</b> This zip file contains Eclipse 2.1.3 test harness framework
</li><li> <b>/format/junit.xls'</b> This is XLS file for formatting junit result into HTML file
</li></ul>
</li><li> <b>/result</b> This file contains junit results
<ul><li> <b>html</b> This directory contains junit result formattedin HTML.
</li><li> <b>summary</b> This directory summarized junit result
</li><li> <b>xml</b> This directory contains raw junit XML result
</li></ul>
</li><li><b>/site</b> This directory contains generated P4WSAD plugin
</li><li><b>/test</b> This directory is a test eclipse location to run plugin tests.
</li></ul>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=7" title="Edit section: Script files">edit</a>]</div><a name="Script_files"></a><h2> Script files </h2>
<p>Main Ant script files are located in the root directory. They are <b>build-32.xml</b> for generating Eclipse 3.2 plugins and run tests. For Eclipse 2.1.3, use <b>build-213.xml</b>. Other files are:
</p>
<ul><li> <b>common.properties</b> Common properties files. It specifies SDK files.
</li><li> <b>common-system.xml</b> Common parent build files.
</li><li> <b>common-plugin.xml</b> Common build file for all plug-in.
</li></ul>
<p>These script are launched from ant and will then kick off Eclipse to invoke plug-in specific files. For each plug-in, there are following files:
</p>
<ul><li> <b>build-32.xml</b> Build files for Eclipse 3.2
</li><li> <b>build-213.xml</b> Build files for Eclipse 2.1.3
</li><li> <b>p4wsad.properties</b> This specifies plug-in specific properties.
</li></ul>
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit&section=8" title="Edit section: Steps to Run script">edit</a>]</div><a name="Steps_to_Run_script"></a><h2> Steps to Run script </h2>
<p>goto top level directory. run following command:
</p>
<pre> ant -buildfile build-32.xml
</pre>
<p>This will generate full distribution file under directory ./build/site and perform junit tests. Result of junit tests will be stored in the './build/results'.
</p><p>To run build and test for Eclipse 2.1.3. Type command:
</p>
<pre>and -buildfile build-213.xml
</pre>
<!-- Saved in parser cache with key p4wsadwiki:pcache:idhash:1412-0!1!0!0!!en!2 and timestamp 20060924222119 -->
<div class="printfooter">
Retrieved from "<a href="Automating_PWSAD_Plug-in_build.html">http://localhost/index.php/Automating_PWSAD_Plug-in_build</a>"</div>
<!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<div id="column-one">
<div id="p-cactions" class="portlet">
<h5>Views</h5>
<ul>
<li id="ca-nstab-main" class="selected"><a href="Automating_PWSAD_Plug-in_build.html">Article</a></li>
<li id="ca-talk" class="new"><a href="http://localhost/index.php?title=Talk:Automating_PWSAD_Plug-in_build&action=edit">Discussion</a></li>
<li id="ca-edit"><a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=edit">Edit</a></li>
<li id="ca-history"><a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&action=history">History</a></li>
</ul>
</div>
<div class="portlet" id="p-personal">
<h5>Personal tools</h5>
<div class="pBody">
<ul>
<li id="pt-login"><a href="../index.php@title=Special%253AUserlogin&returnto=Automating_PWSAD_Plug-in_build.html">Log in / create account</a></li>
</ul>
</div>
</div>
<div class="portlet" id="p-logo">
<a style="background-image: url(/skins/common/images/wiki.png);" href="Main_Page.html" title="Main Page"></a>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
<div class='portlet' id='p-navigation'>
<h5>Navigation</h5>
<div class='pBody'>
<ul>
<li id="n-mainpage"><a href="Main_Page.html">Main Page</a></li>
<li id="n-portal"><a href="P4WSADWiki%253ACommunity_Portal.html">Community portal</a></li>
<li id="n-currentevents"><a href="Current_events.html">Current events</a></li>
<li id="n-recentchanges"><a href="Special%253ARecentchanges.html">Recent changes</a></li>
<li id="n-randompage"><a href="P4WSAD_Wiki_Admin.html">Random page</a></li>
<li id="n-help"><a href="Help%253AContents.html">Help</a></li>
<li id="n-sitesupport"><a href="P4WSADWiki%253ASite_support.html">Donations</a></li>
</ul>
</div>
</div>
<div id="p-search" class="portlet">
<h5><label for="searchInput">Search</label></h5>
<div id="searchBody" class="pBody">
<form action="http://localhost/index.php/Special:Search" id="searchform"><div>
<input id="searchInput" name="search" type="text" accesskey="f" value="" />
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="Go" />
<input type='submit' name="fulltext" class="searchButton" value="Search" />
</div></form>
</div>
</div>
<div class="portlet" id="p-tb">
<h5>Toolbox</h5>
<div class="pBody">
<ul>
<li id="t-whatlinkshere"><a href="../index.php@title=Special%253AWhatlinkshere&target=Automating_PWSAD_Plug-in_build.html">What links here</a></li>
<li id="t-recentchangeslinked"><a href="../index.php@title=Special%253ARecentchangeslinked&target=Automating_PWSAD_Plug-in_build.html">Related changes</a></li>
<li id="t-upload"><a href="Special%253AUpload.html">Upload file</a></li>
<li id="t-specialpages"><a href="Special%253ASpecialpages.html">Special pages</a></li>
<li id="t-print"><a href="../index.php@title=Automating_PWSAD_Plug-in_build&printable=yes.html">Printable version</a></li> <li id="t-permalink"><a href="http://localhost/index.php?title=Automating_PWSAD_Plug-in_build&oldid=1467">Permanent link</a></li> </ul>
</div>
</div>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
<div id="footer">
<div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="../skins/common/images/poweredby_mediawiki_88x31.png" alt="MediaWiki" /></a></div>
<ul id="f-list">
<li id="lastmod"> This page was last modified 22:18, 24 September 2006.</li>
<li id="viewcount">This page has been accessed 70 times.</li>
<li id="privacy"><a href="P4WSADWiki%253APrivacy_policy.html" title="P4WSADWiki:Privacy policy">Privacy policy</a></li>
<li id="about"><a href="P4WSADWiki%253AAbout.html" title="P4WSADWiki:About">About P4WSADWiki</a></li>
<li id="disclaimer"><a href="P4WSADWiki%253AGeneral_disclaimer.html" title="P4WSADWiki:General disclaimer">Disclaimers</a></li>
</ul>
</div>
<script type="text/javascript"> if (window.runOnloadHook) runOnloadHook();</script>
</div>
<!-- Served by localhost in 0.171 secs. -->
</body></html>