Skip to content
New issue

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

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

Already on GitHub? # to your account

In-memory shading #39

Merged
merged 12 commits into from
Oct 6, 2023
2 changes: 1 addition & 1 deletion core/src/main/scala/com/eed3si9n/jarjarabrams/Zip.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object Zip {
// --------- ---------- ----- ----
// 0 00-00-1980 04:08 META-INF/
// 988 00-00-1980 04:08 META-INF/MANIFEST.MF
private final val minimumTimestamp = 315705600L
private final val minimumTimestamp = 315705600000L
Copy link
Owner Author

Choose a reason for hiding this comment

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

I was off by 1000x (milisec).


def list(inputJar: Path): List[(String, Long)] =
Using.jarFile(inputJar) { in =>
Expand Down
5 changes: 4 additions & 1 deletion core/src/test/scala/testpkg/ShaderTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package testpkg
import verify._
import java.nio.file.{ Files, Path, Paths }
import com.eed3si9n.jarjarabrams.{ Shader, Zip }
import scala.sys.process.Process

object ShaderTest extends BasicTestSuite {
final val byteBuddyJar = "example/byte-buddy-agent.jar"
Expand All @@ -15,7 +16,7 @@ object ShaderTest extends BasicTestSuite {
Paths.get(byteBuddyJar),
resetTimestamp = false,
expectedClass = expectedByteBuddyClass,
expectedSha = "6e7372e52e3b2e981ffa42fc29d5cec1cc84431972d45fb51d605210e11c3ebd"
expectedSha = "673a5b1d7282ec68def6d6e6845c29d96142e4e3b39796484e122cd92f65edee"
)
}

Expand Down Expand Up @@ -65,6 +66,8 @@ object ShaderTest extends BasicTestSuite {
)
val entries = Zip.list(tempJar).map(_._1)
assert(entries.contains(expectedClass))
val lines = Process(s"unzip -l $tempJar").!!.linesIterator.toList.take(10)
lines.foreach(println)
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove now?

val actualSha = Zip.sha256(tempJar)
assert(actualSha == expectedSha)
}
Expand Down