oyvindberg / bleep

A bleeping fast scala build tool!
MIT License
150 stars 21 forks source link

${BLEEP_VERSION} propogated to dependencies? #329

Open markehammons opened 1 year ago

markehammons commented 1 year ago

In this repo, I locally published my scoverage plugin, with the scoverage depending on the bleep version via ${BLEEP_VERSION}. When trying to use this plugin in a different project, I got the following error:

📕 Error while loading build: Error resolving dependencies for scoverage: Error downloading build.bleep:bleep-core_3:${BLEEP_VERSION}
  not found: /home/mhammons/.ivy2/local/build.bleep/bleep-core_3/${BLEEP_VERSION}/ivys/ivy.xml
  not found: https://repo1.maven.org/maven2/build/bleep/bleep-core_3/${BLEEP_VERSION}/bleep-core_3-${BLEEP_VERSION}.pom

Using 0.0.2 instead fixes the issue. I assume this is a bug, and ${BLEEP_VERSION} should not be showing up in the dependencies of the published artifacts.

nafg commented 2 weeks ago

Tracked it down to packageLibraries, this line project.dependencies.values.iterator.map(_.asDependency(versionCombo).orThrowTextWithContext(projectName)) is returning it uninterpolated. I'm not sure if the issue is project.dependencies not resolving the reference or it should be doing it here.

I see e.g. CoursierResolver is using Replacements to replace Deps. I suppose packageLibraries should be calling it also?

Why are Deps that are not replaced hanging around altogether?

oyvindberg commented 2 weeks ago

Tracked it down to packageLibraries I suppose it makes sense to patch it there

Why are Deps that are not replaced hanging around altogether? we keep the original build around because we can write back to the original file - for instance.