Conversation
Gradle 7 and Android Plugin 3 have dropped the compile configurations. https://docs.gradle.org/current/userguide/upgrading_version_6.html https://developer.android.com/build/releases/agp-3-0-0-release-notes
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@claude review |
|
@codex what about minor issues? |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex what about minor issues? |
|
To use Codex here, create an environment for this repo. |
|
@codex review and also point out minor issues |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9e7e55594
ℹ️ 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".
| else -> { | ||
| project.logger.warn( | ||
| "ObjectBox: Could not add dependency on objectbox-processor, " + | ||
| "no supported configuration (kapt, annotationProcessor, apt) found." | ||
| "ObjectBox: Could not add dependency on ${Const.OBX_PROCESSOR}, " + | ||
| "no supported configuration (${Const.KAPT_CONFIGURATION_NAME}, " + | ||
| "${JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME}) found." |
There was a problem hiding this comment.
Restore
apt fallback for processor dependency
This refactor dropped the apt configuration branch, so projects that still wire annotation processors through an apt configuration (instead of kapt/annotationProcessor) will now skip adding objectbox-processor and fail to generate ObjectBox sources. This is a behavioral regression from the previous implementation and should either keep the apt fallback or explicitly migrate/guard those builds before removing support.
Useful? React with 👍 / 👎.
Also update message for JVM database library to explicitly mention its the JVM variant.
The lowest supported Gradle version (7.0) does support the new annotationProcessor configuration since a few releases. Plugins that use the apt configuration aren't maintained for many years.
f9e7e55 to
229c482
Compare
Currently it's required to add manual configuration to help resolve the Gradle plugin. A marker artifact is required to avoid this. It might be easiest and future proof to use Gradle's plugin development plugin (example config of Android plugin) and publish to the Gradle plugin portal (or maybe not, the Android plugin appears not to and still doesn't require a workaround).
This requires publishing a Plugin Marker artifact like
plugin.id:plugin.id.gradle.plugin:plugin.version, so currentlyio.objectbox:io.objectbox.gradle.plugin:5.2.1andio.objectbox.sync:io.objectbox.sync.gradle.plugin:5.2.1.The Android plugin publishes this on Google's Maven repo (example). So using the Gradle plugin portal seems not required.
Fortunately, our namespace on Maven Central is already
io.objectbox. It should therefore be possible to publish with the group IDio.objectbox.syncas well.Drop apply last requirement
Currently it is necessary to apply the ObjectBox plugin after the
dependenciesblock in a Gradle script so it can detect already added dependencies. This approach is not compatible with applying the plugin by using the recommendedpluginsblock. It's also hard to discover this is required when manually adding dependencies (only mentioned in our Advanced docs).The Kotlin Gradle plugin solves this using
configuration.withDependencies { }to check for existing dependencies and add ones as needed. (Maybe also find out how the Android plugin does it.)This might require finding a different way than
ProjectBuilderinPluginApplyTests to test if dependencies are added. The Kotlin Gradle plugin tests add a custom task that prints added libraries and asserts log output.