Pro Yearly is on sale from $80 to $50! »

Introduction to Gradle 2.0

9278c3a06b8d8752fb913dea93f959c1?s=47 FUJI Goro
September 24, 2014

Introduction to Gradle 2.0

potatotips #9 at Fablic の発表資料です

9278c3a06b8d8752fb913dea93f959c1?s=128

FUJI Goro

September 24, 2014
Tweet

Transcript

  1. Introduction to Gradle 2.0 potatotips #9 at Fablic, 2014/9/24 Fuji

    Goro (gfx)
  2. Myself • id:gfx (Fuji, Goro) • ΫοΫύουͷΤϯδχΞ • iOS /

    Android྆ํ΍Γ·͢ • ϚΠϒʔϜ͸SwiftΛۃΊΔ͜ͱ • ࠷ۙϚγϯ͕ނোͯ͠σʔλϦΧόϦ΋Ͱ͖ͳ͘ ͯ؀ڥ࡞Γͳ͓ͯ͠ਏ͔ͬͨɻϚγϯ͸յΕΔ
  3. Android Studio 0.8.11 2014/9/18 ϦϦʔε

  4. Shipped with Android Gradle Plugin 0.13.0

  5. ! Depends on Gradle 2.1 and Groovy 2.3.6

  6. Gradle 2.1

  7. Gradle 2.1 • ৽͍͠pluginػߏ • https://plugins.gradle.org/ • نఆͷϝλ৘ใΛ͚ͭͯjcenterʹdeploy͢Δͱࢀর Ͱ͖ΔΑ͏ʹͳΔ •

    pluginsϒϩοΫ • qualified idʹΑͬͯ҉໧ͷ͏ͪʹclasspathʹՃ͑Δ ࢓૊Έ
  8. plugins { id 'com.github.forsety.adr' version '0.1' } apply plugin: 'com.android.application'

    fully-qualified id no comma! no colon! before "apply"s Android pluginࣗମ΋pluginsϒϩοΫͰࢦ ఆͰ͖ΔΑ͏ʹͦͷ͏ͪͳΔͱࢥΘΕΔ͕ ݱঢ়͸·ͩͰ͖ͳ͍ͷͰҎલͱ͓ͳ͡
  9. Other features • Incremental Java compile (Android͸·ͩ…ʁʣ • Groovy 2.3.6

    (Gradle 1.x͸ Groovy 1.8.6) • Java8 support
  10. Groovy 2.3.6

  11. @CompileStatic ੩తܕ෇͖ͰίϯύΠϧ Javaฒʹര଎ʹͳΔ

  12. import groovy.transform.CompileStatic ! @CompileStatic int f(int a, int b) {

    return a + b } ! def a = f(10, 20) // ܕਪ࿦͸ޮ͘ println(a) import͕ඞਢ ASͩͱ੺͘ͳΔ
  13. @CompileStaticͰมΘΔ͜ͱ • Gradle Pluginͷ࣮ߦ͕ߴ଎ʹͳΔ • ͨͩ͠ݴޠ͸ʮGroovyͷํݴʯʹͳΔ • ࢖༻ײ͕͚ͬ͜͏ҧ͏ • Android

    Gradle Pluginͷresource merge͸଎͘ ͳΔ…͔΋
  14. ·ͱΊ • Android Gradle Plugin 0.13Ͱ͸Gradle 2.1Λ࠾ ༻ͨ͠ • Gradle

    2.1͸pluginػߏ͕Ұ৽͞ΕͯΔͷͰ AndroidΤίγεςϜͰ΋ظ଴ײͷߴ·Γ͕͋Δ • Gradle 2.1͸Groovy 2.3.6Λ࠾༻͍ͯ͠ΔͷͰ଎ ౓໘ͰվળͷݟࠐΈ͕͋Δ