Sorry to bump this but i can't find any workaround and it would be great if someone could confirm that either there's no workaround or if there is one so that i can move on.
Sorry to bump this but i can't find any workaround and it would be great if someone could confirm that either there's no workaround or if there is one so that i can move on.
You can get all content roots of modules and libraries and check for the presence of META-INF and MANIFEST.MF by directly traversing the VFS. Since you're interested only in specific paths, this won't be a major performance problem.
-- Dmitry Jemerov Software Developer JetBrains, Inc. http://www.jetbrains.com/ "Develop with Pleasure!"
Hello Hugo,
You can start with PsiShortNameCache.getFilesByName("MANIFEST.MF").
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
That only seems to work for files in project scope.
I need to find the manifest files in the dependencies jars of a module.
Hello Hugo,
1) com.intellij.psi.PsiManager#findPackage()
2) com.intellij.psi.PsiPackage#getDirectories()
3) com.intellij.psi.PsiDirectory#findFile()
Spring plugin does this, combined with CachedValuesProvider.
-tt
I tried that, but PsiManager#findPackage() doesn't return the META-INF "package".
You have wrong project setup then. SpringSchemaProvider.java does this.
You can check the source code for sample.
Is the source code for the Spring plugin available ? I can't find it in the dev package.
I will check it out, but the Spring plugin is for 7.0 only and i'm using 6.0.5 so the behaviour is different in these versions.
Hello Hugo,
http://svn.jetbrains.org/idea/Trunk/bundled/spring/
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks, i see the code.
Well, i'm doing the same thing but for me PsiManager.findPackage("META-INF") always returns null.
Could this be a behaviour change from 6.0.5 to 7 ?
Hello Hugo,
Ah, indeed, I remember I fixed this early in 7.0.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Ok, so is there any workaround for this ?
Anyone ?
Sorry to bump this but i can't find any workaround and it would be great if someone could confirm that either there's no workaround or if there is one so that i can move on.
Hello Hugo,
You can get all content roots of modules and libraries and check for the
presence of META-INF and MANIFEST.MF by directly traversing the VFS. Since
you're interested only in specific paths, this won't be a major performance
problem.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"