SlideShare a Scribd company logo
Power Up Your Build
OMER VAN KLOETEN
This talk
 We can all do better
 Good, not best, practices
 No one-size-fits-all
 Not just green-field
 Open discussion
Who?
 Omer van Kloeten
 16 years in the industry
 Scala and sbt since 2012
 @omervk everywhere
A Good Build
 Explicit Compiler Behavior
 Robust and Repeatable
 Fast(-ish)
 Promotes Idiomatic Scala
 At the Right Level
Build Tools
 sbt
 cbt
 Mill
 Bazel
 Maven
 Gradle
 Pants
The Compiler
“
”
THE COMPILER IS YOUR FRIEND
AND FRIENDS TELL FRIENDS
WHEN THEY TRY TO DO STUPID THINGS
Hila Noga, “From Prehistoric to a New Age”, Scalapeño 2016
https://www.youtube.com/watch?v=N9loHZAI1NM
Build Passes! 🎉
Youhavediedofcompilerwarnings.
Out of sight, out of mind
“
”
-Xfatal-warnings
IS LIKE GLOBAL WARMING
YOU WANT TO DO SOMETHING ABOUT IT
BUT YOU NEVER DO
AND NOW IT'S TOO LATE
Andrew Phillips, “Essential vs Accidental Complexity in Scala & Dotty” (paraphrased),
ScalaWorld 2016
https://www.youtube.com/watch?v=Ay-9aanosUM
scalac Flags
 -deprecation
 -unchecked
 case _: Option[Int] =>
 -feature
 What level of Scala are you on?
 -language:implicitConversions (use splain)
scalac Flags
 Advanced Settings: -X
 -Xcheckinit ※
 -Xfuture
 -Xlint
 Run scalac –X for a list
class Foo {
val bar = baz // not yet
val baz = 1
}
scalac Flags
def print(x: (Int, Int)) =
println("Tupled")
def print(t: Int, x: Int) =
println("Untupled")
print(1, 2)
scalac Flags
def print(x: (Int, Int)) =
println("Tupled")
print(1, 2)
scalac Flags
 “Private” Settings: -Y
 -Yno-adapted-args
 -Ywarn-*
 Run scalac –Y for a list
YMMV
 Do what’s right for you
 “Recommended Scalac Flags for 2.12” by Rob Norris (@tpolecat)
https://tpolecat.github.io/2017/04/25/scalac-flags.html
Promoting Better Code
Linters
 FindBugs
 Linter
 Abide
 Scalastyle
 scapegoat
Linters
(that you should care about)
 -Xlint:*
 WartRemover
 Scalafix
 IntelliJ IDEA
 Leif Wickland, “Toward A Safer Scala”, ScalaDays SF 2015
https://www.youtube.com/watch?v=CQY5ef6R_eg
WartRemover
 All rules are opt-in
 No “Better Java”
 AsInstanceOf / IsInstanceOf
 Null
 Return
WartRemover
 Good Practices
 ExplicitImplicitTypes
 PublicInference
implicit def foo(): Bar = new Bar()
def foo(): Bar = new Bar()
WartRemover
 Language Best Practices
 FinalCaseClass
 LeakingSealed
final case class Foo()
sealed trait A
sealed trait B extends A
final class C extends A
WartRemover
 Standard Library Best Practices
 ArrayEquals
 JavaConversions
Array(1.toByte) == Array(1.toByte)
javaList.asScala
WartRemover
 Avoid Throwing
 OptionPartial
 TraversableOps
 TryPartial
none.get
emptyList.head
emptyList.reduce(_ + _)
failedTry.get
wartremover-contrib
 ExposedTuples
 OldTime
 SomeApply
def foo(): (Int, String)
new java.util.Date()
val foo = Some(null)
“
”
ANY STYLE GUIDE WRITTEN IN ENGLISH
IS EITHER SO BRIEF THAT IT’S AMBIGUOUS,
OR SO LONG THAT NO ONE READS IT
Bob Nystrom, "Hardest Program I've Ever Written”
http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/
Styleguides
 Infinite
 Unwritten Rules
 “Feels Right”
 Unenforceable
Automated Code Formatting
 Auto-reformat code on compile
 Be hated by peers
 scalafmt
 sbt-scalafmt
 IntelliJ IDEA
Versioning
Versions
 Metadata
 Easy Consensus
 Semantic Versioning
 Breaking.BackCompat.Patch
 Marketing.New.BugFix
 Copy of Copy of Software Final (3).docx
Types of Versions
 Canonical versions
 1.2.3
 Non-canonical versions
 Between 1.2.3 and 1.2.4
 Date? Branch? Hash?
 Not even a version
 Snapshots
Versioning
 git describe --tags
 2.15.1-29-g866b31dfe-SNAPSHOT
 Use sbt-git
enablePlugins(GitVersioning)
git.useGitDescribe := true
Dependencies
sbt-coursier
 Pure Scala Ivy Replacement
 Parallel Downloads (Fast!)
 No Global Lock
 Coming natively to sbt
sbt/librarymanagement/pull/190
Zero Pending Updates Policy
 First commit after release
 Can’t upgrade?
 Triage
 Open issues
 Fix bugs
 Schedule upgrade
Ivy
 Dynamic Revisions
 1.11.+
 [1.0,2.0)
JitPack
 GitHub’s Auto-Repository
 DEPEND ON ANYTHING
 Release
 Tag
 Branch
 Commit
 On-demand
 Free!
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.User" % "Repo" % "Tag”
sbt-updates
 Makes Life Easy
 Explained Upgrade Path
> dependencyUpdates
[info] Found 3 dependency updates for test-project
[info] ch.qos.logback:logback-classic : 0.8.1 -> 0.9.30 -> 1.2.3
[info] org.scala-lang:scala-library : 2.11.5 -> 2.11.12 -> 2.12.5
[info] org.slf4j:slf4j-api : 1.7.21 -> 1.7.25
sbt-dependency-check
 Security Issues Check
 Uses the Open Web Application Security Project (OWASP)
sbt-dependency-graph
 What’s Using What
 It’s always Jackson or Guava
> dependencyGraph
[info] com.omervk:mylib_2.12:0.0.1-ga480c6e-SNAPSHOT [S]
[info] +-com.amazonaws:aws-java-sdk-s3:1.11.160
[info] | +-com.amazonaws:aws-java-sdk-core:1.11.160
[info] | | +-com.fasterxml.jackson.core:jackson-databind:2.6.6
[info] | | | +-com.fasterxml.jackson.core:jackson-annotations:2.6.0
[info] | | | +-com.fasterxml.jackson.core:jackson-core:2.6.6
[info] | | |
[info] | | +-com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6
[info] | | | +-com.fasterxml.jackson.core:jackson-core:2.6.6
[info] | | |
[info] | | +-joda-time:joda-time:2.8.1
[info] | | +-org.apache.httpcomponents:httpclient:4.5.2
[info] | | | +-commons-codec:commons-codec:1.9
[info] | | | +-org.apache.httpcomponents:httpcore:4.4.4
[info] | | |
[info] | | +-software.amazon.ion:ion-java:1.0.2
[info] | |
Honorable Mentions
 sbt-assembly
 sbt-native-packager
This slide intentionally left blank

More Related Content

What's hot

Perl Development Environment Tooling
Perl Development Environment ToolingPerl Development Environment Tooling
Perl Development Environment Tooling
Jason Crome
 
Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...
Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...
Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...
Ontico
 
TDC 2016 Floripa - Testando APIs REST com Supertest e Promises
TDC 2016 Floripa - Testando APIs REST com Supertest e PromisesTDC 2016 Floripa - Testando APIs REST com Supertest e Promises
TDC 2016 Floripa - Testando APIs REST com Supertest e Promises
Stefan Teixeira
 
Deployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationDeployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone application
Julien Pivotto
 
Vapor london March 2018
Vapor london March 2018Vapor london March 2018
Vapor london March 2018
Shashikant Jagtap
 
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
Stefan Teixeira
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Demi Ben-Ari
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012
Julien Pivotto
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
Carl Su
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
tdc-globalcode
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
Brandon Mueller
 
Golang for PHP Developers: Dependency management with Glide
Golang for PHP Developers: Dependency management with GlideGolang for PHP Developers: Dependency management with Glide
Golang for PHP Developers: Dependency management with Glide
Richard Tuin
 
Living with Files More Happily
Living with Files More HappilyLiving with Files More Happily
Living with Files More Happily
Yusuke Endo
 
Probando con grails
Probando con grailsProbando con grails
Probando con grails
Aitortxu73
 
Alexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummiesAlexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummies
Naotaka Jay HOTTA
 
Heroku for team collaboration
Heroku for team collaborationHeroku for team collaboration
Heroku for team collaboration
John Stevenson
 
PUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHPPUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHP
Giuseppe Morelli
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
James Aylett
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Evan Lin
 
Git Ready! Workflows
Git Ready! WorkflowsGit Ready! Workflows
Git Ready! Workflows
Atlassian
 

What's hot (20)

Perl Development Environment Tooling
Perl Development Environment ToolingPerl Development Environment Tooling
Perl Development Environment Tooling
 
Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...
Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...
Мониторинг облачной CI-системы на примере Jenkins / Александр Акбашев (HERE T...
 
TDC 2016 Floripa - Testando APIs REST com Supertest e Promises
TDC 2016 Floripa - Testando APIs REST com Supertest e PromisesTDC 2016 Floripa - Testando APIs REST com Supertest e Promises
TDC 2016 Floripa - Testando APIs REST com Supertest e Promises
 
Deployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationDeployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone application
 
Vapor london March 2018
Vapor london March 2018Vapor london March 2018
Vapor london March 2018
 
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
Golang for PHP Developers: Dependency management with Glide
Golang for PHP Developers: Dependency management with GlideGolang for PHP Developers: Dependency management with Glide
Golang for PHP Developers: Dependency management with Glide
 
Living with Files More Happily
Living with Files More HappilyLiving with Files More Happily
Living with Files More Happily
 
Probando con grails
Probando con grailsProbando con grails
Probando con grails
 
Alexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummiesAlexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummies
 
Heroku for team collaboration
Heroku for team collaborationHeroku for team collaboration
Heroku for team collaboration
 
PUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHPPUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHP
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
 
Git Ready! Workflows
Git Ready! WorkflowsGit Ready! Workflows
Git Ready! Workflows
 

Similar to Power Up Your Build - Omer van Kloeten @ Wix 2018-04

Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02
Omer van Kloeten
 
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor BuzatovićJavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Run your Java code on Cloud Foundry
Run your Java code on Cloud FoundryRun your Java code on Cloud Foundry
Run your Java code on Cloud Foundry
Andy Piper
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진
VMware Tanzu Korea
 
The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...
Michael Vorburger
 
Play framework
Play frameworkPlay framework
Play framework
Andrew Skiba
 
Versions
VersionsVersions
Reuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldReuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless World
Dmitri Zimine
 
Migrating to Java 11
Migrating to Java 11Migrating to Java 11
Migrating to Java 11
Arto Santala
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
Ruslan Shevchenko
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
gicappa
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
Ken Collins
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 Recap
Dave Orme
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
hawkowl
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
Martijn Dashorst
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
Min-Yih Hsu
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
TiNguyn863920
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
That's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETIC
La FeWeb
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Marharyta Nedzelska
 

Similar to Power Up Your Build - Omer van Kloeten @ Wix 2018-04 (20)

Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02
 
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor BuzatovićJavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
 
Run your Java code on Cloud Foundry
Run your Java code on Cloud FoundryRun your Java code on Cloud Foundry
Run your Java code on Cloud Foundry
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진
 
The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...
 
Play framework
Play frameworkPlay framework
Play framework
 
Versions
VersionsVersions
Versions
 
Reuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldReuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless World
 
Migrating to Java 11
Migrating to Java 11Migrating to Java 11
Migrating to Java 11
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 Recap
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
 
That's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETIC
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

Recently uploaded

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 

Recently uploaded (20)

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 

Power Up Your Build - Omer van Kloeten @ Wix 2018-04

  • 1. Power Up Your Build OMER VAN KLOETEN
  • 2. This talk  We can all do better  Good, not best, practices  No one-size-fits-all  Not just green-field  Open discussion
  • 3. Who?  Omer van Kloeten  16 years in the industry  Scala and sbt since 2012  @omervk everywhere
  • 4. A Good Build  Explicit Compiler Behavior  Robust and Repeatable  Fast(-ish)  Promotes Idiomatic Scala  At the Right Level
  • 5. Build Tools  sbt  cbt  Mill  Bazel  Maven  Gradle  Pants
  • 7. “ ” THE COMPILER IS YOUR FRIEND AND FRIENDS TELL FRIENDS WHEN THEY TRY TO DO STUPID THINGS Hila Noga, “From Prehistoric to a New Age”, Scalapeño 2016 https://www.youtube.com/watch?v=N9loHZAI1NM
  • 10. Out of sight, out of mind
  • 11. “ ” -Xfatal-warnings IS LIKE GLOBAL WARMING YOU WANT TO DO SOMETHING ABOUT IT BUT YOU NEVER DO AND NOW IT'S TOO LATE Andrew Phillips, “Essential vs Accidental Complexity in Scala & Dotty” (paraphrased), ScalaWorld 2016 https://www.youtube.com/watch?v=Ay-9aanosUM
  • 12. scalac Flags  -deprecation  -unchecked  case _: Option[Int] =>  -feature  What level of Scala are you on?  -language:implicitConversions (use splain)
  • 13. scalac Flags  Advanced Settings: -X  -Xcheckinit ※  -Xfuture  -Xlint  Run scalac –X for a list class Foo { val bar = baz // not yet val baz = 1 }
  • 14. scalac Flags def print(x: (Int, Int)) = println("Tupled") def print(t: Int, x: Int) = println("Untupled") print(1, 2)
  • 15. scalac Flags def print(x: (Int, Int)) = println("Tupled") print(1, 2)
  • 16. scalac Flags  “Private” Settings: -Y  -Yno-adapted-args  -Ywarn-*  Run scalac –Y for a list
  • 17. YMMV  Do what’s right for you  “Recommended Scalac Flags for 2.12” by Rob Norris (@tpolecat) https://tpolecat.github.io/2017/04/25/scalac-flags.html
  • 19. Linters  FindBugs  Linter  Abide  Scalastyle  scapegoat
  • 20. Linters (that you should care about)  -Xlint:*  WartRemover  Scalafix  IntelliJ IDEA  Leif Wickland, “Toward A Safer Scala”, ScalaDays SF 2015 https://www.youtube.com/watch?v=CQY5ef6R_eg
  • 21. WartRemover  All rules are opt-in  No “Better Java”  AsInstanceOf / IsInstanceOf  Null  Return
  • 22. WartRemover  Good Practices  ExplicitImplicitTypes  PublicInference implicit def foo(): Bar = new Bar() def foo(): Bar = new Bar()
  • 23. WartRemover  Language Best Practices  FinalCaseClass  LeakingSealed final case class Foo() sealed trait A sealed trait B extends A final class C extends A
  • 24. WartRemover  Standard Library Best Practices  ArrayEquals  JavaConversions Array(1.toByte) == Array(1.toByte) javaList.asScala
  • 25. WartRemover  Avoid Throwing  OptionPartial  TraversableOps  TryPartial none.get emptyList.head emptyList.reduce(_ + _) failedTry.get
  • 26. wartremover-contrib  ExposedTuples  OldTime  SomeApply def foo(): (Int, String) new java.util.Date() val foo = Some(null)
  • 27. “ ” ANY STYLE GUIDE WRITTEN IN ENGLISH IS EITHER SO BRIEF THAT IT’S AMBIGUOUS, OR SO LONG THAT NO ONE READS IT Bob Nystrom, "Hardest Program I've Ever Written” http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/
  • 28. Styleguides  Infinite  Unwritten Rules  “Feels Right”  Unenforceable
  • 29. Automated Code Formatting  Auto-reformat code on compile  Be hated by peers  scalafmt  sbt-scalafmt  IntelliJ IDEA
  • 31. Versions  Metadata  Easy Consensus  Semantic Versioning  Breaking.BackCompat.Patch  Marketing.New.BugFix  Copy of Copy of Software Final (3).docx
  • 32. Types of Versions  Canonical versions  1.2.3  Non-canonical versions  Between 1.2.3 and 1.2.4  Date? Branch? Hash?  Not even a version  Snapshots
  • 33. Versioning  git describe --tags  2.15.1-29-g866b31dfe-SNAPSHOT  Use sbt-git enablePlugins(GitVersioning) git.useGitDescribe := true
  • 35. sbt-coursier  Pure Scala Ivy Replacement  Parallel Downloads (Fast!)  No Global Lock  Coming natively to sbt sbt/librarymanagement/pull/190
  • 36. Zero Pending Updates Policy  First commit after release  Can’t upgrade?  Triage  Open issues  Fix bugs  Schedule upgrade
  • 37. Ivy  Dynamic Revisions  1.11.+  [1.0,2.0)
  • 38. JitPack  GitHub’s Auto-Repository  DEPEND ON ANYTHING  Release  Tag  Branch  Commit  On-demand  Free! resolvers += "jitpack" at "https://jitpack.io" libraryDependencies += "com.github.User" % "Repo" % "Tag”
  • 39. sbt-updates  Makes Life Easy  Explained Upgrade Path > dependencyUpdates [info] Found 3 dependency updates for test-project [info] ch.qos.logback:logback-classic : 0.8.1 -> 0.9.30 -> 1.2.3 [info] org.scala-lang:scala-library : 2.11.5 -> 2.11.12 -> 2.12.5 [info] org.slf4j:slf4j-api : 1.7.21 -> 1.7.25
  • 40. sbt-dependency-check  Security Issues Check  Uses the Open Web Application Security Project (OWASP)
  • 41. sbt-dependency-graph  What’s Using What  It’s always Jackson or Guava > dependencyGraph [info] com.omervk:mylib_2.12:0.0.1-ga480c6e-SNAPSHOT [S] [info] +-com.amazonaws:aws-java-sdk-s3:1.11.160 [info] | +-com.amazonaws:aws-java-sdk-core:1.11.160 [info] | | +-com.fasterxml.jackson.core:jackson-databind:2.6.6 [info] | | | +-com.fasterxml.jackson.core:jackson-annotations:2.6.0 [info] | | | +-com.fasterxml.jackson.core:jackson-core:2.6.6 [info] | | | [info] | | +-com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6 [info] | | | +-com.fasterxml.jackson.core:jackson-core:2.6.6 [info] | | | [info] | | +-joda-time:joda-time:2.8.1 [info] | | +-org.apache.httpcomponents:httpclient:4.5.2 [info] | | | +-commons-codec:commons-codec:1.9 [info] | | | +-org.apache.httpcomponents:httpcore:4.4.4 [info] | | | [info] | | +-software.amazon.ion:ion-java:1.0.2 [info] | |

Editor's Notes

  1. It’s hard, but start now before it’s harder
  2. Scalafix promoted by Scala Center
  3. Scalafix promoted by Scala Center
  4. Not a good name to Google I’m biased :)
  5. On the right: From Apple’s leaked source code, mixes tabs and spaces