Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for setting target source set #214

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

monosoul
Copy link
Owner

This PR introduces support for setting target source set for each GenerateJooqClassesTask instance.

Source sets are configured right after the plugin is applied, but before the build script (project) is evaluated, so source set configuration happens before any values are set in the buildscript. This means a project extension can't be used to configure the source set name for the plugin to generate sources for (the source set will be configured before targetSourceSet value is set). Therefore I took a different approach here: we configure all source sets to include GenerateJooqClassesTask tasks output where targetSourceSet value of the task matches the source set name.

This way it is possible to avoid using something like project.afterEvaluate to configure source sets and configuration still happens lazily.

Fixes #213

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.34%. Comparing base (58f4d40) to head (597cd6b).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #214      +/-   ##
============================================
+ Coverage     97.32%   97.34%   +0.01%     
- Complexity      141      142       +1     
============================================
  Files            27       27              
  Lines           598      602       +4     
  Branches         24       24              
============================================
+ Hits            582      586       +4     
  Misses            5        5              
  Partials         11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

To use the snapshot version of the plugin add this to settings.gradle.kts:

pluginManagement {
  repositories {
    maven {
      name = "JooqDockerPluginSnapshotRepo"
      url = uri("https://maven.pkg.github.com/monosoul/jooq-gradle-plugin/")
      credentials {
        username = "<your GitHub username>"
        password = "<your GitHub access token with read:packages scope>"
      }
    }
    gradlePluginPortal()
  }
}

And this to build.gradle.kts:

plugins {
  id("dev.monosoul.jooq-docker") version "SNAPSHOT-58e6ce866ec07fda84268bcbf657b8428e137cd6"
}

@monosoul monosoul merged commit 4a1ae8f into main Jul 31, 2024
7 checks passed
@monosoul monosoul deleted the feat/target-source-set-configuration branch July 31, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possibility to specify source set
1 participant