Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "MemoryAnalyzer/Building MAT With Tycho"

m (Where to find results?)
(Hudson Job at Eclipse)
(22 intermediate revisions by 4 users not shown)
Line 4: Line 4:
 
* build all bundles and features
 
* build all bundles and features
 
* execute all tests
 
* execute all tests
* (optional) run findbugs static checks
+
* (optional) run [http://findbugs.sourceforge.net/ FindBugs] static checks
 
* produce a p2 repository with MAT features
 
* produce a p2 repository with MAT features
 
* produce RCPs for different platforms
 
* produce RCPs for different platforms
 +
* sign and upload the produced artifacts (when executed on the Eclipse Hudson server)
  
 
== Prerequisites ==
 
== Prerequisites ==
 +
 +
=== Git ===
 +
MAT sources are in a Git repository, therefore you need a git client.
  
 
=== Maven Installation ===
 
=== Maven Installation ===
The Memory Analyzer build requires a Maven 3.0.* installation. It is already present on the Hudson server at Eclipse. For local build one can download it from here http://maven.apache.org/download.html.
+
The Memory Analyzer build requires a Maven 3.0.* installation. It is already present on the Hudson server at Eclipse. For local build one can download it from [http://maven.apache.org/download.html here].
  
 
=== Proxy Settings ===
 
=== Proxy Settings ===
If you need to set proxy for Maven, a snippet like this can be added to the Maven settings file:
+
If you need to set a proxy for Maven, a snippet like this can be added to the Maven settings file:
 +
<source lang="xml">
 
   <proxies>
 
   <proxies>
 
     <proxy>
 
     <proxy>
Line 24: Line 29:
 
     </proxy>
 
     </proxy>
 
   </proxies>
 
   </proxies>
 
+
</source>
 
More information on Maven settings: http://maven.apache.org/ref/3.0.3/maven-settings/settings.html
 
More information on Maven settings: http://maven.apache.org/ref/3.0.3/maven-settings/settings.html
  
== Preparation Steps ==
+
== Checkout MAT Sources from Git ==
=== Which preparation steps are performed? ===
+
Have a look at [[MemoryAnalyzer/Contributor_Reference#Get the source]]
Parts of MAT depend on the IBM's DTFJ libraries, therefore one needs the libraries during the build.
+
This preparation step will do the following:
+
* download DTFJ (zipped "old" update site)
+
* publish a p2 repository with DTFJ
+
* modify the target platform definition used for the rest of the build
+
 
+
=== Execute the parparation step ===
+
* Go in the ''<mat_src>/prepare_build/'' directory
+
* Execute
+
<pre>mvn clean install</pre>
+
* This maven build is using the maven-antrun plugin to download the zip containing DTFJ. If you need to set proxy you can do it using the standard Java settings, i.e. the command line will look like this:
+
<pre>mvn -Dhttp.proxyHost=myProxyHost -Dhttp.proxyPort=myProxyPort clean install</pre>
+
 
+
On the Hudson boxes at Eclipse the settings are defined as $ANT_OPTS
+
 
+
=== Verify ===
+
If the build was successful, then:
+
* ''<mat_src>/prepare_build/target/repository/'' will contain the p2 repository with DTFJ
+
* ''<mat_src>/org.eclipse.mat.targetdef/mat-site.target'' will be modified to point to this repository
+
  
 
== Building MAT ==
 
== Building MAT ==
Once the [[#Preparation Steps]] are done (normally only once) one can run the maven build for MAT.
 
  
 
=== Execute the build ===
 
=== Execute the build ===
* Go to the root of the sources (there is the parent pom.xml), i.e. ''<mat_src>/pom.xml''
+
* Open a console and go into the ''<mat_src>/parent'' folder (there is the parent pom.xml)
* To simply build MAT execute
+
* To build MAT execute
 
<pre>mvn clean install</pre>
 
<pre>mvn clean install</pre>
* To build MAT and perform findbugs checks execut
+
* To build MAT and perform FindBugs checks execute
 
<pre>mvn clean install findbugs:findbugs</pre>
 
<pre>mvn clean install findbugs:findbugs</pre>
 +
 
=== Where to find the results? ===
 
=== Where to find the results? ===
 
You can find the results of the build in the corresponding .../target/ directories for each plugin, feature, etc... Of particular interest are:
 
You can find the results of the build in the corresponding .../target/ directories for each plugin, feature, etc... Of particular interest are:
 
* ''<mat_src>/org.eclipse.mat.updatesite/target/site/'' - it contains a p2 repository with MAT features
 
* ''<mat_src>/org.eclipse.mat.updatesite/target/site/'' - it contains a p2 repository with MAT features
* ''<mat_src>/product/target/products/'' - it contains all standalone RCP applications
+
* ''<mat_src>/org.eclipse.mat.product/target/products/'' - it contains all standalone RCP applications
  
 
== Further Information ==
 
== Further Information ==
* The platforms for which RCPs are built are specified in the ''<mat_src>/pom.xml'' file
+
* The platforms for which RCPs are built are specified in the ''<mat_src>/parent/pom.xml'' file
* There are two script files (''build.bat'' and ''build.sh'') which should combine the preparation steps and the real build. However, both still need some improvements
+
  
 
== Known Problems ==
 
== Known Problems ==
=== Can't build RCPs for Mac ===
 
The problem is reported here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=313997. Putting a patched o.e.equinox.p2.publisher.jar under ''<maven_repository>/org/sonatype/tycho/tycho-p2-runtime/0.11.0/eclipse/plugins/'' helps for local build.
 
 
=== Wrong file permissions ===
 
=== Wrong file permissions ===
When building MAT on a Windows box, the RCPs for any other OS will not have the proper permissions (e.g. the executables won't have the x flag). Building under Lunix or other non-Windows OS helps.
+
When building MAT on a Windows box, the RCPs for any other OS will not have the proper permissions (e.g. the executables won't have the x flag). Building under Linux or other non-Windows OS helps.
  
 
== Hudson Job at Eclipse ==
 
== Hudson Job at Eclipse ==
The job at the Eclise Hudson server that performs this build is https://hudson.eclipse.org/hudson/job/tycho-mat-nightly/.
+
The job at the Eclise Hudson server that performs this build is https://hudson.eclipse.org/mat/.
 +
 
 +
The job is configured to sign the plugins and features in the update site, and to upload all artifacts to the download server.
 +
One can download such nightly/snapshot builds here: http://www.eclipse.org/mat/snapshotBuilds.php
 +
 
 +
Info: Signing is activated by the build-server profile (i.e. with parameter '-P build-server' added to the maven command)
  
There are still a number of TODOs:
+
[[Category:Memory Analyzer]]
* sign the jars of the update site automatically. Hopefully this can help (haven't tried yet): http://aniszczyk.org/2011/05/18/eclipse-org-signing-support-for-maven-tycho/
+
* publish nightly results on the download server
+

Revision as of 09:22, 14 December 2015

Introduction

This page describes how Memory Analyzer can be built using Maven/Tycho. The build will

  • build all bundles and features
  • execute all tests
  • (optional) run FindBugs static checks
  • produce a p2 repository with MAT features
  • produce RCPs for different platforms
  • sign and upload the produced artifacts (when executed on the Eclipse Hudson server)

Prerequisites

Git

MAT sources are in a Git repository, therefore you need a git client.

Maven Installation

The Memory Analyzer build requires a Maven 3.0.* installation. It is already present on the Hudson server at Eclipse. For local build one can download it from here.

Proxy Settings

If you need to set a proxy for Maven, a snippet like this can be added to the Maven settings file:

  <proxies>
    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <port>8080</port>
      <host>myproxy_host</host>
      <nonProxyHosts>non_proxy_hosts</nonProxyHosts>
    </proxy>
  </proxies>

More information on Maven settings: http://maven.apache.org/ref/3.0.3/maven-settings/settings.html

Checkout MAT Sources from Git

Have a look at MemoryAnalyzer/Contributor_Reference#Get the source

Building MAT

Execute the build

  • Open a console and go into the <mat_src>/parent folder (there is the parent pom.xml)
  • To build MAT execute
mvn clean install
  • To build MAT and perform FindBugs checks execute
mvn clean install findbugs:findbugs

Where to find the results?

You can find the results of the build in the corresponding .../target/ directories for each plugin, feature, etc... Of particular interest are:

  • <mat_src>/org.eclipse.mat.updatesite/target/site/ - it contains a p2 repository with MAT features
  • <mat_src>/org.eclipse.mat.product/target/products/ - it contains all standalone RCP applications

Further Information

  • The platforms for which RCPs are built are specified in the <mat_src>/parent/pom.xml file

Known Problems

Wrong file permissions

When building MAT on a Windows box, the RCPs for any other OS will not have the proper permissions (e.g. the executables won't have the x flag). Building under Linux or other non-Windows OS helps.

Hudson Job at Eclipse

The job at the Eclise Hudson server that performs this build is https://hudson.eclipse.org/mat/.

The job is configured to sign the plugins and features in the update site, and to upload all artifacts to the download server. One can download such nightly/snapshot builds here: http://www.eclipse.org/mat/snapshotBuilds.php

Info: Signing is activated by the build-server profile (i.e. with parameter '-P build-server' added to the maven command)

Back to the top