SlideShare ist ein Scribd-Unternehmen logo
1 von 43
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

Weitere ähnliche Inhalte

Was ist angesagt?

Perl Development Environment Tooling
Perl Development Environment ToolingPerl Development Environment Tooling
Perl Development Environment ToolingJason 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 PromisesStefan 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 applicationJulien Pivotto
 
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 2012Julien 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
 
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 GlideRichard Tuin
 
Living with Files More Happily
Living with Files More HappilyLiving with Files More Happily
Living with Files More HappilyYusuke Endo
 
Probando con grails
Probando con grailsProbando con grails
Probando con grailsAitortxu73
 
Alexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummiesAlexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummiesNaotaka Jay HOTTA
 
Heroku for team collaboration
Heroku for team collaborationHeroku for team collaboration
Heroku for team collaborationJohn Stevenson
 
PUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHPPUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHPGiuseppe Morelli
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginningJames Aylett
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangEvan Lin
 
Git Ready! Workflows
Git Ready! WorkflowsGit Ready! Workflows
Git Ready! WorkflowsAtlassian
 

Was ist angesagt? (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
 

Ähnlich wie 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-02Omer van Kloeten
 
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 FoundryAndy 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
 
Reuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldReuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldDmitri Zimine
 
Migrating to Java 11
Migrating to Java 11Migrating to Java 11
Migrating to Java 11Arto 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 thisRuslan 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 developergicappa
 
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 DomainKen 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 RecapDave Orme
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?hawkowl
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSPMin-Yih Hsu
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIDavid 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 CETICLa 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.pdfMarharyta Nedzelska
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Kürzlich hochgeladen (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

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] | |

Hinweis der Redaktion

  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