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

ShadeRules.keep is broken #14

Closed
er1c opened this issue Aug 24, 2021 · 2 comments
Closed

ShadeRules.keep is broken #14

er1c opened this issue Aug 24, 2021 · 2 comments

Comments

@er1c
Copy link
Collaborator

er1c commented Aug 24, 2021

Looks like something broke in the upstream:

package org.pantsbuild.jarjar

import verify._
import org.pantsbuild.jarjar.util.EntryStruct
import java.util.Collections

object KeepSpec extends BasicTestSuite {
  val keep = new Keep()
  keep.setPattern("org.**")
  val keepProcessor = new KeepProcessor(Collections.singletonList(keep))

  test("include") {
    val entryStruct = new EntryStruct
    entryStruct.name = "org/example/Object.class"
    assert(true == keepProcessor.process(entryStruct))

  }

  test("exclude") {
    val entryStruct = new EntryStruct
    entryStruct.name = "com/example/Object.class"
    assert(false == keepProcessor.process(entryStruct))
  }
}
sbt:jarjar-abrams> test
Error reading org/example/Object.class: null
Error reading com/example/Object.class: null
[info] testpkg.EntryTableSpec
[info] - entry table should parse annotation bytes
[info] - entry table should rename package
[info] - entry table should return same serialized bytes
[info] org.pantsbuild.jarjar.KeepSpec
[info] - include
[info] - exclude *** FAILED ***
[info]   assertion failed
[info]
[info]   assert(false == keepProcessor.process(entryStruct))
[info]                |                |       |
[info]                false            true    org.pantsbuild.jarjar.util.EntryStruct@7fa491e4
[info]     verify.asserts.PowerAssert$AssertListener.expressionRecorded(PowerAssert.scala:37)
[info]     verify.asserts.RecorderRuntime.recordExpression(RecorderRuntime.scala:41)
[info]     org.pantsbuild.jarjar.KeepSpec$.$anonfun$new$3(KeepSpec.scala:22)
[info]     verify.BasicTestSuite.$anonfun$test$1(BasicTestSuite.scala:23)
[info]     verify.TestSpec$.$anonfun$sync$1(TestSpec.scala:48)
[info]     verify.TestSpec.apply(TestSpec.scala:22)
[info]     verify.Properties.$anonfun$iterator$2(Properties.scala:34)
[info]     verify.TestSpec.apply(TestSpec.scala:22)
[info]     verify.runner.Task.loop$1(Task.scala:51)
[info]     verify.runner.Task.$anonfun$execute$1(Task.scala:58)
[info]     scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
[info]     scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
[info]     scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[info]     java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
[info]     java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
[info]     java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
[info]     java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
[info]     java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
[error] Failed: Total 5, Failed 1, Errors 0, Passed 4
[error] Failed tests:
[error] 	org.pantsbuild.jarjar.KeepSpec
[error] (core / Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 1 s, completed Aug 23, 2021 8:11:18 PM
@er1c
Copy link
Collaborator Author

er1c commented Aug 24, 2021

This is fixed in #15

@er1c
Copy link
Collaborator Author

er1c commented Aug 25, 2021

Fixed in e92a8f6

@er1c er1c closed this as completed Aug 25, 2021
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

No branches or pull requests

1 participant