Skip to content

Migrate to sbt 2#564

Draft
lenguyenthanh wants to merge 2 commits into
mainfrom
sbt-2/0
Draft

Migrate to sbt 2#564
lenguyenthanh wants to merge 2 commits into
mainfrom
sbt-2/0

Conversation

@lenguyenthanh

Copy link
Copy Markdown
Owner

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

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
@lenguyenthanh lenguyenthanh marked this pull request as draft June 6, 2026 07:17
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.

1 participant