[jboss-cvs] JBossAS SVN: r106335 - in projects/jboss-jca/trunk/validator: src/main/java/org/jboss/jca/validator and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 29 23:10:30 EDT 2010
Author: jeff.zhang
Date: 2010-06-29 23:10:28 -0400 (Tue, 29 Jun 2010)
New Revision: 106335
Added:
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/Main.java
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/package.html
Removed:
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java
Modified:
projects/jboss-jca/trunk/validator/build.xml
projects/jboss-jca/trunk/validator/src/main/resources/validator-cli-manifest.mf
Log:
[JBJCA-368] move Main to cli sub-package
Modified: projects/jboss-jca/trunk/validator/build.xml
===================================================================
--- projects/jboss-jca/trunk/validator/build.xml 2010-06-29 20:53:10 UTC (rev 106334)
+++ projects/jboss-jca/trunk/validator/build.xml 2010-06-30 03:10:28 UTC (rev 106335)
@@ -67,12 +67,12 @@
<jar destfile="${target.dir}/jboss-jca-validator.jar"
manifest="src/main/resources/validator-manifest.mf"
basedir="${build.validator.dir}/jars/validator"
- excludes="**/Main*.*, **/ant/**"/>
+ excludes="**/cli/**, **/ant/**"/>
<jar destfile="${target.dir}/jboss-jca-validator-cli.jar"
manifest="src/main/resources/validator-cli-manifest.mf"
basedir="${build.validator.dir}/jars/validator"
- includes="**/Main*.class"/>
+ includes="**/cli/**"/>
<jar destfile="${target.dir}/jboss-jca-validator-ant.jar"
manifest="src/main/resources/validator-ant-manifest.mf"
Deleted: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java 2010-06-29 20:53:10 UTC (rev 106334)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java 2010-06-30 03:10:28 UTC (rev 106335)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008-2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.validator;
-
-import java.io.File;
-
-import java.net.MalformedURLException;
-
-/**
- * A Main.
- *
- * @author Jeff Zhang</a>
- * @version $Revision: $
- */
-public class Main
-{
- private static final int SUCCESS = 0;
- private static final int FAIL = 1;
- private static final int OTHER = 2;
-
-
- /**
- * Validator standalone tool
- *
- * @param args command line arguments
- */
- public static void main(String[] args)
- {
- boolean quite = false;
- String outputDir = "."; //put report into current directory by default
- int arg = 0;
- String[] classpath = null;
-
- if (args.length > 0)
- {
- while (args.length > arg + 1)
- {
- if (args[arg].startsWith("-"))
- {
- if (args[arg].endsWith("quite"))
- {
- quite = true;
- }
- else if (args[arg].endsWith("output"))
- {
- arg++;
- if (arg + 1 >= args.length)
- {
- usage();
- System.exit(OTHER);
- }
- outputDir = args[arg];
- }
- else if (args[arg].endsWith("classpath"))
- {
- arg++;
- classpath = args[arg].split(System.getProperty("path.separator"));
-
- }
- }
- else
- {
- usage();
- System.exit(OTHER);
- }
- arg++;
- }
-
- try
- {
- int systemExitCode = Validation.validate(new File(args[arg]).toURI().toURL(), outputDir, classpath);
-
- if (!quite && systemExitCode == FAIL)
- {
- System.out.println("Validation errors");
- }
- System.exit(systemExitCode);
- }
- catch (ArrayIndexOutOfBoundsException oe)
- {
- usage();
- System.exit(OTHER);
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- }
- else
- {
- usage();
- }
-
- System.exit(SUCCESS);
- }
-
- /**
- * Tool usage
- */
- private static void usage()
- {
- System.out.println("Usage: validator [-quite] [-output directory] [-classpath thirdparty.jar] <file>");
- }
-}
Copied: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/Main.java (from rev 106334, projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/Main.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/Main.java 2010-06-30 03:10:28 UTC (rev 106335)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.cli;
+
+import org.jboss.jca.validator.Validation;
+
+import java.io.File;
+
+import java.net.MalformedURLException;
+
+/**
+ * A Main.
+ *
+ * @author Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public class Main
+{
+ private static final int SUCCESS = 0;
+ private static final int FAIL = 1;
+ private static final int OTHER = 2;
+
+
+ /**
+ * Validator standalone tool
+ *
+ * @param args command line arguments
+ */
+ public static void main(String[] args)
+ {
+ boolean quite = false;
+ String outputDir = "."; //put report into current directory by default
+ int arg = 0;
+ String[] classpath = null;
+
+ if (args.length > 0)
+ {
+ while (args.length > arg + 1)
+ {
+ if (args[arg].startsWith("-"))
+ {
+ if (args[arg].endsWith("quite"))
+ {
+ quite = true;
+ }
+ else if (args[arg].endsWith("output"))
+ {
+ arg++;
+ if (arg + 1 >= args.length)
+ {
+ usage();
+ System.exit(OTHER);
+ }
+ outputDir = args[arg];
+ }
+ else if (args[arg].endsWith("classpath"))
+ {
+ arg++;
+ classpath = args[arg].split(System.getProperty("path.separator"));
+
+ }
+ }
+ else
+ {
+ usage();
+ System.exit(OTHER);
+ }
+ arg++;
+ }
+
+ try
+ {
+ int systemExitCode = Validation.validate(new File(args[arg]).toURI().toURL(), outputDir, classpath);
+
+ if (!quite && systemExitCode == FAIL)
+ {
+ System.out.println("Validation errors");
+ }
+ System.exit(systemExitCode);
+ }
+ catch (ArrayIndexOutOfBoundsException oe)
+ {
+ usage();
+ System.exit(OTHER);
+ }
+ catch (MalformedURLException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else
+ {
+ usage();
+ }
+
+ System.exit(SUCCESS);
+ }
+
+ /**
+ * Tool usage
+ */
+ private static void usage()
+ {
+ System.out.println("Usage: validator [-quite] [-output directory] [-classpath thirdparty.jar] <file>");
+ }
+}
Added: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/package.html
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/cli/package.html 2010-06-30 03:10:28 UTC (rev 106335)
@@ -0,0 +1,3 @@
+<body>
+This package contains the cli of validator module
+</body>
Modified: projects/jboss-jca/trunk/validator/src/main/resources/validator-cli-manifest.mf
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/resources/validator-cli-manifest.mf 2010-06-29 20:53:10 UTC (rev 106334)
+++ projects/jboss-jca/trunk/validator/src/main/resources/validator-cli-manifest.mf 2010-06-30 03:10:28 UTC (rev 106335)
@@ -2,5 +2,5 @@
Implementation-Vendor: Red Hat Middleware LLC
Implementation-Vendor-Id: org.jboss
Implementation-Version: 0.1
-Main-Class: org.jboss.jca.validator.Main
+Main-Class: org.jboss.jca.validator.cli.Main
Class-Path: jboss-jca-validator.jar
More information about the jboss-cvs-commits
mailing list