1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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 
17 package util.build;
18 
19 import java.io.IOException;
20 
21 public class JackBuildDalvikSuite {
22 
23     public static String JACK;
24 
main(String[] args)25     public static void main(String[] args) throws IOException {
26 
27         String[] remainingArgs;
28         if (args.length > 0) {
29             JACK = args[0];
30             remainingArgs = new String[args.length - 1];
31             System.arraycopy(args, 1, remainingArgs, 0, remainingArgs.length);
32         } else {
33             remainingArgs = args;
34         }
35 
36         if (!BuildDalvikSuite.parseArgs(remainingArgs)) {
37             printUsage();
38             System.exit(-1);
39         }
40 
41         long start = System.currentTimeMillis();
42         BuildDalvikSuite cat = new BuildDalvikSuite(true);
43         cat.compose();
44         long end = System.currentTimeMillis();
45 
46         System.out.println("elapsed seconds: " + (end - start) / 1000);
47     }
48 
49 
printUsage()50     private static void printUsage() {
51         System.out.println("usage: java-src-folder output-folder classpath " +
52                            "generated-main-files compiled_output generated-main-files " +
53                            "[restrict-to-opcode]");
54     }
55 }
56