jbake-gradle-plugin icon indicating copy to clipboard operation
jbake-gradle-plugin copied to clipboard

[question/feature] Allow idiomatic incoming and outgoing artifacts

Open lacasseio opened this issue 4 years ago • 2 comments

I'm extensively using this plugin to build the website, documentation, sample, etc of https://nokee.dev. My documentation is split between several projects and repositories. Each version are baked individually to avoid cross-over in the jbake model while others are assembled and backed together. I wish to split it even more for improved cache and up-to-date. Unfortunately, sharing the content, assets, templates and baked elements is a bit troublesome. Before start writing a formal wrapper expose those as configuration and allow maven publishing, composite build and multi-project, are these features interesting for this project?

It could look something like this:

Consuming

Consumer project:

plugins {
    id 'org.jbake.site' version '5.0.0'
}

dependencies {
    content project(':producer')
}

The consumer would get all the content files before baking. If there are any generated content files, it would be generated and added to the directory for the consumer to bake.

Producing

plugins {
    id 'org.jbake.site' version '5.0.0'
    id 'maven-publish'
}

publishing {
    repositories {
        // ...
    }
    publications {
        all(MavenPublication) {
            from components.jbake
        }
    }
}

The component jbake would include a zip for each major artifacts: assets, content, templates and baked. We could add more components for the artifacts most likely shared between projects.

You can see a cowboy implementation of this concept here.

lacasseio avatar Jun 25 '20 18:06 lacasseio

This is a good reference implementation of what I was explaining above.

lacasseio avatar Jun 26 '20 03:06 lacasseio

I think this would be a good addition to the plugin, as long as the current behavior remains the default and the additional behavior can be activated with a configuration flag

aalmiray avatar Jun 28 '20 11:06 aalmiray