Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a cache based on hashing of the inputs of bundleTask #100

Merged
merged 4 commits into from
Jan 1, 2024

Conversation

romainreuillon
Copy link
Contributor

In case no file and no settings have been modified and the bundle exist do no generate it.

Add an opt-in key to avoid breaking things...

It solves #27

@romainreuillon
Copy link
Contributor Author

Please do not merge yet. I am going to implement alternative cache strategy based on hash or on lastModified...

@mdedetrich
Copy link
Collaborator

Please do not merge yet. I am going to implement alternative cache strategy based on hash or on lastModified...

@romainreuillon Is this PR being worked on?

@romainreuillon
Copy link
Contributor Author

Hi @mdedetrich, it is actually complete.

There are 2 caching modes: modification time based or hash based.

I'll implement an hybrid mode, checking modification time and then hash at some point but it requires way more work. I'll do that in a new PR.

This one is ready to merge.

@mdedetrich mdedetrich merged commit 797e885 into sbt:main Jan 1, 2024
10 checks passed
@mdedetrich
Copy link
Collaborator

@romainreuillon Released as v0.9.10

Copy link

@Roiocam Roiocam left a comment

Choose a reason for hiding this comment

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

Thanks for the great work, leave some compatibility suggestions.

import _root_.java.nio.file._
import _root_.scala.collection.JavaConverters._
val path = tmpArtifactDirectoryPath.toPath
Files.walk(path).iterator.asScala.map(f => f.toFile -> path.relativize(f).toString).filterNot { case (_, p) => p == "META-INF/MANIFEST.MF" }.toTraversable
Copy link

Choose a reason for hiding this comment

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

@mdedetrich This "META-INF/MANIFEST.MF" maybe cause an issue on Windows.

could you change to this like #115 does?

 Files.walk(path).iterator.asScala.map(f => f.toFile -> path.relativize(f))
              .collect { case (f, p) if p != (file("META-INF") / "MANIFEST.MF").toPath => (f, p.toString) }

Copy link

@Roiocam Roiocam Jan 25, 2024

Choose a reason for hiding this comment

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

NVM, I walked into the wrong CR path, this is an outdated comment.

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.

3 participants