Skip to content

Converting the project to a multi-module project #25

@philliplbryant

Description

@philliplbryant

As part of the work I am doing for issue #13, I refactored the project into a multi-module project and separated build-logic into an included build. This allows the persistence framework, which would be incorporated in a follow on task, to remain separate from the rest of BentoFX and gives users the ability to continue using the docking framework without persistence.

I am proposing the following structure, where modules and directories in bold would be introduced as part of this task. Other modules are planned for future introduction and are shown for additional context.

For my Team's applications - which will be using BentoFx - we have done a lot of work creating reusable build logic that is highly refined, performant, and tested. With your permission, we will integrate some of our build logic into this project and make the changes necessary to use it. The build logic:

  • Will DRY up (don't repeat yourself) Gradle configurations, enabling them to be and shared among modules.
  • Pre-compiles, making builds faster.
  • Uses Gradle's configuration cache, making builds faster.
  • Uses Gradle's build cache
    • Tasks are only executed when they are not up-to-date.
    • Build outputs are also cached; when a task is up to date, but its outputs are missing (e.g. after executing clean), the outputs are retrieved from the build cache rather than being reconstructed.
  • Uses a version catalog to help ensure dependencies are consistently versioned
  • Uses type-safe accessors for all dependency declarations

Our build logic is currently implemented in Kotlin, but we can convert it to Groovy before final submission if that is preferred.

@Col-E, if it make sense to do so, and it helps move this request forward, I am willing to work with you to integrate this build logic into your Recaf project.

I don't want to impose any unwelcome changes but I am offering to make changes that I believe will be beneficial to the project.

As I mentioned in another issue, I ran into an administrative issue with my employer that is delaying me from creating a pull request with these changes. I'd be happy to share the work if you're interested in and are willing to wait a few more days while I work to resolve the admin issue with my employer?

Here's the project layout I am currently using:

BentoFx
assets
  Existing files with added markdown documents and diagrams for persistence framework.
build-logic
  Shared Gradle configurations
core
  The existing docking framework, moved from the single-module project, with minimal changes to reuse build logic.
demos
  basic-demo
   Moved from the current src/test/java directory of the single-module project
  persistence-demo
   The basic-demo modified to use the persistence framework
gradle
  libs.versions.toml
   This is where dependencies and dependency versions are declared for consistency and re-use among    modules
 persistence
  api
   Common, core functionality for persisting bento layouts
  codec
   common
    Common, core functionality for encoding/decoding bento layouts
   json
    Functionality specific to encoding/decoding bento layouts in JSON format
  xml
   Functionality specific to encoding/decoding bento layouts in XML format
  storage
   db
    h2
     Functionality specific to writing/reading bento layouts from an H2 database
   file
    Functionality specific to writing/reading bento layouts from a file on the local file system
   test-fixtures
    Sharable classes that are used by tests - mocks behavior for things like codec and storage implementations
platform
  Dependency constraints and alignment
build.gradle
  Modified to apply additional plugins
   Dependency Analysis Gradle plugin
    Provides advice for managing dependencies and other applied plugins
    https://github.com/autonomousapps/dependency-analysis-gradle-plugin
   JVM Dependency Conflict Gradle plugin
    Managing JVM dependency conflicts in Gradle
    https://github.com/gradlex-org/jvm-dependency-conflict-resolution
   Versions Check Gradle plugin
    Checks dependency and Gradle updates in the spirit of the Maven Versions Plugin
    https://github.com/ben-manes/gradle-versions-plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions