Road to enterprise level gradle multi project. Gradle Build Recipe

Road to enterprise level gradle multi project. Gradle Build Recipe

Gyeongil Goo
LINE Plus LINE Server dev Team Software Engineer
https://linedevday.linecorp.com/jp/2019/sessions/S1-15

Be4518b119b8eb017625e0ead20f8fe7?s=128

LINE DevDay 2019

November 20, 2019
Tweet

Transcript

  1. 2019 DevDay Road to Enterprise Level Gradle Multi Project. Gradle

    Build Recipe > Gyeongil Goo > LINE Plus LINE Server dev Team Software Engineer
  2. > Have deep interest of productivity > Your Friendly Neighborhood

    > Server developer who works with Java/Kotlin About Myself
  3. Era of Microservice And Mono-Repo Multi Project

  4. Multi vs Mono Repo? Protocol Repo Client Repo Server Repo

    Commit Commit Commit Repo Protocol Client Server Commit!
  5. Single vs Multi Application? Juice Repo Coffee Repo Client Protocol

    Server Client Protocol Server Beverage Repo Juice Client Juice Protocol Juice Server Coffee Client Coffee Protocol Coffee Server
  6. Beverage Shop !"" coffee # $"" api # !"" client

    # !"" protocol # $"" server !"" juice # $"" api # !"" client # !"" protocol # $"" server $"" shop $"" server
  7. Coffee Protocol and Client coffee/api/protocol/build.gradle.kts coffee/api/client/build.gradle.kts

  8. Juice Protocol and Client juice/api/protocol/build.gradle.kts juice/api/client/build.gradle.kts

  9. Gradle Configure Api

  10. Beverage Shop !"" coffee # $"" api # !"" client

    - type=java-boot-lib # !"" protocol - type=java-lib # $"" server - type=java-boot-application !"" juice # $"" api # !"" client - type=java-boot-lib # !"" protocol - type=java-lib # $"" server - type=java-boot-application $"" shop $"" server - type=java-boot-application
  11. Project Configuration

  12. Project Configuration

  13. Gradle Recipe Plugin

  14. Type Descriptor > Only one type descriptor per project >

    java-lib, java-boot-lib, java-boot-application, java-boot-servlet-application, java-boot-servlet-war > For hierarchical, vertical characteristics
  15. Type Descriptors configureByType(type: String) configureByTypePrefix(typePrefix: String) configureByTypeSuffix(typeSuffix: String) configureByTypeHaving(varargs typelets:

    String) configureByTypeExpression(expr: String)
  16. Label Descriptor > Multiple labels descriptors can be applied for

    one project > spring-boot1, spring-boot2, spring-boot-2dot2, junit4, junit5 > For horizontal characteristics
  17. Label Descriptors configureByLabel(label: String) configureByLabels(varargs labels: String)

  18. Composite Descriptors configure(byTypePrefix(“java”) and byTypeSuffix(“lib”)) configure(byTypePrefix(“java”) or byTypePrefix(“kotlin”)) configure(not(byTypePrefix(“scala”)))

  19. Build Recipe Example

  20. Coffee Protocol and Client coffee/api/protocol/build.gradle.kts apply(plugin=“java”) apply(plugin=“java-library”) dependencies { ...

    } coffee/api/client/build.gradle.kts
  21. Beverage Shop !"" coffee # $"" api # !"" client

    - type=java-boot-lib # !"" protocol - type=java-lib # $"" server - type=java-boot-application !"" juice # $"" api # !"" client - type=java-boot-lib # !"" protocol - type=java-lib # $"" server - type=java-boot-application $"" shop $"" server - type=java-boot-application
  22. Beverage Shop !"" yogurt $"" api !"" client - type=java-boot-lib

    !"" protocol - type=java-lib $"" server - type=java-boot-application
  23. Goodness > Can organize similar sub projects > Less coupled

    with library dependency issues, by dependency label > Easy to add new modules or applications > Don’t repeat yourself
  24. Recommend This Plugin to > Wanna reduce the cost to

    read gradle script > Wanna reduce the cost to maintain similar but different based applications > Can expect more similar applications > Start to manage multi-application mono-repo with gradle
  25. Now Available! > https://github.com/line/multi-project-support

  26. One More Thing

  27. Beverage Shop !"" coffee # $"" api # !"" client

    # !"" protocol # $"" server !"" juice # $"" api # !"" client # !"" protocol # $"" server $"" shop $"" server
  28. Recursive Git Log Plugin

  29. Thank You