Migrate to sbt 2#564
Draft
lenguyenthanh wants to merge 2 commits into
Draft
Conversation
Make Dumbo migrations visible to compile-time macro under sbt 2.0 In sbt 2.0, scalac compiles to `target/.../backend/` while resources are copied to `target/.../classes/`. The compiler/macro classpath uses `backendOutput`, not `classDirectory`, so resources are invisible to compile-time macros. Dumbo's `withResourcesIn` resolves migration files via `getResources` at macro-expansion time and aborted with `resource db/migration was not found`. Append the resource directory directly to `db / Compile / dependencyClasspath` so the macro classloader can locate `db/migration/`. Also scope `docker*` settings to backend/cli only and exclude unused sbt-native-packager keys from `lintUnused` to silence 38 sbt 2.0 warnings. Use rootProject.autoAggregate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make Dumbo migrations visible to compile-time macro under sbt 2.0
In sbt 2.0, scalac compiles to
target/.../backend/while resources are copied totarget/.../classes/. The compiler/macro classpath usesbackendOutput, notclassDirectory, so resources are invisible to compile-time macros. Dumbo'swithResourcesInresolves migration files viagetResourcesat macro-expansion time and aborted withresource db/migration was not found.Append the resource directory directly to
db / Compile / dependencyClasspathso the macro classloader can locatedb/migration/.Also scope
docker*settings to backend/cli only and exclude unused sbt-native-packager keys fromlintUnusedto silence 38 sbt 2.0 warnings.Use rootProject.autoAggregate