< prev index next >

test/runtime/modules/Xpatch/BasicJarBuilder.java

Print this page




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @summary Simple jar builder
  26  *   Input: jarName className1 className2 ...
  27  *     do not specify extensions, just the names
  28  *     E.g. prot_domain ProtDomainA ProtDomainB
  29  *   Output: A jar containing compiled classes, placed in a test classes folder
  30  */
  31 
  32 import jdk.test.lib.*;
  33 
  34 import java.io.File;
  35 import java.util.ArrayList;
  36 import sun.tools.jar.Main;
  37 
  38 // Using JarBuilder requires that all to-be-jarred classes should be placed
  39 // in the current working directory, aka "."
  40 public class BasicJarBuilder {
  41     private static final String classDir = System.getProperty("test.classes");
  42 
  43     public static void build(boolean classesInWorkDir, String jarName,
  44         String ...classNames) throws Exception {
  45 
  46         if (classesInWorkDir) {
  47             createSimpleJar(".", classDir + File.separator + jarName + ".jar", classNames);
  48         } else {
  49             build(jarName, classNames);
  50         }
  51     }
  52 
  53     public static void build(String jarName, String ...classNames) throws Exception {




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @summary Simple jar builder
  26  *   Input: jarName className1 className2 ...
  27  *     do not specify extensions, just the names
  28  *     E.g. prot_domain ProtDomainA ProtDomainB
  29  *   Output: A jar containing compiled classes, placed in a test classes folder
  30  */
  31 


  32 import java.io.File;
  33 import java.util.ArrayList;
  34 import sun.tools.jar.Main;
  35 
  36 // Using JarBuilder requires that all to-be-jarred classes should be placed
  37 // in the current working directory, aka "."
  38 public class BasicJarBuilder {
  39     private static final String classDir = System.getProperty("test.classes");
  40 
  41     public static void build(boolean classesInWorkDir, String jarName,
  42         String ...classNames) throws Exception {
  43 
  44         if (classesInWorkDir) {
  45             createSimpleJar(".", classDir + File.separator + jarName + ".jar", classNames);
  46         } else {
  47             build(jarName, classNames);
  48         }
  49     }
  50 
  51     public static void build(String jarName, String ...classNames) throws Exception {


< prev index next >