tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Tapestry > Building Tapestry from Source
Date Mon, 01 Oct 2012 23:55:00 GMT
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/12/_/styles/combined.css?spaceKey=TAPESTRY&amp;forWysiwyg=true"
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/TAPESTRY/Building+Tapestry+from+Source">Building
Tapestry from Source</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~bobharner">Bob
    <div class="notificationGreySide">
         <p>This is a brief guide to building Tapestry itself from source code.</p>

<h3><a name="BuildingTapestryfromSource-Prerequisites"></a>Prerequisites</h3>

	<li>Install a Java JDK (Sun/Oracle, not OpenJDK). 1.5 will work (but 1.6 or newer is
	<li>Install an IDE (IDEA IntelliJ is recommended (and free to Tapestry committers),
but Eclipse will also work. NetBeans is reported to work as well.</li>
	<li>Install Firefox browser version 3.6, needed for the integration tests.</li>
	<li>Install a Git client</li>
	<li>Install Gradle 1.0-milestone-3 or newer (or a Gradle plugin to your IDE),</li>
	<li>Clone Tapestry from the Git repo:</li>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
git clone https:<span class="code-comment">//git-wip-us.apache.org/repos/asf/tapestry-5.git</span>

<h3><a name="BuildingTapestryfromSource-IDEPreparation"></a>IDE Preparation</h3>

	<li>If using Eclipse:
		<li>do <tt>gradlew eclipse</tt></li>
		<li>Gradle's eclipse plugin doesn't include the provided project dependencies; you
need to add them manually (Java Build Path - Projects - Add tapestry-test). The plugin also
generates a root eclipse project, so you'll need to delete the ".project" file in the root
folder, and then you can import all Tapestry sub-projects at once.</li>

<h3><a name="BuildingTapestryfromSource-Building"></a>Building</h3>

<p>You can build individual modules, or (from the root folder) build everything.</p>

<p>Tapestry 5 is built using Gradle. The following assumes you are using Gradle from
the command line. "gradlew" is the gradle wrapper shell script (gradlew) or batch file (gradlew.bat)
found in the root folder of the Tapestry source. Alternatively, with the right Gradle plugin
you can do the builds from within your IDE.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
gradlew build

<h3><a name="BuildingTapestryfromSource-RunningTests"></a>Running Tests</h3>

<p>The Tapestry integration tests will repeatedly start up a Firefox browser.</p>

	<li>Ensure that your environment will allow a connection to <a href="https://localhost:443"
class="external-link" rel="nofollow">https://localhost:443</a></li>

<h3><a name="BuildingTapestryfromSource-SkippingTests"></a>Skipping Tests</h3>

<p>Running the Tapestry integration tests can take 10 minutes or more, so you won't
want to run them every time you try a change.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
gradlew build -x test

<p>You can skip test on a specific module by adding a colon and the module name. For
example: <tt>-x test:tapestry-ioc</tt></p>

<h3><a name="BuildingTapestryfromSource-RunningtheIntegrationTestApps"></a>Running
the Integration Test Apps</h3>

<p>The Tapestry source includes several web apps that are used by the automated Selenium
integration tests. You can also run these apps manually to try out nearly every browser-visible
aspect of Tapestry. (See <a href="http://tapestry-test.appspot.com/" class="external-link"
rel="nofollow">a live example</a> running on Google App Engine.)</p>

	<li>If using Eclipse:
		<li>Use the run-jetty-run plugin in Eclipse, with the context directory selected from
among the <tt>test</tt> context directories. For example, in the tapestry-core
module use /src/test/app1 (or app2, etc).</li>

<h3><a name="BuildingTapestryfromSource-MakingCodeChanges"></a>Making Code

<p>Once you have cloned or pulled the latest changes to your local Git repository, you
can start working on it. Whenever you make some changes to the codebase, it's good to have
a related issue filed in JIRA and to use a similarly named branch in your local Git repository.
For example, to create a branch for an issue with the key TAP5-123:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">git branch TAP5-123 origin/trunk</pre>

<p>With per-issue branches you can easily switch back and forth between different issues
without worrying about unwanted side-effects from unfinished changes to other issues. Whenever
you want to work on the TAP5-123 example issue, simply checkout that branch and start making
your changes:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">git checkout TAP5-123</pre>

<p>It's a good idea to commit your changes to your local Git repo whenever you have
finished one logical part of the issue. For example when refactoring, make a new commit for
each refactoring step you take.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">git commit</pre>

<h3><a name="BuildingTapestryfromSource-Pushingyourcommitsupstream"></a>Pushing
your commits upstream</h3>

	<li>Run the full suite of tests before pushing your commits to the upstream (remote)
	<li>Ensure your changes have full test coverage</li>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">_TODO_</pre>

<h3><a name="BuildingTapestryfromSource-ProducingPatches"></a>Producing

<p>If you aren't an official committer (with write access to the Apache Tapestry Git
repo), you'll need to submit changes via a patch.<br/>
See the recommendations at <a href="http://commons.apache.org/patches.html" class="external-link"
rel="nofollow">http://commons.apache.org/patches.html</a>. (Obviously that isn't
specifically for the Tapestry project, but most of the same principles apply.)</p>

<p>You can use the git format-patch command to produce a nice set of patches to attach
to the relevant issue in JIRA:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
git format-patch origin/trunk

<p>The sooner you share your work the better. You can repeat the steps of this workflow
as often as you like, producing more patches to be attached to the issue tracker. Once some
of your patches are accepted and committed to svn, you can rebase your work against the latest
trunk. Alternatively, if you're asked to make some changes, you can go back to the original
Git commit and modify it until the project team accepts your changes.</p>

<h3><a name="BuildingTapestryfromSource-TroubleshootingHints"></a>Troubleshooting

<p><b>Problem:</b>  I can't run the build. it gives me an error in line
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
20:22:11.438 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
20:22:11.439 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root
project 'tapestry-project-trunk'.
20:22:11.440 [ERROR] [org.gradle.BuildExceptionReporter] Cause: Cannot get property 'plus'
on <span class="code-keyword">null</span> object
<p><b>Solution:</b> Use the gradle wrapper (./gradlew build), not plain
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       <a href="https://cwiki.apache.org/confluence/display/TAPESTRY/Building+Tapestry+from+Source">View

View raw message