| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Tools for code generation. | 6 * Tools for code generation. |
| 7 */ | 7 */ |
| 8 library codegen.tools; | 8 library codegen.tools; |
| 9 | 9 |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 * in compliance with the License. You may obtain a copy of the License at | 139 * in compliance with the License. You may obtain a copy of the License at |
| 140 * | 140 * |
| 141 * http://www.eclipse.org/legal/epl-v10.html | 141 * http://www.eclipse.org/legal/epl-v10.html |
| 142 * | 142 * |
| 143 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 143 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 144 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 144 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| 145 * or implied. See the License for the specific language governing permissions a
nd limitations under | 145 * or implied. See the License for the specific language governing permissions a
nd limitations under |
| 146 * the License. | 146 * the License. |
| 147 * | 147 * |
| 148 * This file has been automatically generated. Please do not edit it manually. | 148 * This file has been automatically generated. Please do not edit it manually. |
| 149 * To regenerate the file, use the script "pkg/analysis_server/spec/generate_fil
es". | 149 * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generat
e_files". |
| 150 */'''; | 150 */'''; |
| 151 } else { | 151 } else { |
| 152 header = ''' | 152 header = ''' |
| 153 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 153 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 154 // for details. All rights reserved. Use of this source code is governed by a | 154 // for details. All rights reserved. Use of this source code is governed by a |
| 155 // BSD-style license that can be found in the LICENSE file. | 155 // BSD-style license that can be found in the LICENSE file. |
| 156 // | 156 // |
| 157 // This file has been automatically generated. Please do not edit it manually. | 157 // This file has been automatically generated. Please do not edit it manually. |
| 158 // To regenerate the file, use the script | 158 // To regenerate the file, use the script |
| 159 // "pkg/analysis_server/spec/generate_files". | 159 // "pkg/analysis_server/tool/spec/generate_files". |
| 160 '''; | 160 '''; |
| 161 } | 161 } |
| 162 writeln(header.trim()); | 162 writeln(header.trim()); |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 /** | 166 /** |
| 167 * State used by [CodeGenerator]. | 167 * State used by [CodeGenerator]. |
| 168 */ | 168 */ |
| 169 class _CodeGeneratorState { | 169 class _CodeGeneratorState { |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 outputFile.createSync(recursive: true); | 451 outputFile.createSync(recursive: true); |
| 452 | 452 |
| 453 // generate all of the files in the directory | 453 // generate all of the files in the directory |
| 454 Map<String, FileContentsComputer> map = directoryContentsComputer(); | 454 Map<String, FileContentsComputer> map = directoryContentsComputer(); |
| 455 map.forEach((String file, FileContentsComputer fileContentsComputer) { | 455 map.forEach((String file, FileContentsComputer fileContentsComputer) { |
| 456 File outputFile = new File(joinAll(posix.split(outputDirPath + file))); | 456 File outputFile = new File(joinAll(posix.split(outputDirPath + file))); |
| 457 outputFile.writeAsStringSync(fileContentsComputer()); | 457 outputFile.writeAsStringSync(fileContentsComputer()); |
| 458 }); | 458 }); |
| 459 } | 459 } |
| 460 } | 460 } |
| OLD | NEW |