01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: package org.apache.lenya.config.impl;
20:
21: import java.io.BufferedReader;
22: import java.io.InputStreamReader;
23: import java.util.Vector;
24:
25: import org.apache.lenya.config.core.Configuration;
26: import org.apache.lenya.config.core.FileConfiguration;
27: import org.apache.lenya.config.core.Parameter;
28:
29: /**
30: * A command line tool to configure the Lenya build
31: */
32: public class ConfigureCommandLine extends
33: org.apache.lenya.config.core.ConfigureCommandLine {
34:
35: /**
36: * @param args Command line args
37: */
38: public static void main(String[] args) {
39: System.out
40: .println("\nWelcome to the command line interface to configure the building process of Apache Lenya");
41:
42: if (args.length != 1) {
43: System.err
44: .println("No root dir specified (e.g. /home/USERNAME/src/lenya/trunk)!");
45: return;
46: }
47: String rootDir = args[0];
48:
49: ConfigureCommandLine ccl = new ConfigureCommandLine();
50: Vector configs = ccl.setConfigurations(rootDir);
51: ccl.changeConfigurations(configs);
52: }
53:
54: /**
55: *
56: */
57: public Vector setConfigurations(String rootDir) {
58: // Define all configuration files
59: FileConfiguration buildProperties = new BuildPropertiesConfiguration();
60: buildProperties.setFilenameDefault(rootDir
61: + "/build.properties");
62: buildProperties.setFilenameLocal(rootDir
63: + "/local.build.properties");
64:
65: /*
66: FileConfiguration defaultPub = new PublicationConfiguration();
67: defaultPub.setFilenameDefault(rootDir + "src/pubs/default/config/publication.xml");
68: defaultPub.setFilenameLocal(rootDir + "src/pubs/default/config/local.publication.xml");
69: */
70:
71: /*
72: FileConfiguration log4j = new Log4jConfiguration();
73: // src/confpatch/log4j-*
74: log4j.setFilenameDefault(rootDir + "src/webapp/WEB-INF/log4j.xconf");
75: log4j.setFilenameLocal(rootDir + "src/webapp/WEB-INF/local.log4j.xconf");
76: */
77:
78: Vector configs = new Vector();
79: configs.addElement(buildProperties);
80: //configs.addElement(defaultPub);
81:
82: return configs;
83: }
84: }
|