]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompilerConfiguration.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / Cpptasks / net / sf / antcontrib / cpptasks / compiler / CommandLineAslcompilerConfiguration.java
1 /*
2 *
3 * Copyright 2001-2005 The Ant-Contrib project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * 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 package net.sf.antcontrib.cpptasks.compiler;
18
19 import java.io.File;
20
21 import org.apache.tools.ant.BuildException;
22
23 import net.sf.antcontrib.cpptasks.CCTask;
24 import net.sf.antcontrib.cpptasks.ProcessorParam;
25
26 /**
27 * A configuration for an ASL compiler
28 *
29 */
30 public final class CommandLineAslcompilerConfiguration implements
31 AslcompilerConfiguration {
32
33 private String[] args;
34
35 private CommandLineAslcompiler acpi;
36
37 private String[] endArgs;
38
39 private boolean rebuild;
40
41 public CommandLineAslcompilerConfiguration (CommandLineAslcompiler acpi,
42 String[] args, boolean rebuild, String[] endArgs) {
43 if (acpi == null) {
44 throw new NullPointerException("acpi");
45 }
46 if (args == null) {
47 this.args = new String[0];
48 } else {
49 this.args = (String[]) args.clone();
50 }
51 this.acpi = acpi;
52 this.rebuild = rebuild;
53 this.endArgs = (String[]) endArgs.clone();
54 }
55
56 public int bid (String inputFile) {
57 int acpiBid = acpi.bid(inputFile);
58 return acpiBid;
59 }
60
61 public void aslcompiler (CCTask task, File outputDir, String[] sourceFiles)
62 throws BuildException {
63 try {
64 acpi.aslcompiler(task, outputDir, sourceFiles, args, endArgs);
65 } catch (BuildException ex) {
66 throw ex;
67 }
68 }
69
70 public String getIdentifier () {
71 return acpi.getCommand();
72 }
73
74 public ProcessorParam[] getParams () {
75 return new ProcessorParam[0];
76 }
77
78 public boolean getRebuild () {
79 return rebuild;
80 }
81
82 public String[] getPreArguments () {
83 return (String[]) args.clone();
84 }
85
86 public String[] getEndArguments () {
87 return (String[]) endArgs.clone();
88 }
89
90 public String getOutputFileName (String inputFile) {
91 return acpi.getOutputFileName(inputFile);
92 }
93 }