Professional Documents
Culture Documents
Textbook Eclipse Tea Revealed Building Plug Ins and Creating Extensions For Eclipse Markus Duft Ebook All Chapter PDF
Textbook Eclipse Tea Revealed Building Plug Ins and Creating Extensions For Eclipse Markus Duft Ebook All Chapter PDF
https://textbookfull.com/product/java-ee-development-with-
eclipse-second-edition-ram-kulkarni/
https://textbookfull.com/product/java-ee-development-with-
eclipse-1st-edition-vohra-deepak/
https://textbookfull.com/product/designing-software-synthesizer-
plug-ins-in-c-with-audio-dsp-2nd-edition-will-c-pirkle/
https://textbookfull.com/product/the-eclipse-of-community-mental-
health-and-erich-lindemann-1st-edition-david-g-satin/
The Eclipse of Community Mental Health and Erich
Lindemann 1st Edition David G Satin
https://textbookfull.com/product/the-eclipse-of-community-mental-
health-and-erich-lindemann-1st-edition-david-g-satin-2/
https://textbookfull.com/product/the-eclipse-of-equality-arguing-
america-on-meet-the-press-1st-edition-solon-simmons/
https://textbookfull.com/product/your-guide-to-the-2017-total-
solar-eclipse-1st-edition-michael-e-bakich-auth/
https://textbookfull.com/product/eclipse-of-god-studies-in-the-
relation-between-religion-and-philosophy-first-princeton-
university-press-paperback-edition-batnitzky/
https://textbookfull.com/product/practical-domain-driven-design-
in-enterprise-java-using-jakarta-ee-eclipse-microprofile-spring-
boot-and-the-axon-framework-1st-edition-vijay-nair/
Eclipse TEA
Revealed
Building Plug-ins and Creating
Extensions for Eclipse
—
Markus Duf t
Eclipse TEA Revealed
Building Plug-ins and Creating
Extensions for Eclipse
Markus Duft
Eclipse TEA Revealed: Building Plug-ins and Creating Extensions
for Eclipse
Markus Duft
Peggau, Steiermark, Austria
v
Table of Contents
Chapter 4: Logging�����������������������������������������������������������������������������45
Using TaskingLog������������������������������������������������������������������������������������������������46
Tasking Live View������������������������������������������������������������������������������������������������47
Chapter 5: Tasks���������������������������������������������������������������������������������53
Naming����������������������������������������������������������������������������������������������������������������54
Return Values������������������������������������������������������������������������������������������������������56
Output Capturing�������������������������������������������������������������������������������������������������57
Chapter 6: TaskChains������������������������������������������������������������������������59
Headless vs. UI����������������������������������������������������������������������������������������������������60
Using UI to Configure a TaskChain�����������������������������������������������������������������63
Identifying a TaskChain����������������������������������������������������������������������������������65
XVFB and Friends������������������������������������������������������������������������������������������71
Updates���������������������������������������������������������������������������������������������������������72
Configuration�������������������������������������������������������������������������������������������������73
Life Cycle������������������������������������������������������������������������������������������������������������73
Headless Life Cycle���������������������������������������������������������������������������������������76
Chapter 7: Configuration��������������������������������������������������������������������79
Configuration Sources�����������������������������������������������������������������������������������������83
Runtime Configuration Updates��������������������������������������������������������������������������84
vi
Table of Contents
Chapter 9: Statistics���������������������������������������������������������������������������97
Enabling Statistics Reporting������������������������������������������������������������������������������97
Default and Custom Statistics�����������������������������������������������������������������������������99
vii
Table of Contents
Index�������������������������������������������������������������������������������������������������163
viii
About the Author
Markus Duft has been working as a Platform
Architect (C/C++, Java, and Eclipse Expert)
at SSI Schaefer IT Solutions for more
than 12 years. His responsibilities include
creating custom Eclipse IDE extensions
as well as developing the whole headless
build infrastructure for large-scale Eclipse-
RCP-based products. In his spare time, he is
developing a hobbyist OS kernel in assembler
and C. He has spoken at various EclipseCon events around the world
(US, France, and Germany) about Eclipse TEA, its predecessor (WAMAS
Power Build), and related topics, including launch configurations. Markus
has been published in the German periodical Eclipse Magazin.
ix
About the Technical Reviewer
Manuel Jordan Elera is an autodidactic
developer and researcher who enjoys learning
new technologies for his own experiments and
creating new integrations. Manuel won the
Springy Award—Community Champion and
Spring Champion 2013. In his little free time,
he reads the Bible and composes music on his
guitar. Manuel is known as dr_pompeii. He
has tech-reviewed numerous books for Apress,
including Pro Spring, 4th Edition (2014),
Practical Spring LDAP (2013), Pro JPA 2, 2nd Edition (2013), and Pro
Spring Security (2013). Read his 13 detailed tutorials about many Spring
technologies, contact him through his blog at www.manueljordanelera.
blogspot.com, and follow him on his Twitter account, @dr_pompeii.
xi
Acknowledgments
A big thanks goes to SSI Schaefer IT Solutions as a whole and especially
my direct management, who made it possible to create Eclipse TEA in the
first place. It would not exist without the dedication to open source of my
colleagues.
xiii
CHAPTER 1
About TEA
Welcome! Take a seat. Relax. Grab some coffee. (You all drink coffee,
right?) I am not going to discuss too much rocket science. If you read this
book’s back cover, you already know that this book is about extending
the Eclipse IDE1 with additional functionality through Eclipse TEA.2
As you make your way through the book, you will see that this can be a
surprisingly simple task.
In this chapter, I will introduce Eclipse TEA and shed some light on its
history.
1
h ttp://www.eclipse.org/
2
http://www.eclipse.org/tea/
A few years ago, in the good old days of Apache Ant,3 we were
engineering a large-scale logistics application. For various reasons, Eclipse
RCP4 was chosen as this application’s platform. Even for server-side
applications, we used the exact same setup, except without the UI parts of
Eclipse RCP. This application was extremely large; it had roughly six million
lines of code and was composed of approximately 650 OSGi5 bundles.
In order to maintain metadata, such a huge application required heavy
lifting by both Eclipse and the developers’ hardware (at that time), and the
developers themselves.
When taking into account the build system (Apache Ant) for headless
builds (in other words, running a build without any UI and usually
running on a server without a monitor attached in the first place), we
understood the need for very lengthy and hard-to-maintain build XML
files. Additionally, there were dozens of property files containing plug-in
and feature versions to build and to include in update sites.
As a consequence, we had literally weeks where not a single nightly
build succeeded even though workspaces in the IDEs of the developers
were OK all along, meaning that builds and tests were successful. They just
forgot to maintain the additional metadata (or did it wrong unknowingly).
Developers never even had a chance to test nightly builds because they
required a very special setup that was nearly impossible to reproduce on
individual workplaces.
Another reason for the very complex and complicated build setup
was our model driven approach. There were a few code generators, which
were building upon code in the workspace; these generated code with
input from some projects into other projects. This required us to do the
following:
3
h ttps://ant.apache.org/
4
https://wiki.eclipse.org/Rich_Client_Platform
5
https://www.osgi.org/
2
Chapter 1 About TEA
Eclipse does allow adding additional builders per project, but this is
not what we wanted. We required some orchestration on top of the normal
build process since the generators had multiple source projects, multiple
input projects, and multiple output projects.
In the IDE, the developer performed this orchestration. Usually,
Eclipse performed the automatic build until the first bits were compiled.
(In this state, the workspace was basically full of compile errors due to
missing generated code in all other projects.) Now generators could be
run manually to provide the next bits of code to compile. This process was
repeated until all generators had been run—a tedious job. In the headless
builds, there were Apache Ant scripts, which basically did the same. Due to
frequent changes in projects setups (new, removed, renamed projects, and
so on), these scripts were basically always out of sync with reality.
Things continued this way until some developers had enough. They
had the idea to provide some automation to the most annoying steps in
the process, along with simplifying headless setups. This was the birth of
WPoB—short for WAMAS (the product’s name) Power Build. It was later
rewritten and rebranded as Eclipse TEA.
3
Chapter 1 About TEA
TEA Is Born
The initial idea of TEA was to be able to do the following:
4
Chapter 1 About TEA
references. In our case, it seemed to come up with a rather bad order that
resulted in Eclipse running in circles trying to compile certain projects
over and over again, although their prerequisite projects were not yet
compiled. Along with our generators, which interrupted the build process
multiple times along the way, there was no chance to find a good ordering
any way in the first place.
Eclipse TEA’s build library does not have this problem. It adds an
orchestrator that calculates a graph up front, allowing for manipulating
and influencing this graph. Other than Eclipse’s build order, this graph
cannot be influenced by configuration of Eclipse. However, it can be
extended and manipulated via code. I will provide a detailed description of
this mechanism later in this book.
But there is more. Looking at the current open source Ecosystem,
reading mailing lists, and so on, you will likely discover mails discussing
how to prevent the fact that certain ways of working break things for others
working in a different way. For example, projects where half the developers
use Eclipse and the other half does not fall into this category. Headless
builds are also usually performed without Eclipse (they are rather
performed by tools like Apache Maven,6 Gradle,7 and so on), so the ones
avoiding Eclipse all together might easily break things for the others. In
this case, it can help to have an additional build performed using Eclipse,
which is a simple task using Eclipse TEA.
What I have described so far is actually only an optional part of today’s
Eclipse TEA (called “Eclipse TEA build library”). The core of TEA was a
byproduct of our initial efforts to get the builds, as previously described.
To be able to encapsulate the individual steps of the builds (building,
generating code, and so on), a rudimentary task-based execution engine
was implemented. It had the capability to execute a TaskChain, which
configured a series of certain Task objects to be executed. The concepts of
6
h ttps://maven.apache.org/
7
https://gradle.org/
5
Chapter 1 About TEA
Task and TaskChain are at the heart of TEA and are mentioned in all of the
subsequent chapters.
Building upon these concepts, we implemented the things we
wanted to perform in the IDE or in headless environments as tasks. This
implementation paid off more than once because it was easy to reuse tasks
in headless environments.
6
Chapter 1 About TEA
• Run "FindBugs"
Now that I have told you what is possible, I must inform you that not
all of this is (yet) in the open source Eclipse TEA. A lot of this code is still
closed source (but there is the intention to open source everything which
is not too specific to the company—meaning everything that does not hard
code concepts of the software we are building).
I include it here so you can get a picture of what is feasible to be
implemented using Eclipse TEA.
7
CHAPTER 2
Getting Started
To begin developing Eclipse extensions using TEA, you will need an
Eclipse Workspace with a target platform configured to include TEA. The
target platform in Eclipse defines the target environment to compile for.
We want to develop components for TEA, thus the Eclipse IDE and TEA
have to be defined as our target platform. The easiest way to achieve this is
to install a TEA workspace using the Eclipse installer. You can also install
TEA into an existing Eclipse installation and use the Running Platform
target. Note that this is not (always) recommended for production setups
since the Running Platform may not be stable across setups. (In other
words, a developer might want to install additional software. In this case,
the developer could write code that references the code installed in their
private Eclipse installation, which will not work for any other developer.) It
is always a good idea to have a well-defined target platform.
At the time of writing, TEA requires at least Java 8 (and is tested up
to Java 10), and it requires a target platform that includes PDE and JDT—
that is, you need to install an according Eclipse package. I recommend
either Eclipse for RCP and RAP Developers or Eclipse IDE for Eclipse
Committers. It is not mandatory to use one of them, but they contain
everything required from the start. I will use the latter one for all the
samples in this book. If you want to use a different setup, you can do so as
long as the required parts (PDE, JDT, and Launch Configuration View1) are
installed. TEA should run equally well on those setups.
1
http://marketplace.eclipse.org/content/launch-configuration-view
E clipse Setup
Download the Eclipse Installer from the official Eclipse website,2 as shown
in Figure 2-1.
2
http://www.eclipse.org/downloads/packages/installer
10
Chapter 2 Getting Started
11
Chapter 2 Getting Started
In the next step, you can select a project you want to work on. In this
case, make sure to select Eclipse TEA, as shown in Figure 2-4.
12
Chapter 2 Getting Started
The last page of the installer allows you to tweak the setup even more
(for example, the installation folder). No changes are required to get
started, so you can confirm the defaults and finish the wizard.
Note The quick start will provide you with a “good” setup, using a
dedicated target platform instead of using Running Platform. It
includes all required components to get you started.
The wizard will start the resulting Eclipse installation in order to finish
setting up the workspace. This will take a few seconds. Unfortunately, the
only indication of the work being done is a tiny spinning icon in the status
bar at the bottom of the Eclipse window. However, you can click this icon
to see a more detailed version of the progress.
13
Chapter 2 Getting Started
Note You can skip this section if you followed the previous
instructions. This section is provided for reference in case you want
to reuse an existing Eclipse installation or build one from scratch.
Using the manual route, there are two ways of getting started with
TEA: using binaries from the official update site, or cloning and importing
the TEA source repository. Both methods should lead to comparable
results—the second one being quite close to the quick start variant.
Using the source repository has the advantage of being able to look at the
source code of TEA more easily. The downside is that you need to have
all dependencies to build TEA available from the target platform (that is,
installed into your Eclipse when using the Running Platform target). It is
also not recommended to have the TEA source code in a workspace where
you develop components for production use.
3
ead more about target platforms in general at https://help.eclipse.org/
R
photon/topic/org.eclipse.pde.doc.user/concepts/target.htm
14
Chapter 2 Getting Started
15
Chapter 2 Getting Started
Note The same method can be used for LcDsl, which you will need
that later on. Install LcDsl from the updated site: https://mduft.
github.io/lcdsl-latest/. I suggest installing both features:
Launch Configuration DSL
Launch Configuration View
(See Figure 2-6.)
16
Chapter 2 Getting Started
17
Chapter 2 Getting Started
18
Chapter 2 Getting Started
4
https://github.com/apress/eclipse-tea-revealed
19
Another random document with
no related content on Scribd:
‘Malignant—malevolent—uncandid—spiteful—envious—pitiful—mean,’
responded Fenno—and so throughout the summer and autumn the epithets
were hurled, the war in the East more venomous than that on the western
front.
Meanwhile, Hamilton rode on, close to Washington’s ears, contemptuous
of the attacks. Never had he had less respect for democracy. ‘It is long since
I have learned to hold popular opinion of no value,’ he wrote Washington
after the President had returned to Philadelphia, leaving him in actual
command.[953] ‘Without rigor everywhere,’ he wrote King at the same time,
‘our tranquillity will be of very short duration.’[954] It was the tone of
Federalist society in Philadelphia that led Bond, the British Consul, in a
letter to Grenville, to comment that ‘the establishment of a national force to
strengthen the hands of the executive party can alone secure the existing
form of government.’[955] As the brilliant young leader rode along the
wood-lined roads, aflame with the colors of the fall, his plans for the
capitalization of the insurrection for his party were made. The Executive
should have more power, with an army of some pretensions to enforce the
laws. The Democratic Societies that had awakened the political arrogance
of the masses should be crushed. Attacks on governmental measures should
be associated with disloyalty to the State. Perhaps on this trip Albert
Gallatin, the one financial genius among the Jeffersonians, could be ruined
—even indicted.[956] But the insurrection faded at the army’s approach.
Nowhere was opposition offered. Everywhere the soldiers met with cordial
receptions, albeit the liberty poles literally lined their way. Only an
occasional frontiersman in his cups made a weak show of hostility by
hurrahing for the Whiskey Boys.[957] The ringleaders and many who should
have been unmolested were arrested and sent to jail in Philadelphia under
military guard. They who fell to General White were brutally treated,
confined in damp cellars, tied back to back, kept in confinement from
Thursday until Sunday morning with scarcely anything to eat or drink. Most
of them were misguided youths who were redeeming an empire, and not a
few had fought in the war for independence. Most of these were acquitted
on trial. But when they reached the ferry at Schuylkill, they were forced to
decorate their hats with a paper bearing the inscription, ‘Insurgent.’ Thus
denounced, they were subjected to the humiliation of a march down Market
Street, like slaves at the chariot of a Roman conqueror, for the amusement
of fashionable ladies at the windows.[958]
A pitiful spectacle—that march—and more significant than many
realized. The soldiers were of the first Philadelphia families in wealth,
gorgeous in their blue uniforms made of the finest broadcloth, all mounted
on magnificent bay horses so nearly uniform in size and color that ‘any two
of them would make a fine span of coach horses.’ A proud show they made
with their superb trappings, their silver-mounted stirrups and martingales,
their drawn swords glistening in the sun. Patrician conquerors, these. And
their captives, mounted on nondescript plough and pack horses—old men
who had fought for American independence, young men, all bronzed by the
weather, some pale and sick, some sad, others flushed with fury that they
should be used to make a show for the rich Philadelphians who looked upon
them with complacent smiles. It was the East and the frontier—it was
Aristocracy with drawn sword and Democracy with the insulting paper in
its hat. The insurrection was over—a tempest in a teapot. A small army of
twenty-five hundred was left in the western country like an army of
occupation. Two men were found guilty of treason and pardoned by
Washington. The law was vindicated—now for the crushing of the
Democratic Societies.
VII
VIII
Before passing on to the mass attack on these societies, let us pause for a
hasty review of other happenings of that eventful summer and autumn.
Madison was in a tender mood. A little before he had fallen under the spell
of a merry widow whose glance was coquettish and whose tongue was
nimble. The early autumn found him married to Dolly Todd; the early
winter, cozily ensconced in the house the Monroes had occupied before
they went to France.[969]
In the house on the hilltop, Jefferson was living a quiet life. He was little
more than fifty, his hair touched with gray, his form erect, his step elastic,
his strength undiminished. With his daughters about him, all was gayety
about the blazing hearth in winter and on the lawn in summer. The
supervision of the plantation was to his taste. There were fences to be
repaired, trees to be planted. He was interested in the growth of potatoes.
He rode about ordering the uprooting of weeds here and bushes there. His
correspondence was light. In acknowledging a book from John Adams, he
wrote that his retirement had ‘been postponed four years too long,’ and that
his present happiness left him nothing to regret. That fall Washington had
sought again to entice him back into the Cabinet, but he had been
untempted. Though happy in his retirement, he was the old war-horse,
sniffing the battle from afar.[970]
And things were happening over the land. Dr. Joseph Priestley, the
English liberal, driven from England by persecution, had been given an
uproarious greeting in New York and had replied to addresses from
Tammany and Democratic Societies with severe strictures on the repressive
measures of Pitt; and an exotic creature, who had been living obscurely in
Philadelphia as a teacher, startled the country with a pamphlet reply in a
vein of sarcasm and satire worthy of the masters of the art. England was
glorified, France crucified, Democratic Societies excoriated, the Irish in
America damned—and the Hamiltonians rejoiced. Many were shocked.
Since William Cobbett was to work under the encouragement of Hamilton,
[971] we shall become better acquainted with him by and by.
Otherwise life was moving along in Philadelphia much the same as
usual. Society was still in the saddle. Blanchard, who was thrilling the
people with balloon ascensions, was postponing one of his ascents ‘because
of the marriage of a person of distinction.’[972] The French madness was
unabated, and on July 11th a French victory was theatrically celebrated. ‘La
Carmagnole’ was danced in the streets. Public officials marched with the
populace to the French Minister’s house where orations were heard and ‘La
Marseillaise’ was sung. At Richardet’s five hundred sat down to a noisy
feast, after which they danced around a liberty tree, set off fireworks, and
burned a British flag.[973] Even Rickett’s Circus was so fashionable that
Fenno hoped he would begin his performances an hour earlier to permit
citizens to enjoy the dare-devil feats before repairing to the House of
Representatives to hear the debates.[974] Bache, educated abroad, was a
lover of the play and interested in seeing democratic features introduced—
say, an occasional ‘simple air’ interspersed with the classics for the
delectation of the ‘gallery gods who pay their money like other folks.’[975]
But the time was to come when even Bache was to make sad grimaces at
democratic manners in the theater. This was when the ‘gallery gods’ hit
upon a novel mode of entertainment, of selecting some inoffensive
‘aristocrat’ in the pit and demanding that he doff his hat to the gallery.
Naturally ignored, ‘a hundred stentorian voices would call out for his
punishment.’ Thereupon the gods would pelt the unfortunate victim with
apples and pears, sticks, and even stones, and assail him ‘with scurrillity
and abuse.’ Throughout the evening the persecution would continue.
Spitting, and emptying beer-bottles upon him increased his misery. It was
bad enough, thought Bache, to spit upon the men ‘aristocrats,’ without
spattering the delicate dresses of the aristocratic ladies with beer. One night
most of the orchestra was driven out of the house. ‘It is time to stop this
growing evil,’ wrote Bache, ‘which has been on the increase ever since the
opening of the house.’[976] The Federalists were delighted at his
embarrassment. Here was the rabid editor’s ‘democracy.’ These people in
the galleries were his ‘sovereign people.’ And all this was due to the
leveling influence of the Democratic Societies. They must go!
IX
II
III