OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 @Option(name = "--batch", aliases = {"-batch"}) | 123 @Option(name = "--batch", aliases = {"-batch"}) |
124 private boolean batch = false; | 124 private boolean batch = false; |
125 | 125 |
126 @Option(name = "--show-sdk-warnings") | 126 @Option(name = "--show-sdk-warnings") |
127 private boolean showSdkWarnings = false; | 127 private boolean showSdkWarnings = false; |
128 | 128 |
129 @Option(name = "--fatal-warnings") | 129 @Option(name = "--fatal-warnings") |
130 private boolean warningsAreFatal = false; | 130 private boolean warningsAreFatal = false; |
131 | 131 |
| 132 // TODO(devoncarew): this is unused, and is only for dartc compatibility |
| 133 @Option(name = "--fatal-type-errors") |
| 134 private boolean fatalTypeError = false; |
| 135 |
| 136 // TODO(devoncarew): this is unused, and is only for dartc compatibility |
| 137 @Option(name = "--error_format") |
| 138 private String errorFormat = ""; |
| 139 |
132 @Option(name = "--create-sdk-index", // | 140 @Option(name = "--create-sdk-index", // |
133 metaVar = "<file>") | 141 metaVar = "<file>") |
134 private File sdkIndexLocation = null; | 142 private File sdkIndexLocation = null; |
135 | 143 |
136 @Option(name = "--test") | 144 @Option(name = "--test") |
137 private boolean runTests = false; | 145 private boolean runTests = false; |
138 | 146 |
139 @SuppressWarnings("unused") | 147 @SuppressWarnings("unused") |
140 @Option(name = "--ignore-unrecognized-flags") | 148 @Option(name = "--ignore-unrecognized-flags") |
141 private boolean ignoreUnrecognizedFlags; | 149 private boolean ignoreUnrecognizedFlags; |
142 | 150 |
143 @Argument | 151 @Argument |
144 private final String sourceFile = null; | 152 private final String sourceFile = null; |
145 | 153 |
146 public AnalyzerOptions() { | 154 public AnalyzerOptions() { |
147 | 155 |
148 } | 156 } |
149 | 157 |
150 /** | 158 /** |
151 * Return the path to the dart SDK. | 159 * Return the path to the dart SDK. |
152 */ | 160 */ |
153 public File getDartSdkPath() { | 161 public File getDartSdkPath() { |
154 return dartSdkPath; | 162 return dartSdkPath; |
155 } | 163 } |
156 | 164 |
157 public boolean getMachineFormat() { | 165 public boolean getMachineFormat() { |
| 166 if ("machine".equals(errorFormat)) { |
| 167 return true; |
| 168 } |
| 169 |
158 return machineFormat; | 170 return machineFormat; |
159 } | 171 } |
160 | 172 |
161 /** | 173 /** |
162 * @return the package-root path, if specified | 174 * @return the package-root path, if specified |
163 */ | 175 */ |
164 public File getPackageRootPath() { | 176 public File getPackageRootPath() { |
165 return packageRootPath; | 177 return packageRootPath; |
166 } | 178 } |
167 | 179 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 ioe.printStackTrace(); | 278 ioe.printStackTrace(); |
267 } | 279 } |
268 } | 280 } |
269 } | 281 } |
270 | 282 |
271 private boolean isSDKPath(File directory) { | 283 private boolean isSDKPath(File directory) { |
272 return directory.getName().equals("dart-sdk") && new File(directory, "VERSIO
N").exists(); | 284 return directory.getName().equals("dart-sdk") && new File(directory, "VERSIO
N").exists(); |
273 } | 285 } |
274 | 286 |
275 } | 287 } |
OLD | NEW |