SlideShare a Scribd company logo
1 of 26
Download to read offline
Scala and Play with Gradle
Wei Chen
Sr. Software Engineer, Development Tools
Gradle Summit 2015
Build Happiness
What this talk is about?
● Scala support in Gradle
● Play support in Gradle
● Continuous mode (watch mode)
● Demos
Who am I?
● A Software Engineer at Linkedin
● Development Tools
● Not a Scala expert
● Not a Play expert
● Maybe a build expert: make, ant, maven, sbt,
and gradle
● Object oriented
● Strong typed
● Full support for functional programming
● JVM based
● 1.5% of LI code base (Java 25.1%)
(Simple Build Tool? LOL)
● De facto build tool for scala community
● Native support for compiling Scala code and
integrating with many Scala test frameworks
● Build descriptions written in Scala using a DSL
● Dependency management using Ivy
● Continuous compilation, testing, and
deployment
● Integration with the Scala interpreter for rapid
iteration and debugging
● Support for mixed Java/Scala projects
vs.
Sbt Gradle
DSL language Scala Groovy
Supported languages Scala, Java Java, Scala, C++, ...
Incremental Scala build Yes Possible with Zinc
Interactive Shell Yes No (but has Gradle daemon)
REPL Yes No
Multi-module support Yes Yes
Dependency Management Ivy proprietary
Continuous Mode Yes YES!
Vendor and community support Mediocre Great
Existing LI Tooling Integration Minimal when we started Great
Scala Support in Gradle
● Scala plugin
● From the very beginning of Gradle
● 0.8 (September 2009)
● Zinc support (1.3 November 2012)
Demo
● Compiles Scala
● Compiles Java
● Joint compilation
Limitations
● Scala version can only be inferred from
direct dependencies
● No conflicting scala version validation
● No cross-build support
● No native specs2 integration
● Bad IDE integration
● Second class citizen in Scala world
● Smaller adopter community
Framework
● Web App Framework
● Async I/O (JBoss Netty)
● Built-in hot reloading
● Built on top of sbt
● Supports both Java and Scala
● 159+ Play Applications
Why to build Play on Gradle
● Pains with Ivy
● Simplify our processes
● Unify our build technologies
● DRY
Dependency Management
● Product catalog
● Dependency validation
● Repository management
● Conflict resolution
● Consistent versioning
● Manifest generation/upload
● Dependency resolution performance
What’s involved?
1. Assets processing and packaging
2. Routes compilation
3. Twirl templates compilation
4. Scala/Java compilation
5. Running the server in development
mode
6. Play binary packaging
7. Play distribution packaging
Milestones
1. Using Gradle to build a Play application
2. Continuous Mode and Hot-Reload
3. Making it real!
Demo
● Build a play app
● Start the server in development mode
Basic Sample Demo
● Apply play plugin
● Declare dependencies
● Configure repositories
Advanced Sample Demo
● Apply CoffeeScript plugin
● Configure target Scala and Play version
Multiproject Sample Demo
● Standard Gradle multiproject build
● “root” project: main Play application
● 3 submodules:
○ admin: Play application
○ user: Play application
○ util: Java library
Continuous Mode
● Gradle does not exit
● Re-execute tasks when task file inputs
change
● > Java 7 (file system WatchService)
Demo
● gradle build
● gradle test
Play Hot Reload
● Stateless
● Lightweight
● Classloader magic
● Used to be tightly coupled with build system
(sbt)
● BuildLink
Play Hot Reload
Demo
Hot reload
● Routes
● Templates
● Controller class
Q & A
Thank you!
Wei Chen
Sr. Software Engineer, Development Tools
wechen@linkedin.com
http://www.linkedin.com/in/weichenlinkedin
Useful Links
● https://docs.gradle.org/current/userguide/scala_plugin.html
● https://github.com/gradle/gradle/blob/master/design-docs/play-support.
md
● https://engineering.linkedin.com/play/developing-play-applications-
using-gradle
● https://github.
com/playframework/playframework/blob/master/framework/src/build-
link/src/main/java/play/core/BuildLink.java
● https://github.com/gradle/gradle
● https://github.com/playframework/playframework

More Related Content

What's hot

Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Mihail Stoynov
 
Developing Plug-Ins for NetBeans
Developing Plug-Ins for NetBeansDeveloping Plug-Ins for NetBeans
Developing Plug-Ins for NetBeanselliando dias
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new buildIgor Khotin
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...ZeroTurnaround
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Languageelliando dias
 
Getting started with sbt
Getting started with sbtGetting started with sbt
Getting started with sbtikenna4u
 
The world of gradle - an introduction for developers
The world of gradle  - an introduction for developersThe world of gradle  - an introduction for developers
The world of gradle - an introduction for developersTricode (part of Dept)
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolvedBhagwat Kumar
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaJadson Santos
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Rajmahendra Hegde
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Julian Robichaux
 

What's hot (20)

Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
SBT Crash Course
SBT Crash CourseSBT Crash Course
SBT Crash Course
 
Gradle como alternativa a maven
Gradle como alternativa a mavenGradle como alternativa a maven
Gradle como alternativa a maven
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
Developing Plug-Ins for NetBeans
Developing Plug-Ins for NetBeansDeveloping Plug-Ins for NetBeans
Developing Plug-Ins for NetBeans
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Language
 
Getting started with sbt
Getting started with sbtGetting started with sbt
Getting started with sbt
 
Java 9 preview
Java 9 previewJava 9 preview
Java 9 preview
 
The world of gradle - an introduction for developers
The world of gradle  - an introduction for developersThe world of gradle  - an introduction for developers
The world of gradle - an introduction for developers
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and Java
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 
Building with Gradle
Building with GradleBuilding with Gradle
Building with Gradle
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
 

Viewers also liked

Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed ZarinfamVert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed ZarinfamSaeed Zarinfam
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersTeng Shiu Huang
 
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)Stephen Chin
 
Data Aggregation At Scale Using Apache Flume
Data Aggregation At Scale Using Apache FlumeData Aggregation At Scale Using Apache Flume
Data Aggregation At Scale Using Apache FlumeArvind Prabhakar
 

Viewers also liked (6)

Why Play Framework is fast
Why Play Framework is fastWhy Play Framework is fast
Why Play Framework is fast
 
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed ZarinfamVert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
 
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
 
Data Aggregation At Scale Using Apache Flume
Data Aggregation At Scale Using Apache FlumeData Aggregation At Scale Using Apache Flume
Data Aggregation At Scale Using Apache Flume
 
Simple Build Tool
Simple Build ToolSimple Build Tool
Simple Build Tool
 

Similar to Scala and Play with Gradle

Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesStrannik_2013
 
Developing Secure Scala Applications With Fortify For Scala
Developing Secure Scala Applications With Fortify For ScalaDeveloping Secure Scala Applications With Fortify For Scala
Developing Secure Scala Applications With Fortify For ScalaLightbend
 
Continuous integration for androids
Continuous integration for androidsContinuous integration for androids
Continuous integration for androidsKirill Zotin
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Provectus
 
Exploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondKaushal Dhruw
 
DevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and GebDevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and GebAlvaro Sanchez-Mariscal
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplateStanislav Petrov
 
TDD with Python and App Engine
TDD with Python and App EngineTDD with Python and App Engine
TDD with Python and App EngineRicardo Bánffy
 
Java Programming 100 Programming Challenges
Java Programming 100 Programming ChallengesJava Programming 100 Programming Challenges
Java Programming 100 Programming ChallengesJavier Crisostomo
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)Alvaro Sanchez-Mariscal
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gatesStrannik_2013
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
How to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationsHow to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationstakezoe
 
Gradle build automation tool
Gradle   build automation toolGradle   build automation tool
Gradle build automation toolIoan Eugen Stan
 
AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0MoritzHalbritter
 
Enterprise build tool gradle
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradleDeepak Shevani
 
Adding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGiAdding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGiBob Paulin
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0Eric Wendelin
 

Similar to Scala and Play with Gradle (20)

Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypes
 
Developing Secure Scala Applications With Fortify For Scala
Developing Secure Scala Applications With Fortify For ScalaDeveloping Secure Scala Applications With Fortify For Scala
Developing Secure Scala Applications With Fortify For Scala
 
Continuous integration for androids
Continuous integration for androidsContinuous integration for androids
Continuous integration for androids
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"
 
Exploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & Beyond
 
DevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and GebDevQA: make your testers happier with Groovy, Spock and Geb
DevQA: make your testers happier with Groovy, Spock and Geb
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
TDD with Python and App Engine
TDD with Python and App EngineTDD with Python and App Engine
TDD with Python and App Engine
 
Java Programming 100 Programming Challenges
Java Programming 100 Programming ChallengesJava Programming 100 Programming Challenges
Java Programming 100 Programming Challenges
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gates
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
How to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationsHow to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applications
 
One-stop solution for Grails web app development
One-stop solution for Grails web app developmentOne-stop solution for Grails web app development
One-stop solution for Grails web app development
 
Gradle build automation tool
Gradle   build automation toolGradle   build automation tool
Gradle build automation tool
 
AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0
 
Enterprise build tool gradle
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradle
 
Adding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGiAdding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGi
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Scala and Play with Gradle

  • 1. Scala and Play with Gradle Wei Chen Sr. Software Engineer, Development Tools Gradle Summit 2015
  • 3. What this talk is about? ● Scala support in Gradle ● Play support in Gradle ● Continuous mode (watch mode) ● Demos
  • 4. Who am I? ● A Software Engineer at Linkedin ● Development Tools ● Not a Scala expert ● Not a Play expert ● Maybe a build expert: make, ant, maven, sbt, and gradle
  • 5. ● Object oriented ● Strong typed ● Full support for functional programming ● JVM based ● 1.5% of LI code base (Java 25.1%)
  • 6. (Simple Build Tool? LOL) ● De facto build tool for scala community ● Native support for compiling Scala code and integrating with many Scala test frameworks ● Build descriptions written in Scala using a DSL ● Dependency management using Ivy ● Continuous compilation, testing, and deployment ● Integration with the Scala interpreter for rapid iteration and debugging ● Support for mixed Java/Scala projects
  • 7. vs. Sbt Gradle DSL language Scala Groovy Supported languages Scala, Java Java, Scala, C++, ... Incremental Scala build Yes Possible with Zinc Interactive Shell Yes No (but has Gradle daemon) REPL Yes No Multi-module support Yes Yes Dependency Management Ivy proprietary Continuous Mode Yes YES! Vendor and community support Mediocre Great Existing LI Tooling Integration Minimal when we started Great
  • 8. Scala Support in Gradle ● Scala plugin ● From the very beginning of Gradle ● 0.8 (September 2009) ● Zinc support (1.3 November 2012)
  • 9. Demo ● Compiles Scala ● Compiles Java ● Joint compilation
  • 10. Limitations ● Scala version can only be inferred from direct dependencies ● No conflicting scala version validation ● No cross-build support ● No native specs2 integration ● Bad IDE integration ● Second class citizen in Scala world ● Smaller adopter community
  • 11. Framework ● Web App Framework ● Async I/O (JBoss Netty) ● Built-in hot reloading ● Built on top of sbt ● Supports both Java and Scala ● 159+ Play Applications
  • 12. Why to build Play on Gradle ● Pains with Ivy ● Simplify our processes ● Unify our build technologies ● DRY
  • 13. Dependency Management ● Product catalog ● Dependency validation ● Repository management ● Conflict resolution ● Consistent versioning ● Manifest generation/upload ● Dependency resolution performance
  • 14. What’s involved? 1. Assets processing and packaging 2. Routes compilation 3. Twirl templates compilation 4. Scala/Java compilation 5. Running the server in development mode 6. Play binary packaging 7. Play distribution packaging
  • 15. Milestones 1. Using Gradle to build a Play application 2. Continuous Mode and Hot-Reload 3. Making it real!
  • 16. Demo ● Build a play app ● Start the server in development mode
  • 17. Basic Sample Demo ● Apply play plugin ● Declare dependencies ● Configure repositories
  • 18. Advanced Sample Demo ● Apply CoffeeScript plugin ● Configure target Scala and Play version
  • 19. Multiproject Sample Demo ● Standard Gradle multiproject build ● “root” project: main Play application ● 3 submodules: ○ admin: Play application ○ user: Play application ○ util: Java library
  • 20. Continuous Mode ● Gradle does not exit ● Re-execute tasks when task file inputs change ● > Java 7 (file system WatchService)
  • 22. Play Hot Reload ● Stateless ● Lightweight ● Classloader magic ● Used to be tightly coupled with build system (sbt) ● BuildLink
  • 24. Demo Hot reload ● Routes ● Templates ● Controller class
  • 25. Q & A Thank you! Wei Chen Sr. Software Engineer, Development Tools wechen@linkedin.com http://www.linkedin.com/in/weichenlinkedin
  • 26. Useful Links ● https://docs.gradle.org/current/userguide/scala_plugin.html ● https://github.com/gradle/gradle/blob/master/design-docs/play-support. md ● https://engineering.linkedin.com/play/developing-play-applications- using-gradle ● https://github. com/playframework/playframework/blob/master/framework/src/build- link/src/main/java/play/core/BuildLink.java ● https://github.com/gradle/gradle ● https://github.com/playframework/playframework