ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: ignite-classname Changed script for classnames property.
Date Fri, 12 Jun 2015 10:38:02 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-classname a515ec91d -> fe1750d3f


ignite-classname Changed script for classnames property.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fe1750d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fe1750d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fe1750d3

Branch: refs/heads/ignite-classname
Commit: fe1750d3f15ef283ecc76c0fcba0c8a59493691f
Parents: a515ec9
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Fri Jun 12 13:37:48 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri Jun 12 13:37:48 2015 +0300

----------------------------------------------------------------------
 .../ignite/tools/classgen/ClassesGenerator.java   | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe1750d3/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
----------------------------------------------------------------------
diff --git a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
index ba0aab9..feb2d9d 100644
--- a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
+++ b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
@@ -29,7 +29,10 @@ import java.util.jar.*;
  */
 public class ClassesGenerator {
     /** */
-    private static final String FILE_PATH = "META-INF/classnames.properties";
+    private static final String META_INF = "META-INF/";
+
+    /** */
+    private static final String DEFAULT_FILE_PATH = META_INF + "classnames.properties";
 
     /** */
     private static final String[] EXCLUDED_PACKAGES = {
@@ -46,8 +49,9 @@ public class ClassesGenerator {
         String basePath = args[0];
         String hdr = args[1];
         String[] packages = args[2].split(":");
+        String finaName = args.length == 4 ? args[3] : null;
 
-        ClassesGenerator gen = new ClassesGenerator(basePath, hdr, packages);
+        ClassesGenerator gen = new ClassesGenerator(basePath, hdr, packages, finaName);
 
         gen.generate();
     }
@@ -74,15 +78,20 @@ public class ClassesGenerator {
     /** */
     private final String[] packages;
 
+    /** */
+    private final String fileName;
+
     /**
      * @param basePath Base file path.
      * @param hdr Header.
      * @param packages Included packages.
+     * @param fileName Property file name.
      */
-    private ClassesGenerator(String basePath, String hdr, String[] packages) {
+    private ClassesGenerator(String basePath, String hdr, String[] packages, String fileName)
{
         this.basePath = basePath;
         this.hdr = hdr;
         this.packages = packages;
+        this.fileName = fileName;
     }
 
     /**
@@ -103,7 +112,8 @@ public class ClassesGenerator {
             throw new Exception(sb.toString().trim());
         }
 
-        PrintStream out = new PrintStream(new File(basePath, FILE_PATH));
+        PrintStream out = new PrintStream(new File(basePath,
+            (fileName == null || fileName.isEmpty()) ? DEFAULT_FILE_PATH : META_INF + fileName));
 
         out.println(hdr);
         out.println();


Mime
View raw message