[pkg-java] r13823 - in trunk/maven-debian-helper: bin debian maven-packager-utils/src/main/java/org/debian/maven/packager share/cdbs/1/class
Damien Raude-Morvan
drazzib at alioth.debian.org
Sat Jun 25 22:42:05 UTC 2011
Author: drazzib
Date: 2011-06-25 22:42:05 +0000 (Sat, 25 Jun 2011)
New Revision: 13823
Modified:
trunk/maven-debian-helper/bin/mh_resolve_dependencies
trunk/maven-debian-helper/debian/changelog
trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java
trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk
trunk/maven-debian-helper/share/cdbs/1/class/maven.mk
Log:
* mh_make: Update debian/copyright template for latest DEP-5 format.
* mh_resolve_dependencies: Don't use mvn directly but call to
DependenciesSolver main (so packages can have a main pom
in other directory than root).
* DependenciesSolver: Add new parameters :
- --non-explore: doesn't explore directories for pom.xml
- --base-directory: path to root directory of package
* maven.mk: Send base-directory and non-explore parameters when calling
mh_resolve_dependencies.
Modified: trunk/maven-debian-helper/bin/mh_resolve_dependencies
===================================================================
--- trunk/maven-debian-helper/bin/mh_resolve_dependencies 2011-06-25 11:37:49 UTC (rev 13822)
+++ trunk/maven-debian-helper/bin/mh_resolve_dependencies 2011-06-25 22:42:05 UTC (rev 13823)
@@ -3,6 +3,8 @@
MH_VERSION=$(ls /usr/share/maven-repo/org/debian/maven/maven-packager-utils/ | sed 's|/||')
. /usr/share/maven-repo-helper/mh_lib.sh
+CLASSPATH="/usr/share/java/maven-project.jar:/usr/share/java/maven-repo-helper.jar:/usr/share/java/maven-packager-utils.jar"
+
syntax()
{
echo -e "Usage: mh_revolve_dependencies [option]... <package>"
@@ -23,6 +25,8 @@
echo -e "\t-o --offline: don't ever connect to the internet, for Debian build"
echo -e "\t compatibility."
echo -e "\t-v --verbose: show more information while running"
+ echo -e "\t-b --base-directory: path to root directory of package"
+ echo -e "\t-n --non-explore: doesn't explore directories for pom.xml"
echo -e ""
echo -e "Description:"
echo -e "This tool reads the POM files defined in debian/$package.poms"
@@ -38,7 +42,7 @@
exit 1
}
-ARGS="p package a ant d javadoc v verbose n non-interactive o offline" parseargs "$@"
+ARGS="p package a ant d javadoc v verbose n non-interactive o offline b base-directory n non-explore" parseargs "$@"
PACKAGE=$(getarg p package)
ANT=$(getarg a ant)
@@ -46,6 +50,8 @@
NON_INTERACTIVE=$(getarg n non-interactive)
OFFLINE=$(getarg o offline)
VERBOSE=$(getarg v verbose)
+BASE_DIR=$(getarg b base-directory)
+NON_EXPLORE=$(getarg n non-explore)
if [ -z "$PACKAGE" ]; then
if [ "$ARGC" -gt "0" ]; then
@@ -68,6 +74,6 @@
fi
fi
-mvn org.debian.maven:maven-packager-utils:$MH_VERSION:dependencies -Dpackage="$PACKAGE" ${ANT:+-DpackageType=ant} ${GEN_JAVADOC:+-DresolveJavadoc=true} -Dmaven.repo.local=/usr/share/maven-repo ${NON_INTERACTIVE:+-Dinteractive=false} ${VERBOSE:+-Dverbose=true} ${OFFLINE:+-Doffline=true --offline}
+java $JAVA_OPTS -cp $CLASSPATH org.debian.maven.packager.DependenciesSolver ${NON_INTERACTIVE:+--non-interactive} ${NON_EXPLORE:+--non-explore} ${OFFLINE:+--offline} ${ANT:+--ant} ${GEN_JAVADOC:+--generate-javadoc} ${BASE_DIR:+--base-directory=$BASE_DIR} --package=$PACKAGE --maven-repo=/usr/share/maven-repo
perl -p -i -e 's/maven\./maven:/' debian/${PACKAGE}.substvars
Modified: trunk/maven-debian-helper/debian/changelog
===================================================================
--- trunk/maven-debian-helper/debian/changelog 2011-06-25 11:37:49 UTC (rev 13822)
+++ trunk/maven-debian-helper/debian/changelog 2011-06-25 22:42:05 UTC (rev 13823)
@@ -8,9 +8,17 @@
(with --offline option) when --offline parameter is used.
[ Damien Raude-Morvan ]
- * md_make: Update debian/copyright template for latest DEP-5 format.
+ * mh_make: Update debian/copyright template for latest DEP-5 format.
+ * mh_resolve_dependencies: Don't use mvn directly but call to
+ DependenciesSolver main (so packages can have a main pom
+ in other directory than root).
+ * DependenciesSolver: Add new parameters :
+ - --non-explore: doesn't explore directories for pom.xml
+ - --base-directory: path to root directory of package
+ * maven.mk: Send base-directory and non-explore parameters when calling
+ mh_resolve_dependencies.
- -- Damien Raude-Morvan <drazzib at debian.org> Sat, 25 Jun 2011 13:36:55 +0200
+ -- Damien Raude-Morvan <drazzib at debian.org> Sun, 26 Jun 2011 00:40:54 +0200
maven-debian-helper (1.4.3) unstable; urgency=low
Modified: trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java 2011-06-25 11:37:49 UTC (rev 13822)
+++ trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java 2011-06-25 22:42:05 UTC (rev 13823)
@@ -2,6 +2,7 @@
/*
* Copyright 2009 Ludovic Claude.
+ * Copyright 2011 Damien Raude-Morvan.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1318,19 +1319,23 @@
System.out.println(" -m<repo root>--maven-repo=<repo root>: location of the Maven repository,");
System.out.println(" used to force the versions of the Maven plugins used in the current");
System.out.println(" POM file with the versions found in the repository");
+ System.out.println(" --base-directory: path to root directory of package");
+ System.out.println(" --non-explore: doesn't explore directories for pom.xml");
return;
}
- DependenciesSolver solver = new DependenciesSolver();
-
- solver.setBaseDir(new File("."));
- solver.setExploreProjects(true);
- solver.setOutputDirectory(new File("debian"));
-
- int i = inc(-1, args);
+
+ // Default values
boolean verbose = false;
String debianPackage = "";
String packageType = "maven";
File mavenRepo = null;
+ File baseDirectory = new File(".");
+
+ DependenciesSolver solver = new DependenciesSolver();
+ solver.setExploreProjects(true); // can be overriden by args
+
+ // Parse parameters
+ int i = inc(-1, args);
while (i < args.length && (args[i].trim().startsWith("-") || args[i].trim().isEmpty())) {
String arg = args[i].trim();
if ("--verbose".equals(arg) || "-v".equals(arg)) {
@@ -1353,14 +1358,21 @@
mavenRepo = new File(arg.substring(2));
} else if (arg.startsWith("--maven-repo=")) {
mavenRepo = new File(arg.substring("--maven-repo=".length()));
+ } else if (arg.startsWith("-b")) {
+ baseDirectory = new File(arg.substring(2));
+ } else if (arg.startsWith("--base-directory=")) {
+ baseDirectory = new File(arg.substring("--base-directory=".length()));
+ } else if (arg.equals("--non-explore")) {
+ solver.setExploreProjects(false);
}
i = inc(i, args);
}
- File poms = new File(solver.getOutputDirectory(), debianPackage + ".poms");
+ solver.setBaseDir(baseDirectory);
+ solver.setOutputDirectory(new File(baseDirectory, "debian"));
solver.setPackageName(debianPackage);
solver.setPackageType(packageType);
- solver.setExploreProjects(true);
+ File poms = new File(solver.getOutputDirectory(), debianPackage + ".poms");
solver.setListOfPoms(poms);
if (mavenRepo != null) {
Modified: trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk
===================================================================
--- trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk 2011-06-25 11:37:49 UTC (rev 13822)
+++ trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk 2011-06-25 22:42:05 UTC (rev 13823)
@@ -2,6 +2,7 @@
# Copyright © 2003 Stefan Gybas <sgybas at debian.org>
# Copyright © 2008 Torsten Werner <twerner at debian.org>
+# Copyright © 2010-2011 Damien Raude-Morvan <drazzib at debian.org>
# Description: Defines useful variables for packages which use Maven
#
# This program is free software; you can redistribute it and/or
Modified: trunk/maven-debian-helper/share/cdbs/1/class/maven.mk
===================================================================
--- trunk/maven-debian-helper/share/cdbs/1/class/maven.mk 2011-06-25 11:37:49 UTC (rev 13822)
+++ trunk/maven-debian-helper/share/cdbs/1/class/maven.mk 2011-06-25 22:42:05 UTC (rev 13823)
@@ -2,7 +2,8 @@
# Copyright © 2003 Stefan Gybas <sgybas at debian.org>
# Copyright © 2008 Torsten Werner <twerner at debian.org>
-# Copyright © 2009 Ludovic Claude <ludovic.claude at laposte.net>
+# Copyright © 2009-2011 Ludovic Claude <ludovic.claude at laposte.net>
+# Copyright © 2010-2011 Damien Raude-Morvan <drazzib at debian.org>
# Description: Builds and cleans packages which have an Maven pom.xml file
#
# This program is free software; you can redistribute it and/or
@@ -109,6 +110,7 @@
ifneq (, $(DEB_DOC_PACKAGE))
DEB_RESOLVEDEP_ARGS += --javadoc
endif
+DEB_RESOLVEDEP_ARGS += --base-directory=$(CURDIR) --non-explore
common-install-arch common-install-indep:: common-install-impl
common-install-impl::
More information about the pkg-java-commits
mailing list