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
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/12/_/styles/combined.css?spaceKey=TAPESTRY&amp;forWysiwyg=true"
type="text/css">
    </head>
<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
Harner</a>
    </h4>
         <br/>
    <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>

<ul>
	<li>Install a Java JDK (Sun/Oracle, not OpenJDK). 1.5 will work (but 1.6 or newer is
recommended).</li>
	<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>
</ul>


<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>
</pre>
</div></div>

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

<ul>
	<li>If using Eclipse:
	<ul>
		<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>
	</ul>
	</li>
</ul>


<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
</pre>
</div></div>

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

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

<ul>
	<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>
</ul>


<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
</pre>
</div></div>

<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>

<ul>
	<li>If using Eclipse:
	<ul>
		<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>
	</ul>
	</li>
</ul>


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

<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>
</div></div>

<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>
</div></div>

<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>
</div></div>

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

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


<p>Then:</p>

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

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

<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
</pre>
</div></div>

<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
Hints</h3>

<p><b>Problem:</b>  I can't run the build. it gives me an error in line
91:</p>
<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
</pre>
</div></div>
<p><b>Solution:</b> Use the gradle wrapper (./gradlew build), not plain
"gradle".</p>
    </div>
    <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>
       </div>
       <a href="https://cwiki.apache.org/confluence/display/TAPESTRY/Building+Tapestry+from+Source">View
Online</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message