Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added script to scans all jars in a Eclipse .classpath file for patte…

…rns of files, e.g. java packages, etc.
  • Loading branch information...
commit 776af5d95181f2579ffb1ba85e74019523206ba0 1 parent 1295b1b
@jetztgradnet authored
Showing with 28 additions and 0 deletions.
  1. +28 −0 tools/finddeps.groovy
View
28 tools/finddeps.groovy
@@ -0,0 +1,28 @@
+import java.util.jar.JarFile
+
+/*
+This script scans all jars in a Eclipse .classpath file for
+patterns of files, e.g. java packages, etc.
+*/
+
+if (args.size() < 2) {
+ println "usage: finddeps.groovy xmlfile filepattern"
+}
+
+def home = System.getProperty('user.home')
+def jinspect = "${home}/bin/jinspect"
+def input = new File(args[0])
+def pattern = args[1]
+def entries = new XmlSlurper().parse(input).classpathentry
+
+entries.@path.each { path ->
+ def jar = new File(path.text())
+ //println jar.name
+ if (!jar.name.endsWith('.jar')) {
+ return
+ }
+ def jarFile = new JarFile(jar)
+ def osgiEntries = jarFile.entries().findAll { entry -> entry.name.startsWith(pattern) }
+ println "$jinspect ${jar.path}"
+ osgiEntries.each { entry -> println "\t$entry"}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.