Giter VIP home page Giter VIP logo

Comments (8)

huntc avatar huntc commented on September 7, 2024

How about:

Seq(digest, rjs, digest)

I've not tried that though....

from sbt-web.

akkie avatar akkie commented on September 7, 2024

This doesn't work.

With the pipeline Seq(digest, rjs, digest, gzip) I get:

java.util.zip.ZipException: duplicate entry: public/css/error/bed54f9c63eebb80e9c2137b2d48daa4-sprites.min.css.map
    at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:215)
    at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
    at sbt.IO$.sbt$IO$$addFileEntry$1(IO.scala:445)
    at sbt.IO$$anonfun$sbt$IO$$writeZip$2.apply(IO.scala:454)
    at sbt.IO$$anonfun$sbt$IO$$writeZip$2.apply(IO.scala:454)
    at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at sbt.IO$.sbt$IO$$writeZip(IO.scala:454)
    at sbt.IO$$anonfun$archive$1.apply(IO.scala:407)
    at sbt.IO$$anonfun$archive$1.apply(IO.scala:405)
    at sbt.IO$$anonfun$withZipOutput$1.apply(IO.scala:500)
    at sbt.IO$$anonfun$withZipOutput$1.apply(IO.scala:486)
    at sbt.Using.apply(Using.scala:25)
    at sbt.IO$.withZipOutput(IO.scala:486)
    at sbt.IO$.archive(IO.scala:405)
    at sbt.IO$.jar(IO.scala:388)
    at sbt.Package$.makeJar(Package.scala:107)
    at sbt.Package$$anonfun$3$$anonfun$apply$3.apply(Package.scala:72)
    at sbt.Package$$anonfun$3$$anonfun$apply$3.apply(Package.scala:70)
    at sbt.Tracked$$anonfun$outputChanged$1.apply(Tracked.scala:57)
    at sbt.Tracked$$anonfun$outputChanged$1.apply(Tracked.scala:52)
    at sbt.Package$.apply(Package.scala:80)
    at sbt.Defaults$$anonfun$packageTask$1.apply(Defaults.scala:650)
    at sbt.Defaults$$anonfun$packageTask$1.apply(Defaults.scala:649)
    at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:54)
    at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:53)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
[error] (*:playPackageAssets) java.util.zip.ZipException: duplicate entry: public/css/error/bed54f9c63eebb80e9c2137b2d48daa4-sprites.min.css.map

With the pipeline Seq(digest, rjs, digest) I get:

java.io.FileNotFoundException: /home/christian/Projects/my.project/target/web/less/main/css/utils/_main.min.css.map (File or directory not found)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at org.apache.ivy.util.ChecksumHelper.compute(ChecksumHelper.java:96)
    at org.apache.ivy.util.ChecksumHelper.computeAsString(ChecksumHelper.java:92)
    at com.typesafe.sbt.digest.SbtDigest$.com$typesafe$sbt$digest$SbtDigest$$generateChecksumFiles(SbtDigest.scala:41)
    at com.typesafe.sbt.digest.SbtDigest$$anonfun$checksumFiles$1$$anonfun$apply$1$$anonfun$3$$anonfun$apply$2.apply(SbtDigest.scala:60)
    at com.typesafe.sbt.digest.SbtDigest$$anonfun$checksumFiles$1$$anonfun$apply$1$$anonfun$3$$anonfun$apply$2.apply(SbtDigest.scala:59)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
    at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
    at com.typesafe.sbt.digest.SbtDigest$$anonfun$checksumFiles$1$$anonfun$apply$1$$anonfun$3.apply(SbtDigest.scala:59)
    at com.typesafe.sbt.digest.SbtDigest$$anonfun$checksumFiles$1$$anonfun$apply$1$$anonfun$3.apply(SbtDigest.scala:58)
    at scala.collection.TraversableLike$WithFilter$$anonfun$flatMap$2.apply(TraversableLike.scala:753)
    at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at scala.collection.TraversableLike$WithFilter.flatMap(TraversableLike.scala:752)
    at com.typesafe.sbt.digest.SbtDigest$$anonfun$checksumFiles$1$$anonfun$apply$1.apply(SbtDigest.scala:58)
    at com.typesafe.sbt.digest.SbtDigest$$anonfun$checksumFiles$1$$anonfun$apply$1.apply(SbtDigest.scala:53)
    at scala.Function$$anonfun$chain$1$$anonfun$apply$1.apply(Function.scala:24)
    at scala.Function$$anonfun$chain$1$$anonfun$apply$1.apply(Function.scala:24)
    at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
    at scala.collection.immutable.List.foldLeft(List.scala:84)
    at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:138)
    at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:105)
    at scala.Function$$anonfun$chain$1.apply(Function.scala:24)
    at com.typesafe.sbt.web.SbtWeb$$anonfun$projectSettings$36.apply(SbtWeb.scala:208)
    at com.typesafe.sbt.web.SbtWeb$$anonfun$projectSettings$36.apply(SbtWeb.scala:208)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
[error] (*:webPipeline) java.io.FileNotFoundException: /home/christian/Projects/my.project/target/web/less/main/css/utils/_main.min.css.map (File or directory not found)

from sbt-web.

huntc avatar huntc commented on September 7, 2024

@pvlugter Any thoughts on this?

from sbt-web.

huntc avatar huntc commented on September 7, 2024

I think that the best approach here would be to update any urls within js, css and html assets with their digest counterparts as the last stage in the pipeline. Here's a plugin that is already doing it for minified files, but could go further: https://github.com/neomaclin/sbt-simple-url-update#sbt-simple-url-update

Given a file it is quite easy to map it back to its non digested form if the filename has a digest in it. Here's how to get the digest given a file and see if it exists:

val f = new File("a/1234567890-b.txt")
val n = f.getName
val i = n.indexOf('-')
val nf = if (i == -1) f else new File(f.getParent, n.drop(i + 1))
nf.exists

Feel like raising a PR on that plugin? :-)

from sbt-web.

akkie avatar akkie commented on September 7, 2024

I've created an issue for the plugin you mentioned. And we came to the decision that it would be better to create a new plugin for this use case. So for now I'l close this issue. Thanks

from sbt-web.

huntc avatar huntc commented on September 7, 2024

The issue you refer to is closed...

from sbt-web.

akkie avatar akkie commented on September 7, 2024

The issue you refer to is closed...

Yes, because we came to the decision that it would be better to create a new plugin for this use case. So it isn't an issue with this plugin.

from sbt-web.

neilchaudhuri avatar neilchaudhuri commented on September 7, 2024

Was there any resolution here? If not, what is the workaround? Or is it a choice between RJS and access to digests?

from sbt-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.