01: /*
02: * Copyright 2005 Joe Walker
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.directwebremoting.drapgen;
17:
18: import java.io.File;
19:
20: import org.directwebremoting.drapgen.ast.Project;
21: import org.directwebremoting.drapgen.generate.Generator;
22: import org.directwebremoting.drapgen.generate.freemarker.FreemarkerGenerator;
23: import org.directwebremoting.drapgen.loader.Loader;
24: import org.directwebremoting.drapgen.loader.gi.GiLoader;
25: import org.directwebremoting.util.Logger;
26: import org.directwebremoting.util.LoggingOutput;
27: import org.directwebremoting.util.SystemOutLoggingOutput;
28:
29: /**
30: * @author Joe Walker [joe at getahead dot ltd dot uk]
31: */
32: public class Main {
33: /**
34: *
35: */
36: public static void main(String[] args) throws Exception {
37: Logger.setDefaultImplementation(SystemOutLoggingOutput.class);
38: SystemOutLoggingOutput.setLevel(LoggingOutput.LEVEL_INFO);
39:
40: Loader loader = new GiLoader(new File(
41: "/Users/joe/Workspace/gi/dist/gi/api/xml/"));
42: Project project = new Project();
43: loader.loadToProject(project);
44:
45: project.save(new File("generated/gi/dom/"));
46:
47: Generator generator = new FreemarkerGenerator();
48: generator.setGeneratedBase(new File("generated/gi/java/"));
49: generator.generate(project);
50: }
51: }
|