mirror of
https://github.com/corda/corda.git
synced 2025-01-30 08:04:16 +00:00
CORDA-4003: Now support + in CorDapp filenames (#6673)
* CORDA-4003: Now cope with file: prefix not being in class path element. * CORDA-4003: Switched to new URL type filter. * CORDA-4003: Switched to a URL comparison. In the string comparison the scheme was removed in latest version of classgraph. * CORDA-4003: Moved to latest version of classgraph that has support for + in filenames. * CORDA-4003: Switched to accept version of the deprecated classgraph methods.
This commit is contained in:
parent
7a7289c2f1
commit
14e23430c0
@ -21,7 +21,7 @@ quasarVersion11=0.8.0_r3
|
||||
jdkClassifier11=jdk11
|
||||
proguardVersion=6.1.1
|
||||
bouncycastleVersion=1.61
|
||||
classgraphVersion=4.8.78
|
||||
classgraphVersion=4.8.89
|
||||
disruptorVersion=3.4.2
|
||||
typesafeConfigVersion=1.3.4
|
||||
jsr305Version=3.0.2
|
||||
|
@ -331,7 +331,7 @@ class JarScanningCordappLoader private constructor(private val cordappJarPaths:
|
||||
val cordappElement = cordappJarPath.url.toString()
|
||||
logger.info("Scanning CorDapp in $cordappElement")
|
||||
val scanResult = ClassGraph()
|
||||
.filterClasspathElements { elt -> elt == cordappElement }
|
||||
.filterClasspathElementsByURL { elt -> elt == cordappJarPath.url }
|
||||
.overrideClassLoaders(appClassLoader)
|
||||
.ignoreParentClassLoaders()
|
||||
.enableAllInfo()
|
||||
|
@ -56,11 +56,11 @@ data class CustomCordapp(
|
||||
internal fun packageAsJar(file: Path) {
|
||||
val classGraph = ClassGraph()
|
||||
if (packages.isNotEmpty()) {
|
||||
classGraph.whitelistPaths(*packages.map { it.replace('.', '/') }.toTypedArray())
|
||||
classGraph.acceptPaths(*packages.map { it.replace('.', '/') }.toTypedArray())
|
||||
}
|
||||
if (classes.isNotEmpty()) {
|
||||
classes.forEach { classGraph.addClassLoader(it.classLoader) }
|
||||
classGraph.whitelistClasses(*classes.map { it.name }.toTypedArray())
|
||||
classGraph.acceptClasses(*classes.map { it.name }.toTypedArray())
|
||||
}
|
||||
|
||||
classGraph.enableClassInfo().pooledScan().use { scanResult ->
|
||||
|
@ -56,7 +56,7 @@ data class TestCordappImpl(val scanPackage: String, override val config: Map<Str
|
||||
|
||||
private fun findRootPaths(scanPackage: String): Set<Path> {
|
||||
return packageToRootPaths.computeIfAbsent(scanPackage) {
|
||||
val classGraph = ClassGraph().whitelistPaths(scanPackage.replace('.', '/'))
|
||||
val classGraph = ClassGraph().acceptPaths(scanPackage.replace('.', '/'))
|
||||
classGraph.pooledScan().use { scanResult ->
|
||||
scanResult.allResources
|
||||
.asSequence()
|
||||
|
Loading…
x
Reference in New Issue
Block a user