2. Dependency Resolver & Manager 3. Build Task Scheduler & Executor 4. Build By Convention Gradle is an opinionated framework on top of an unopinionated toolkit - Szczepan Faber
Build Groovy DSL 3. Support for Ivy & Maven Dependencies 4. Multi-Project Builds 5. Easy to add custom logic 6. 1st class integration w/ Ant builds 7. Extensive public API and plugin ecosystem 8. Task UP-TO-DATE checking
n : ' c o m . m o o w o r k . g r u n t ' n p m I n s t a l l . i n p u t s . f i l e ' p a c k a g e . j s o n ' i n s t a l l G r u n t . d e p e n d s O n ' n p m I n s t a l l ' i n s t a l l G r u n t . i n p u t s . f i l e f i l e ( ' G r u n t f i l e . j s ' ) g r u n t _ b o w e r I n s t a l l . d e p e n d s O n ' i n s t a l l G r u n t ' g r u n t _ b o w e r I n s t a l l . i n p u t s . f i l e f i l e ( ' b o w e r . j s o n ' ) / / A d d i n g d e p e n d e n c i e s s o g r u n t a n d N P M g e t i n s t a l l e d [ g r u n t _ b u i l d , g r u n t _ t e s t , g r u n t _ c l e a n ] . e a c h { g t a s k - > g t a s k . d e p e n d s O n ' g r u n t _ b o w e r I n s t a l l ' } g r u n t _ b u i l d . i n p u t s . d i r f i l e ( ' a p p ' ) g r u n t _ b u i l d . o u t p u t s . d i r f i l e ( ' d i s t ' ) a s s e m b l e . d e p e n d s O n g r u n t _ b u i l d b u i l d . d e p e n d s O n a s s e m b l e t e s t . d e p e n d s O n g r u n t _ t e s t t a s k r u n ( d e s c r i p t i o n : ' B u i l d a n d r u n t h e a p p l i c a t i o n l o c a l l y . ' , g r o u p : a r g s = [ ' s e r v e ' ] } n o d e {
f n o d e t o u s e . v e r s i o n = ' 0 . 1 2 . 2 ' / / V e r s i o n o f n p m t o u s e . n p m V e r s i o n = ' 2 . 7 . 5 ' / / E n a b l e d t h e a u t o m a t i c d o w n l o a d . F a l s e i s t h e d e f a u l t ( f o r n o w ) . d o w n l o a d = t r u e }
P r o j e c t p r o j e c t ) { p r o j e c t . p l u g i n s . w i t h T y p e ( J a v a P l u g i n ) { / / D o s t u f f t o J a v a p r o j e c t s } p r o j e c t . p l u g i n s . w i t h T y p e ( G r o o v y P l u g i n ) { / / D o e x t r a s t u f f t o G r o o v y p r o j e c t s } }
Write once, run anywhere (*) Define OS level dependencies into application package Eliminate "works on my machine" Increase resource utilization of machines
" c o m . b m u s c h k o . d o c k e r - j a v a - a p p l i c a t i o n " v e r s i o n " 2 . 4 " } d o c k e r { u r l = ' h t t p s : / / 1 9 2 . 1 6 8 . 5 9 . 1 0 3 : 2 3 7 6 ' c e r t P a t h = n e w F i l e ( S y s t e m . p r o p e r t i e s [ ' u s e r . h o m e ' ] , ' . b o o t 2 d o c k e r / c e r t s / b o o t 2 d o c k e r - v m ' ) }
─ ─ ─ ┐ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ │ G r a d l e │ │ D o c k e r J a v a │ R E S T │ D o c k e r │ │ │ ─ ─ ─ > │ A P I │ ─ ─ ─ ─ ─ ─ > │ D a e m o n │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘