source: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/Build.java@ 5800

Last change on this file since 5800 was 5798, checked in by cs025, 21 years ago

Adding gs3build code

  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1package org.greenstone.gsdl3.gs3build;
2
3import java.util.List;
4import java.util.ArrayList;
5
6public class Build
7{
8 BuildManager manager;
9
10 public Build(List inputRoots, String collection, String outputDir)
11 { this.manager = new BuildManager(inputRoots, collection, outputDir);
12 }
13
14 public void run()
15 { this.manager.run();
16 }
17
18 public static void main(String args[])
19 { int a = 0;
20 List inputDirs = new ArrayList();
21 String collection = null;
22 String outputDir = null;
23
24 while (a < args.length)
25 { System.out.println(args[a]);
26 if (args[a].equals("-inputdir")) {
27 if (a < args.length - 1 &&
28 args[a+1].charAt(0) != '-')
29 {
30 inputDirs.add(args[a+1]);
31 a ++;
32 }
33 }
34 else if (args[a].equals("-collect")) {
35 if (a < args.length - 1 &&
36 args[a+1].charAt(0) != '-')
37 {
38 collection = args[a+1];
39 a ++;
40 }
41 }
42 else if (args[a].equals("-outputDir")) {
43 if (a < args.length - 1 &&
44 args[a+1].charAt(0) != '-')
45 { outputDir = args[a+1];
46 a ++;
47 }
48 }
49 a ++;
50 }
51
52 if (collection == null && inputDirs.size() == 0)
53 { System.err.println("At least one input directory must be given, or a collection name");
54 System.exit(0);
55 }
56
57 Build build = new Build(inputDirs, collection, outputDir);
58 build.run();
59
60 return;
61 }
62}
Note: See TracBrowser for help on using the repository browser.