Skip to content

Fix #2678: Handle projects with only resources - #2692

Merged
tgodzik merged 6 commits into
scalacenter:mainfrom
wiacekm:2678-only-resource-project
Jul 2, 2025
Merged

Fix #2678: Handle projects with only resources#2692
tgodzik merged 6 commits into
scalacenter:mainfrom
wiacekm:2678-only-resource-project

Conversation

@wiacekm

@wiacekm wiacekm commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

Bloop did not recognize projects that contain only resources and no Scala or Java sources. This change ensures that such projects are correctly handled by copying resources even when no sources are present.

  • Add test case covering resource-only project scenario
  • Ensure resources are copied when both Java and Scala sources are missing

Michał Wiącek added 3 commits June 24, 2025 16:12
add test covering example
copy resources in case of both java and scala sources are missing

NOTE: this is POC
@wiacekm
wiacekm force-pushed the 2678-only-resource-project branch from 53b72be to 6e6afe2 Compare June 24, 2025 14:24
make case object instead of case class
check case with java sources only

@tgodzik tgodzik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Two minor comments from me

compileProjectTracer.terminate()
Task.now(earlyResultBundle)
case Right(CopyResourcesOnly) =>
val denylist = Set.empty[Path] // TODO: verify if it shouldn't be computed somehow

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have anything that we don't want to copy, this is usually useful for invalidated sources. It's safe to set it to empty for this use case

I wonder if we should delete anything no longer available, but that might be a separate thing altogether.

Comment thread frontend/src/test/scala/bloop/BaseCompileSpec.scala Outdated
wiacekm and others added 2 commits June 30, 2025 10:50
Co-authored-by: Tomasz Godzik <tgodzik@users.noreply.github.com>
@wiacekm
wiacekm marked this pull request as ready for review July 1, 2025 06:29

@tgodzik tgodzik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgodzik
tgodzik merged commit 0a82548 into scalacenter:main Jul 2, 2025
12 of 13 checks passed
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.

2 participants