Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated exercises to Tycho 1.3.0 / Eclipse 2018-12 #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions exercises/Exercise_01_Create_RCP_Bundle/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ <h3>Generating an Eclipse 4 sample application</h3>
<li>On the <tt>Content</tt> page, enter the name <tt>Tycho Demo Bundle</tt>. Click <tt>Next &gt;</tt>
<br /><img src="resources/new_e4_app_2.png" />
</li>
<li>On the <tt>Eclipse 4 Application</tt> page, select <tt>Create sample content</tt> and press <tt>Finish</tt>
<li>On the <tt>Templates</tt> page, select <tt>Eclipse 4 RCP application</tt>. Click <tt>Next &gt;</tt>
<br /><img src="resources/new_e4_app_3.png" />
</li>
<li>On the <tt>Basic Eclipse 4 Application</tt> page, select <tt>Create sample content</tt> and press <tt>Finish</tt>
<br /><img src="resources/new_e4_app_4.png" />
</li>
</ul></li>
<li>Run the generated application to see what it does: <ul>
<li>Open the product definition file <tt>tychodemo.bundle.product</tt></li>
Expand Down Expand Up @@ -64,7 +67,7 @@ <h3>Setting up the Tycho build</h3>
<li><a name="convert_to_maven" />Right-click on the <tt>tychodemo.bundle</tt> project and select <tt>Configure > Convert to Maven Project</tt>
<br /><img src="resources/convert_to_maven_1.png" />
</li>
<li>Enter the groupId <tt>tychodemo</tt>, the version <tt>1.0.0-SNAPSHOT</tt>, and the packaging <tt>eclipse-plugin</tt>
<li>Enter the groupId <tt>tychodemo</tt>, the version <tt>1.0.0-SNAPSHOT</tt>, and the packaging <tt>eclipse-plugin</tt> and press <tt>Finish</tt>.
<br /><img src="resources/convert_to_maven_2.png" />
<br />Note: Tycho requires that the <tt>artifactId</tt> in the POM is the same as the <tt>Bundle-SymbolicName</tt> in the OSGi manifest, and that the versions match (with <tt>.qualifier</tt> replaced by <tt>-SNAPSHOT</tt>)
</li>
Expand All @@ -76,7 +79,7 @@ <h3>Setting up the Tycho build</h3>
<li>Open the <tt>pom.xml</tt> and switch to the tab <tt>pom.xml</tt></li>
<li>Define a property with the Tycho version by adding this snippet to the <tt>&lt;project&gt;</tt> : <pre>
&lt;properties&gt;
&lt;tycho-version&gt;0.20.0&lt;/tycho-version&gt;
&lt;tycho-version&gt;1.3.0&lt;/tycho-version&gt;
&lt;/properties&gt;</pre>
</li>
<li>To enable Tycho, add this snippet to the <tt>&lt;project&gt;</tt> : <pre>
Expand Down Expand Up @@ -113,19 +116,13 @@ <h3>Setting up the Tycho build</h3>
&lt;repositories&gt;
&lt;!-- configure p2 repository to resolve against --&gt;
&lt;repository&gt;
&lt;id&gt;eclipse-project-luna&lt;/id&gt;
&lt;id&gt;eclipse-project-2018-12&lt;/id&gt;
&lt;layout&gt;p2&lt;/layout&gt;
&lt;url&gt;http://download.eclipse.org/eclipse/updates/4.4milestones&lt;/url&gt;
&lt;url&gt;http://download.eclipse.org/eclipse/updates/4.10&lt;/url&gt;
&lt;/repository&gt;
&lt;/repositories&gt;</pre>
</li>
<li>In order to be independent of network access to eclipse.org:<ul>
<li>Open <tt>~/.m2/settings.xml</tt> (Linux/Mac) or <tt>%USERPROFILE%/.m2/settings.xml</tt> (Windows)</li>
<li>Replace the mirror URL <tt>file:/TODO/path/to/tutorial/p2_repository</tt> with a real <tt>file:</tt> URL pointing to your
<a href="../../p2_repository">local copy of the p2 repository from the USB stick</a>
</li></ul>
<br />This p2 repository contains a subset of the Eclipse Project Luna M6 repository.
</li></ul>
</ul>
</li>

<li>Run the build of <tt>tychodemo.parent</tt> again, e.g. by right-clicking on <tt>tychodemo.parent > Run As > Maven build</tt>
Expand Down
Binary file modified exercises/Exercise_01_Create_RCP_Bundle/resources/new_e4_app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ <h3>Importing the refactored project</h3>
<br /><img src="../resources/import.png" />
<br /><img src="../resources/import_2.png" />
</li>
<li>Right-click on <tt>tychodemo.parent > Run As > Maven build</tt>, enter the goals <tt>clean install</tt>.
If you see a dialog labeled <tt>Setup Maven plugin connectors</tt> click <tt>Finish</tt>. If you see an <tt>Install</tt> dialog asking you to install <tt>Tycho Projector Configurators</tt>, do so.
<li>Right-click on <tt>tychodemo.parent > Run As > Maven build</tt>. If you get a dialog asking for goals, enter the goals <tt>clean install</tt>.
<br />The build should succeed and build two modules:
<br /><img src="../resources/build_success.png" />
</li>
Expand Down Expand Up @@ -60,7 +61,7 @@ <h3>Adding a JUnit test</h3>
<li>Open <tt>AboutHandler.java</tt>, select the about text string, right-click <tt>Refactor > Extract Method</tt>
<br /><img src="../resources/extract_method.png" />
</li>
<li>Enter the method name <tt>getGreeting</tt> and select the <tt>default</tt> access modifier
<li>Enter the method name <tt>getGreeting</tt> and select the <tt>package</tt> access modifier
<br /><img src="../resources/extract_method_2.png" />
</li>
</ul></li>
Expand Down Expand Up @@ -112,7 +113,8 @@ <h3>Running the JUnit test in the build</h3>
</ul>
Expected results: <ul>
<li>You may get an error "Project configuration is not up to date".
If this is the case, right-click on <tt>tychodemo.bundle.tests > Maven > Update Project...</tt>, select the project and click <tt>OK</tt>
If this is the case, right-click on <tt>tychodemo.bundle.tests > Maven > Update Project...</tt>, select the project. If you see a message
asking if you should include other projects that need to be updated, click the link in the message to include it/them. Then click <tt>OK</tt>
</li>
<li>The <tt>tychodemo.bundle.tests</tt> project is now listed as module in the parent POM.
(This means that it will be included in the build reactor when triggering a build on the parent POM.)
Expand All @@ -132,7 +134,8 @@ <h3>Running the JUnit test in the build</h3>
<li>Implement the test and run it again: <ul>
<li>Assert that <tt>getGreeting()</tt> contains <tt>"Tycho Demo"</tt>
<br /><img src="../resources/test_impl.png" />
<br />(<a href="../../Exercise_03_Add_Feature/tychodemo.bundle.tests/src/tychodemo/bundle/handlers/AboutHandlerTest.java">Possible solution</a>)
<br />(<a href="../../Exercise_03_Add_Feature/tychodemo.bundle.tests/src/tychodemo/bundle/handlers/AboutHandlerTest.java">Possible solution</a>). If you use this possible
solution, you may see an error that CoreMatchers cannot be resolved. If so, select <tt>Import 'CoreMatchers' (org.hamcrest)</tt> from the list of Content Assist choices.
</li>
<li>Execute the test in Eclipse, e.g. by selecting the <tt>AboutHandlerTest</tt> launch configuration from the launch history
<br /><img src="../resources/launch_history.png" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

<!-- common settings for all modules -->
<properties>
<tycho-version>0.20.0</tycho-version>
<tycho-version>1.3.0</tycho-version>
</properties>

<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>eclipse-project-luna</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/4.4milestones</url>
<url>http://download.eclipse.org/eclipse/updates/4.10</url>
</repository>
</repositories>

Expand Down
6 changes: 3 additions & 3 deletions exercises/Exercise_03_Add_Feature/tychodemo.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

<!-- common settings for all modules -->
<properties>
<tycho-version>0.20.0</tycho-version>
<tycho-version>1.3.0</tycho-version>
</properties>

<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>eclipse-project-luna</id>
<id>eclipse-project-2018-12</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/4.4milestones</url>
<url>http://download.eclipse.org/eclipse/updates/4.10</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

<!-- common settings for all modules -->
<properties>
<tycho-version>0.20.0</tycho-version>
<tycho-version> 1.3.0</tycho-version>
</properties>

<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>eclipse-project-luna</id>
<id>eclipse-project-2018-12</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/4.4milestones</url>
<url>http://download.eclipse.org/eclipse/updates/4.10</url>
</repository>
</repositories>

Expand Down
Binary file modified exercises/Exercise_05_Add_Product/resources/feature_based.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 4 additions & 9 deletions exercises/Exercise_05_Add_Product/tychodemo.parent/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,11 @@ <h3>Building a product distribution</h3>
<li>Configure the start levels and auto-start settings of the product: <ul>
<li>Open the <tt>tychodemo.bundle.product</tt> product definition</li>
<li>Switch to the <tt>Configuration</tt> tab</li>
<li>In the <tt>Start Levels</tt> section, click on <tt>Add...</tt>
<li>In the <tt>Start Levels</tt> section, click on <tt>Add Recommended...</tt>
<br /><img src="../resources/start_levels_add.png" />
</li>
<li>Select the bundles <tt>org.eclipse.equinox.common</tt> and <tt>org.eclipse.equinox.ds</tt> and hit <tt>OK</tt>
<br /><img src="../resources/start_levels_add_equinox.png" />
</li>
<li>For both bundles, set the start level to <tt>2</tt> and auto-start to <tt>true</tt></li>
<li>Click <tt>Add...</tt> again and add the bundle <tt>org.eclipse.core.runtime</tt></li>
<li>For <tt>org.eclipse.core.runtime</tt> only set auto-start to <tt>true</tt>
<br /><img src="../resources/start_levels.png" />
<li>You will see a dialog with a list of recommended start levels for some plug-ins similar to the following. Click <tt>OK</tt>.
<br /><img src="../resources/start_levels_add_recommended.png" />
</li>
</ul></li>

Expand All @@ -65,7 +60,7 @@ <h3>Building a product distribution</h3>
<li>Select "The product configuration is based on <tt>features</tt>"
<br /><img src="../resources/feature_based.png" />
</li>
<li>On the <tt>Dependencies</tt> tab, click on <tt>Add...</tt> and select the <tt>tychodemo.feature</tt>, and hit <tt>OK</tt></li>
<li>On the <tt>Contents</tt> tab, click on <tt>Add...</tt> and select the <tt>tychodemo.feature</tt>, and hit <tt>OK</tt></li>
<li>In the same way, add the feature <tt>org.eclipse.rcp</tt>
<br /><img src="../resources/feature_add_rcp.png" />
</li>
Expand Down
6 changes: 3 additions & 3 deletions exercises/Exercise_05_Add_Product/tychodemo.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

<!-- common settings for all modules -->
<properties>
<tycho-version>0.20.0</tycho-version>
<tycho-version>1.3.0</tycho-version>
</properties>

<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>eclipse-project-luna</id>
<id>eclipse-project-2018-12</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/4.4milestones</url>
<url>http://download.eclipse.org/eclipse/updates/4.10</url>
</repository>
</repositories>

Expand Down
6 changes: 3 additions & 3 deletions exercises/Exercise_05_Solution/tychodemo.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

<!-- common settings for all modules -->
<properties>
<tycho-version>0.20.0</tycho-version>
<tycho-version>1.3.0</tycho-version>
</properties>

<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>eclipse-project-luna</id>
<id>eclipse-project-2018-12</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/4.4milestones</url>
<url>http://download.eclipse.org/eclipse/updates/4.10</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@

<windowImages/>

<launcher>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
<plugin id="com.ibm.icu"/>
<plugin id="javax.annotation"/>
Expand Down Expand Up @@ -110,16 +119,18 @@

<features>
<feature id="tychodemo.feature" version="1.0.0.qualifier"/>
<feature id="org.eclipse.rcp" version="4.4.0.v20140306-1200"/>
<feature id="org.eclipse.rcp"/>
<feature id="org.eclipse.emf.ecore"/>
<feature id="org.eclipse.e4.rcp"/>
<feature id="org.eclipse.emf.common"/>
</features>

<configurations>
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>

</product>