23
A journey with Target Platforms Mickael Istria @mickaelistria EclipseCon Europe 2012 Licensed under CC-BY 3.0

A journey with Target Platforms

Embed Size (px)

DESCRIPTION

Slides from EclipseCon Europe 2012 session "A journey with Target Platforms". This presentation contains some tips on tricks on how to leverage Eclipse target platforms at development time and build time, based n experiences from JBoss Tools team.

Citation preview

Page 1: A journey with Target Platforms

A journey withTarget Platforms

Mickael Istria @mickaelistriaEclipseCon Europe 2012Licensed under CC-BY 3.0

Page 2: A journey with Target Platforms

“Which dependencies are available?”

Target Platforms...

Page 3: A journey with Target Platforms

Before Target-Platforms

PDE

EGit

MylynJBoss Tools 4.0

Eclipse Core 4.2

GMF Tooling

IDE

Depends onDoes NOT depend on

Depends on ANOTHER VERSION

PDE allows you to add dependency to any bundle from IDE

Default TP

Bundle B

Feature F

Workspace

Page 4: A journey with Target Platforms

Default Target-Platforms

PDE

EGit

MylynJBoss Tools 4.0

Eclipse Core 4.2

GMF Tooling

IDE

Depends onDoes NOT depend on

Depends on ANOTHER VERSION

PDE allows you to add dependency to any bundle from IDE

Default TP

Bundle B

Feature F

Workspace

Page 5: A journey with Target Platforms

Target-platforms

p2 Repo Ap2 Repo A● Bundle B1 (1.0.0)● Bundle B2 (1.0.0)● Feature F1 (1.0.0)

p2 Repo Bp2 Repo B● Bundle B1 (1.3.0)● Bundle B3 (1.0.0)● Feature F1 (1.3.0)

Local Filesystem● Bundle B3 (1.0.0)● Bundle B4 (5.1.201)

Specify available dependencies in PDE Workspace or Maven Reactor.

Local Filesystem● Feature F1 (1.2.0)● Feature F3 (1.0.0)● Feature F4 (5.1.201)

Local Filesystem● RCP app (“installation”)

● plugins/*

My dependencies set:a .target file

Page 6: A journey with Target Platforms

Edit Target Platforms

From Preferences

Page 7: A journey with Target Platforms

Edit Target Platforms

With Target Editor

Page 8: A journey with Target Platforms

Edit Target Platforms as XML

Page 9: A journey with Target Platforms

Include Sources in IDE

But not in Tycho ;)

Page 10: A journey with Target Platforms

Planner vs Slicer

Planner tries to get dependencies – and fails when it can't. [~p2 director]Slicer just takes what you want it to take. [~p2 mirror]

Page 11: A journey with Target Platforms

Use TP in IDE

OR

Page 12: A journey with Target Platforms

Use TP in a Maven build

Page 13: A journey with Target Platforms

Separate Tools and Dependencies

PDE

EGit

MylynJBoss Tools 4.0

Eclipse Core 4.2

GMF Tooling

IDE

Bundle B

Feature F

Workspace

JBoss Tools 3.3 repo

Eclipse Indigo repo● Eclipse Core 3.7

EGit repo

Managed TP

Page 14: A journey with Target Platforms

Target for compatibility: Example

● JBoss Tools– 1 target for “minimal dependencies” ensures we can

build and run against our minimal requirements

– 1 target for “recommended dependencies” ensures we can build and run against latest versions of deps

● JBoss Developer Studio (install into Eclipse)– 1 target for “minimal”

– 1 target for “recommended”

● JBoss Developer Studio (RCP)– Uses “recommended” for product build

Same one

Page 15: A journey with Target Platforms

Develop for an “old” product

PDE

EGit

MylynJBoss Tools 4.0

Eclipse Core 4.2

GMF Tooling

IDE

Managed TP

Bundle A(1.1.0)

Workspace

Without loading all code as projects in your workspace

Bundle C

Older RCP app● Bundle A (1.0.0)● Bundle B● Feature F

IDE only!Does not work with Tycho

Page 16: A journey with Target Platforms

Share TP: on SCM

Page 17: A journey with Target Platforms

Share TP: “mvn deploy” it

Page 18: A journey with Target Platforms

Performances: aggregate

repoA repoB

repoC

repoDrepoE

aggregatedmultiple

Aggregated repo

● Create a new site + a new .target file

● 2 Maven Mojos available– “Flatten” platform (multiple to aggregated)

org.jboss.tools.tycho-plugins:repository-utils:0.0.1-SNAPSHOT:flattern-target

– TP to p2 repoorg.jboss.tools.tycho-plugins:repository-utils:0.0.1-SNAPSHOT:mirror-target-to-repo

Page 19: A journey with Target Platforms

Performances: mirrors

remote piiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing Remote repo

remote

+

Mirror defintionIn settings.xml

Local mirror repoping

http://wiki.eclipse.org/Tycho/Target_Platform/Authentication_and_Mirrors#Mirrors

Page 20: A journey with Target Platforms

Missing concept: project-specific TP

● PDE only allows 1 TP for the whole workspace– Finer grain would be convenient

– https://bugs.eclipse.org/bugs/show_bug.cgi?id=159072

● Tycho already supports “project-specific” TP.– Could PDE rely on m2e and Tycho to use TP specified in

project pom?

Page 21: A journey with Target Platforms

Missing concept: “compound” TP

Compose, use multiple or reference target-platforms– 1 .target for general deps (Eclipse.org, GWT...)

– Each project adds its specific extra deps

– Not supported in PDE nor Tycho● https://bugs.eclipse.org/bugs/show_bug.cgi?id=392652

● https://bugs.eclipse.org/bugs/show_bug.cgi?id=380120

– Maven plugin to merge targets● https://github.com/jbosstools/jbosstools-maven-plugins

Page 22: A journey with Target Platforms

Related (?) topics

● Most p2 repo are not sustainable– https://bugs.eclipse.org/bugs/show_bug.cgi?id=331385

– Mirror and manage them locally

● Still no link between Eclipse/p2/Tycho and SpringSource EBR– Would be useful to allow EBR bundles in a TP

– https://issuetracker.springsource.com/browse/EBR-868

Page 23: A journey with Target Platforms

Questions?Discussions?

Debates?

Mickael Istria @mickaelistriaEclipseCon Europe 2012Licensed under CC-BY 3.0