Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Micronaut - Productivité développeur

Micronaut - Productivité développeur

Cédric Champeau

May 11, 2022
Tweet

More Decks by Cédric Champeau

Other Decks in Technology

Transcript

  1. Developer Productivity
    How Micronaut is built
    Cédric Champeau
    Micronaut Developer
    Oracle Labs

    View Slide

  2. • Working at Oracle Labs on Micronaut

    Main focus on build plugins and dev
    productivitity
    • Formerly working at Gradle Inc
    • Author of static compiler of Groovy
    • Amateur astronomer

    @CedricChampeau

    https://www.astrobin.com/users/melix/
    About me
    Copyright © 2022, Oracle and/or its affiliates
    micronaut.io github.com/micronaut-projects/micronaut-core
    https://melix.github.io/blog/2022/05/astro-twitch.html

    View Slide

  3. • Micronaut is focused on modern
    architectures like Serverless and
    Microservices
    • Also a complete framework for any type of
    application
    • Lightweight, reactive (HTTP Client/Server
    based on Netty)
    • Annotation processor to compute framework
    infrastructure at compile time
    Micronaut
    Copyright © 2022, Oracle and/or its affiliates
    micronaut.io github.com/micronaut-projects/micronaut-core

    View Slide

  4. Micronaut = Build Time Framework Infrastructure
    Copyright © 2022, Oracle and/or its affiliates
    Micronaut computes:
    • All dependency & configuration injection
    • Annotation metadata, meta-annotations
    • AOP proxies
    • Bean introspections
    • And all other framework infrastructure
    • Reflection, runtime proxy, and dynamic
    classloader free

    View Slide

  5. Micronaut is Open Source
    Copyright © 2022, Oracle and/or its affiliates
    • Hosted at GitHub
    • Managed by the Micronaut Foundation
    • 92 Git repositories

    ~60 modules
    • Each project versioned independently

    View Slide

  6. Micronaut releases
    Copyright © 2022, Oracle and/or its affiliates
    • Core version drives a “Micronaut release”
    • Micronaut Core BOM includes many
    Micronaut modules
    • Gradle and Maven plugin integrate with the
    BOM

    View Slide

  7. GitHub Workflows
    Copyright © 2022, Oracle and/or its affiliates
    • Micronaut Project Template

    Used to create new modules

    Defines project “template”

    Defines files to be sync’ed on all projects

    Shared configuration (checkstyle rules, ...)

    View Slide

  8. GitHub Workflows: custom GitHub Actions
    Copyright © 2022, Oracle and/or its affiliates
    See https://github.com/micronaut-projects/github-actions
    - release note generation
    - BOM updates
    - Micronaut Launch deployment helpers

    View Slide

  9. GitHub Workflows: one-click releases
    Copyright © 2022, Oracle and/or its affiliates

    View Slide

  10. Micronaut Build
    Copyright © 2022, Oracle and/or its affiliates
    • An internal plugin suite
    • Models how Micronaut modules are built
    • Configures common behavior

    Quality checks

    Sonar

    Publication to Maven Central

    Build cache

    Test selection

    ...

    View Slide

  11. Gradle “convention plugins”
    Copyright © 2022, Oracle and/or its affiliates
    • For Maven users, think of “composite parent POMs”
    • Take care of shared configuration, aka conventions
    • Different plugins

    From Micronaut Build Plugins (internal)
     io.micronaut.build.internal.module : typical Micronaut module, with annotation
    processing enabled, published on Maven Central, etc.
     io.micronaut.build.internal.bom: a “platform”, or BOM for Maven

    View Slide

  12. Copyright © 2022, Oracle and/or its affiliates
    Demo: Writing a convention plugin

    View Slide

  13. Gradle “convention plugins”
    Copyright © 2022, Oracle and/or its affiliates
    Root project:
    plugins {
    id("io.micronaut.build.internal.docs")
    id("io.micronaut.build.internal.quality-reporting")
    }
    Module:
    plugins {
    id("io.micronaut.build.internal.aot-project")
    }
    description = "Micronaut AOT API, for integration in build/CLI tools"
    dependencies {
    implementation(projects.aotCore)
    }

    View Slide

  14. Gradle “convention plugins”
    Copyright © 2022, Oracle and/or its affiliates
    “Local” convention plugin:
    // build-logic/src/main/groovy/io.micronaut.build.internal.aot-project.gradle
    plugins {
    id "io.micronaut.build.internal.base-module"
    }
    micronautBuild {
    enableProcessing = false
    enableBom = false
    }

    View Slide

  15. Gradle “convention plugins”
    Copyright © 2022, Oracle and/or its affiliates
    • For Maven users, think of “composite parent POMs”
    • Take care of shared configuration, aka conventions
    • Different plugins

    From Micronaut Build Plugins (internal)
     io.micronaut.build.internal.module : typical Micronaut module, with annotation
    processing enabled, published on Maven Central, etc.
     io.micronaut.build.internal.bom: a “platform”, or BOM for Maven

    View Slide

  16. Gradle task wiring
    Copyright © 2022, Oracle and/or its affiliates
    • Forget about Maven lifecycle
    • In Gradle, lifecycle is dynamic
    A task
    (compileJava, test, ...)
    inputs
    outputs
    https://melix.github.io/blog/2021/10/gradle-quickie-dependson.html
    https://melix.github.io/blog/2022/01/understanding-provider-api.html

    View Slide

  17. Example: generating BOMs
    Copyright © 2022, Oracle and/or its affiliates

    View Slide

  18. Gradle “convention plugins”
    Copyright © 2022, Oracle and/or its affiliates
    • Each project may declare specific modules

    View Slide

  19. Gradle Entreprise : Build Scans
    Copyright © 2022, Oracle and/or its affiliates
    Visit https://ge.micronaut.io

    View Slide

  20. Gradle Entreprise : Build Scans
    Copyright © 2022, Oracle and/or its affiliates
    Visit https://ge.micronaut.io

    View Slide

  21. Gradle Enterprise: avoidance savings
    Copyright © 2022, Oracle and/or its affiliates

    View Slide

  22. Gradle Entreprise : Build Cache
    Copyright © 2022, Oracle and/or its affiliates
    Visit https://ge.micronaut.io

    View Slide

  23. Gradle Entreprise : Flaky Test Detection
    Copyright © 2022, Oracle and/or its affiliates
    Visit https://ge.micronaut.io

    View Slide

  24. Gradle Enterprise: predictive test selection
    Copyright © 2022, Oracle and/or its affiliates

    View Slide

  25. What about users?
    Copyright © 2022, Oracle and/or its affiliates
    • Gradle plugins are designed with the same composition model in mind
    ● io.micronaut.application = micronaut + application + docker + GraalVM
    ● io.micronaut.library = micronaut + library + docker + GraalVM
    ● io.micronaut.minimal.application = micronaut + application
    ● io.micronaut.minimal.library = micronaut + library
    • Declarative as much as possible

    View Slide

  26. Copyright © 2022, Oracle and/or its affiliates
    26
    Thank you!
    Slides coming at @CedricChampeau

    View Slide