Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
-
Upload
michal-cmil -
Category
Software
-
view
173 -
download
2
Transcript of Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
![Page 1: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/1.jpg)
Eclipse RCP outside ofEclipse RCP outside ofEclipse IDE - Gradle to theEclipse IDE - Gradle to the
rescue!rescue!
Eclipse DemoCamp Poznań 2015
Michał Ćmil
@michalcmil
![Page 2: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/2.jpg)
AgendaAgenda
Eclipse RCP build systemOur projectIssues
GradleIntroductionSample applicationsEclipse RCP
Project experiences
![Page 3: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/3.jpg)
Our projectOur projecte(fx)clipse + Java 8 based Heavy usage of Eclipse technologies: EMF, ECP, Teneo,BirtJava EE 7 backend (WildFly)Around 50 modulesSome code is in JavaScript (via Nashorn)
![Page 4: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/4.jpg)
Eclipse RCP Build SystemEclipse RCP Build System
Eclipse RCP application are madeof plugins/bundles
Plugins come from updatesites defined via TargetPlatform
Eclipse Plug-in DevelopmentEnvironment (IDE)
Maven Tycho (headless)
![Page 5: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/5.jpg)
Target PlatformTarget Platform
![Page 6: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/6.jpg)
Issues with the standardIssues with the standardaproachaproach
Unstable buildsSharing modules between client and serverTightly coupled with IDEVery hard to add external dependencies
![Page 7: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/7.jpg)
Unstable BuildsUnstable Builds
![Page 8: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/8.jpg)
Sharing code betweenSharing code betweenclient and serverclient and server
Maven for server sideEclipse Tycho + PDE for client sideSome modules were used by both...
We had to maintain 3 build system and needed tworuns of Maven on the same code to build the app
![Page 9: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/9.jpg)
Tightly coupled with IDETightly coupled with IDE
Configuring the development environmentis a pain...
![Page 10: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/10.jpg)
Hard to add externalHard to add externaldependencies dependencies
![Page 11: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/11.jpg)
Could be done better...Could be done better...
Project structure known from Maven
Tests in src/test/Continuous integration and releasing
/src/main/java, /src/main/resources?
![Page 12: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/12.jpg)
So... Is there any hope?So... Is there any hope?
![Page 13: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/13.jpg)
Groovy based build toolMaven's Conventions andDependency Management
Tons of defaults andplugins Supports Nexus,Artifactory etc.
Ant's FlexibilityImperative languageavailable in the DSL
![Page 14: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/14.jpg)
Minimal Java BuildMinimal Java Build
apply plugin: 'java'
$gradle build
![Page 15: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/15.jpg)
Minimal Java Build withMinimal Java Build withGuava and JUnitGuava and JUnitapply plugin: 'java'
repositories { mavenCentral()}
dependencies { compile 'com.google.guava:guava:18.0' testCompile 'junit:junit:4.12'}
$gradle build
![Page 16: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/16.jpg)
The Bridge between GradleThe Bridge between Gradleand Eclipse RCPand Eclipse RCP
https://github.com/akhikhl/wuff
Andrey Hihlovskiy will present Wuff at Gradle Summit 12.06.2015
![Page 17: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/17.jpg)
WuffWuff
Eclipse plugins are normal Gradle dependenciesUpdate Site is downloaded into a local Mavenrepository
Automatically bundles non-OSGi dependencies Manifest GenerationRuns and creates executable Eclipse applications
compile 'efxclipse-1_2:org.eclipse.e4.ui.di:+'compile 'com.google.guava:guava:18.0'testCompile 'junit:junit:4.12'
![Page 18: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/18.jpg)
Minimal e(fx)clipse sampleMinimal e(fx)clipse samplebuildscript { repositories { jcenter() } dependencies { classpath 'org.akhikhl.wuff:wuff-plugin:0.0.14' }}
apply plugin: 'org.akhikhl.wuff.efxclipse-app'
wuff { selectedEclipseVersion = 'efxclipse-1.2'}
products { nativeLauncher = false}
https://github.com/mcmil/wuff-skeleton
$gradle scaffold$gradle build $gradle run
![Page 19: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/19.jpg)
ScaffoldingScaffoldingsrc!"" main #"" java $ !"" pl $ !"" cmil $ !"" wuff $ !"" skeleton $ !"" SamplePart.java !"" resources #"" Application.e4xmi #"" css $ !"" default.css !"" plugin.xml
![Page 20: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/20.jpg)
EffectEffect
![Page 21: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/21.jpg)
Multi module sampleMulti module sampleapply plugin: 'org.akhikhl.wuff.eclipse-config'
wuff { selectedEclipseVersion = 'efxclipse-1.2'}
products { nativeLauncher = false}
project(':pl.cmil.wuff.sample.main') { apply plugin: 'org.akhikhl.wuff.efxclipse-app'
dependencies { compile project(':pl.cmil.wuff.sample.services') }}
project(':pl.cmil.wuff.sample.services') { apply plugin: 'org.akhikhl.wuff.osgi-bundle'
dependencies { compile 'com.google.guava:guava:18.0' }}
https://github.com/mcmil/wuff-efxclipse-samples
![Page 22: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/22.jpg)
Additional featuresAdditional features
Supports Equinox, EclipseRCP, e(fx)clipse, IDE apps,SWT Apps
Easy switching between Eclipse versionsGenerating features and repositoriesAutomatic conversion of existing applicationsPlatform-specific products
https://github.com/akhikhl/wuff-sandbox
![Page 23: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/23.jpg)
Wuff DocumentationWuff Documentation
https://github.com/akhikhl/wuff/tree/master/exampleshttps://github.com/akhikhl/wuff/wiki
![Page 24: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/24.jpg)
Did it help?Did it help?
Stable buildsEasier for developers
Maven-like dependencies (also external - likeGuava, Jersey)Maven-like structure and testsMaven repositories (Maven Central, jCenter,local Nexus)
![Page 25: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/25.jpg)
Did it help?Did it help?
IDE independentNo tooling needed - Gradle Wrapper automaticallydownloads itself on Windows/Linux
One command build for the whole applicationWorks great on Jenkinsgradlew build & gradlew run
![Page 26: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/26.jpg)
It's not perfectIt's not perfect
A lot of automatics that can failManifests generation and merging
Relatively long buildsclient minimally 30-40sserver minimally 90s with deployment CPU intensive (can work on multiple cores)
![Page 27: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/27.jpg)
Speeding up the buildSpeeding up the build
DaemonGradle is always running
Parallel builds (module level)New Gradle releases
Performance is a priority - biggest buildsaround 4000 modules
Gradle Profiler
https://discuss.gradle.org/t/the-gradle-roadmap/105
![Page 28: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/28.jpg)
Speeding up the buildSpeeding up the build
IntelliJ PluginStarting the application straighlty from theIDE (without using gradle)Incremental builds for classes and resources(gradle build not required)
https://github.com/mcmil/wuff-intellij-plugin
![Page 29: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/29.jpg)
Buildship - AnotherBuildship - Anotherapproachapproach
Deep Gradle-Eclipse integration plugin
Gradle guys are building an eclipse plugin for gradle-based projects in the Eclipse IDE... ...and they use Gradle to build it Started 24.03.2015 - currently only snapshots available
http://www.vogella.com/tutorials/EclipseGradle/article.html
https://github.com/eclipse/buildship
![Page 30: Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!](https://reader030.fdocuments.net/reader030/viewer/2022020102/55c9fca6bb61eb751b8b45e6/html5/thumbnails/30.jpg)
SourcesSourcesWuff: e(fx)clipse Wuff samples:
, Gradle: Gradle Free E-Books: Eclipse architecture: Buildship: Eclipse and Gradle Tutorial:
Why Gradle:
https://github.com/akhikhl/wuffhttps://github.com/mcmil/wuff-
efxclipse-samples https://github.com/mcmil/wuff-skeletonhttp://gradle.org/
http://gradle.org/books/http://www.aosabook.org/en/eclipse.html
https://github.com/eclipse/buildship http://www.vogella.com/tutorials/
EclipseGradle/article.htmlhttp://www.drdobbs.com/jvm/why-build-your-java-
projects-with-gradle/240168608