aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Pasquet <kiorky@cryptelium.net>2007-05-11 19:27:42 +0000
committerMathieu Pasquet <kiorky@cryptelium.net>2007-05-11 19:27:42 +0000
commitdf00e56ca2b96b3eae3cd2c24527aecf306f6ec9 (patch)
treef6a7ff057bec20299be9d23e26d3222e425d4bb5
parentkiorky: packaging maven toolkit (diff)
downloadjavatoolkit-df00e56ca2b96b3eae3cd2c24527aecf306f6ec9.tar.gz
javatoolkit-df00e56ca2b96b3eae3cd2c24527aecf306f6ec9.tar.bz2
javatoolkit-df00e56ca2b96b3eae3cd2c24527aecf306f6ec9.zip
kiorky: packaging maven toolkit
svn path=/projects/javatoolkit/trunk/; revision=4630
-rw-r--r--Makefile4
-rwxr-xr-xsrc/maven/maven-getpominfos.py35
2 files changed, 23 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 82e4e09..b13cd37 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ dist: dist-javatoolkit
dist-javatoolkit:
mkdir -p release/javatoolkit-$(VERSION)$(RELEASE_TAG)
rm -rf release/javatoolkit-$(VERSION)$(RELEASE_TAG)/
- for x in sun-fetch findclass bsfix buildparser javatoolkit ; do \
+ for x in sun-fetch findclass bsfix buildparser javatoolkit maven ; do \
( cd src/$$x ; $(MAKE) distdir=release/javatoolkit-$(VERSION)$(RELEASE_TAG) dist ) \
done
cp Makefile AUTHORS README TODO COPYING NEWS ChangeLog.2004 release/javatoolkit-$(VERSION)$(RELEASE_TAG)/
@@ -44,7 +44,7 @@ install-javatoolkit:
install -m 0644 AUTHORS ChangeLog COPYING NEWS README TODO $(docdir)/
- for x in sun-fetch findclass bsfix buildparser javatoolkit ; do \
+ for x in sun-fetch findclass bsfix buildparser javatoolkit maven; do \
( cd src/$$x ; $(MAKE) DESTDIR=$(DESTDIR) install ) \
done
diff --git a/src/maven/maven-getpominfos.py b/src/maven/maven-getpominfos.py
index 7ed1388..acc0f58 100755
--- a/src/maven/maven-getpominfos.py
+++ b/src/maven/maven-getpominfos.py
@@ -51,6 +51,13 @@ class MavenPom:
# get our properties
for node in self.project.childNodes:
self.getInfos(node)
+ if node.nodeName == "dependencies":
+ for dependency_node in node.childNodes:
+ if dependency_node.nodeName == "dependency":
+ dep = MavenPom()
+ for child_node in dependency_node.childNodes:
+ dep.getInfos(child_node)
+ self.dependencies.append(dep)
# get inherited properties from parent pom if any
if self.group == "" or self.version == "" or self.artifact == "":
@@ -72,7 +79,7 @@ if __name__ == '__main__':
usage += "Please contact the Gentoo Java Team <java@gentoo.org> with problems.\n"
usage += "\n"
usage += "Usage:\n"
- usage += " maven-getpominfos.py [-a] [-v] [-g] [-f fic.xml]\n"
+ usage += " maven-getpominfos.py [-a] [-v] [-g] [-d] [-f fic.xml]\n"
usage += "\n"
usage += "If the -f parameter is not utilized, the script will read and\n"
usage += "write to stdin and stdout respectively. The use of quotes on\n"
@@ -85,6 +92,7 @@ if __name__ == '__main__':
options_list = [
make_option ("-f", "--file", action="append", dest="files", help="Transform files instead of operating on stdout and stdin"),
make_option ("-v", "--version" , action="store_true", dest="p_version", help="get artifact version."),
+ make_option ("-d", "--depependencies" , action="store_true", dest="p_dep", help="get dependencies infos"),
make_option ("-g", "--group" , action="store_true", dest="p_group", help="get artifact group."),
make_option ("-a", "--artifact", action="store_true", dest="p_artifact", help="get artifact name."),
]
@@ -93,19 +101,8 @@ if __name__ == '__main__':
parser = OptionParser(usage, options_list)
(options, args) = parser.parse_args()
- elemsToGet = []
- if options.p_version:
- elemsToGet.append("version")
-
- if options.p_artifact:
- elemsToGet.append("artifact")
-
- if options.p_group:
- elemsToGet.append("group")
-
-
# Invalid Arguments Must be smited!
- if not options.p_version and not options.p_artifact and not options.p_group:
+ if not options.p_dep and not options.p_version and not options.p_artifact and not options.p_group:
print usage
print
error("No action was specified.")
@@ -113,7 +110,7 @@ if __name__ == '__main__':
if options.files:
if options.files.length > 1:
error("Please specify only one pom at a time.")
- # End Invalid Arguments Check
+ # End Invalid Arguments Check
if options.files:
import os
@@ -144,3 +141,13 @@ if __name__ == '__main__':
if options.p_version:
print "pom version:%s" % pom.version
+
+
+ if options.p_dep:
+ i=0
+ for dependency in pom.dependencies:
+ i=i+1
+ print "%d:dep_group:%s" % (i,dependency.group)
+ print "%d:dep_artifact:%s" % (i,dependency.artifact)
+ print "%d:dep_version:%s" % (i,dependency.version)
+