Conversation
- Add TimeGradlePlugin applying plugin ID 'io.spine.time' - Add TimeGradleExtension with useJavaExtensions / useKotlinExtensions properties - Add TimeLibrary with runtime, javaExtensions, kotlinExtensions artifacts - Add Meta backed by LazyMeta for version resolution at runtime - Configure artifactMeta with spine-time, spine-time-java, spine-time-kotlin - Set up custom publishing under io.spine.tools:time-gradle-plugin - Add jvmToolPlugins to buildscript classpath for io.spine.artifact-meta - Include gradle-plugin in settings and exclude it from standard publishing
... so that the `publishing` block is available.
- Add `TimeLibrary.testLib` for `io.spine:spine-time-testlib` - Add `useTestLib: Property<Boolean>` to `TimeGradleExtension` - When `true`, add `spine-time-testlib` to `testImplementation` - Tailor the missing-configuration error for `testImplementation` - Cover `useTestLib` with `TimeGradlePluginSpec`
…`useKotlinExtensions`
- Replace `Plugin<Project>` with `LibraryPlugin<TimeGradleExtension>`,
passing `DslSpec(TimeGradleExtension.NAME, TimeGradleExtension::class)`
to the constructor.
- Extension is now nested under `RootExtension` (i.e. `spine.time { ... }`);
creation is delegated to `LibraryPlugin`.
- Extract plugin logic into a private `Project.configureTime()` function
and a private `Project.timeExtension` property backed by
`spineExtension<TimeGradleExtension>()`.
- Add `ToolBase.gradlePluginApi` dependency to the compile classpath,
where `LibraryPlugin`, `DslSpec`, and `spineExtension` reside.
- Declare `spine-time-testlib` in `addDependencies` so that
`LazyMeta.dependency()` can resolve it at runtime.
- Update `TimeGradlePluginSpec` to obtain the extension via
`project.spineExtension<TimeGradleExtension>()`.
... because there's no such a module any more.
- Replace plain `object Time` with `object Time : Dependency()`. - Override `group`, `version`, and `modules` to satisfy the abstract contract. - Add `lib(version)`, `javaExtensions(version)`, `kotlinExtensions(version)`, and `testLib(version)` functions for explicit-version overloads, following the same pattern as `Compiler`. - Keep `val lib`, `val javaExtensions`, `val kotlinExtensions`, and `val testLib` as computed properties backed by `version`, preserving all existing call sites. - Make `infix` private — it is only used internally. - `modules` strips the version suffix from each coordinate (same pattern as `Compiler`), including `testLib` which lives under `io.spine.tools`. - Update `@Suppress` annotations to match the standard set used on `Compiler`.
- Rename the artifact from `spine-time-testlib` to `time-testlib` in all references — `Time.testLib`, `TimeLibrary.testLib`, `artifactMeta.addDependencies`, and KDoc — to follow the `io.spine.tools` group convention of not using the prefix. - Override the publication `artifactId` in `time-testlib/build.gradle.kts` so that `spinePublishing`'s default `spine-` prefix is not applied when the module is published. - Replace hard-coded coordinate strings in `gradle-plugin/build.gradle.kts` with `Time.lib()`, `Time.javaExtensions()`, `Time.kotlinExtensions()`, and `Time.testLib()` calls. - Merge `hasImplDep` / `hasTestImplDep` in `TimeGradlePluginSpec` into a single `hasDependency(artifact, configuration)` helper.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0b7429f01
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| named<MavenPublication>("pluginMaven") { | ||
| artifactId = moduleArtifactId | ||
| addSourceAndDocJars(project) |
There was a problem hiding this comment.
Reset marker publication coordinates for plugin DSL resolution
This block restores coordinates only for pluginMaven, but the module is also routed through custom Spine publishing (modulesWithCustomPublishing), which rewrites all Maven publications via copyProjectAttributes() (prefixing artifactId and forcing groupId). As a result, the generated marker publication (spineTimePluginMarkerMaven) keeps incorrect coordinates, so consumers using plugins { id("io.spine.time") version "..." } cannot resolve the plugin from your Maven repositories because Gradle looks for the unmodified marker coordinates.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #187 +/- ##
============================================
- Coverage 93.21% 92.75% -0.46%
- Complexity 294 304 +10
============================================
Files 53 57 +4
Lines 943 980 +37
Branches 26 31 +5
============================================
+ Hits 879 909 +30
- Misses 56 61 +5
- Partials 8 10 +2 🚀 New features to boost your workflow:
|
This PR extends the Time library with an ability to add the artifacts of the library via
io.spine.timeGradle plugin.Later this plugin will allow to add code generation for the
(when)validation option.Other notable chages
spine-prefix in the name. So, the coordinate for the test library isio.spine.tools:time-testlib:$version.configwas applied.