Index: pkg/analysis_server/tool/spec/codegen_java_types.dart |
diff --git a/pkg/analysis_server/tool/spec/codegen_java_types.dart b/pkg/analysis_server/tool/spec/codegen_java_types.dart |
index 2dec54ce4d4fad18a1e1700022c33663bce86daf..0389ea4db066e88b678357f98b6d024d4d989cde 100644 |
--- a/pkg/analysis_server/tool/spec/codegen_java_types.dart |
+++ b/pkg/analysis_server/tool/spec/codegen_java_types.dart |
@@ -7,18 +7,54 @@ |
*/ |
library java.generator.types; |
+import 'package:analyzer/src/codegen/tools.dart'; |
import 'package:html/dom.dart' as dom; |
import 'api.dart'; |
import 'codegen_java.dart'; |
-import 'codegen_tools.dart'; |
import 'from_html.dart'; |
import 'implied_types.dart'; |
-final String pathToGenTypes = 'generated/java/types/'; |
+/** |
+ * A map between the field names and values for the Element object such as: |
+ * |
+ * private static final int ABSTRACT = 0x01; |
+ */ |
+const Map<String, String> _extraFieldsOnElement = const { |
+ 'ABSTRACT': '0x01', |
+ 'CONST': '0x02', |
+ 'FINAL': '0x04', |
+ 'TOP_LEVEL_STATIC': '0x08', |
+ 'PRIVATE': '0x10', |
+ 'DEPRECATED': '0x20', |
+}; |
-final GeneratedDirectory targetDir = new GeneratedDirectory(pathToGenTypes, () { |
- Api api = readApi(); |
+/** |
+ * A map between the method names and field names to generate additional methods on the Element object: |
+ * |
+ * public boolean isFinal() { |
+ * return (flags & FINAL) != 0; |
+ * } |
+ */ |
+const Map<String, String> _extraMethodsOnElement = const { |
+ 'isAbstract': 'ABSTRACT', |
+ 'isConst': 'CONST', |
+ 'isDeprecated': 'DEPRECATED', |
+ 'isFinal': 'FINAL', |
+ 'isPrivate': 'PRIVATE', |
+ 'isTopLevelOrStatic': 'TOP_LEVEL_STATIC', |
+}; |
+ |
+/** |
+ * Type references in the spec that are named something else in Java. |
+ */ |
+const Map<String, String> _typeRenames = const {'Override': 'OverrideMember',}; |
+ |
+final String pathToGenTypes = 'tool/spec/generated/java/types'; |
+ |
+final GeneratedDirectory targetDir = |
+ new GeneratedDirectory(pathToGenTypes, (String pkgPath) { |
+ Api api = readApi(pkgPath); |
Map<String, ImpliedType> impliedTypes = computeImpliedTypes(api); |
Map<String, FileContentsComputer> map = |
new Map<String, FileContentsComputer>(); |
@@ -37,7 +73,7 @@ final GeneratedDirectory targetDir = new GeneratedDirectory(pathToGenTypes, () { |
if (_typeRenames.containsKey(typeNameInSpec)) { |
typeNameInJava = _typeRenames[typeNameInSpec]; |
} |
- map['${typeNameInJava}.java'] = () { |
+ map['${typeNameInJava}.java'] = (String pkgPath) { |
String superclassName = null; |
if (isRefactoringFeedback) { |
superclassName = 'RefactoringFeedback'; |
@@ -67,51 +103,10 @@ final GeneratedDirectory targetDir = new GeneratedDirectory(pathToGenTypes, () { |
} |
} |
} |
+ print(map.keys); |
return map; |
}); |
-/** |
- * A map between the field names and values for the Element object such as: |
- * |
- * private static final int ABSTRACT = 0x01; |
- */ |
-const Map<String, String> _extraFieldsOnElement = const { |
- 'ABSTRACT': '0x01', |
- 'CONST': '0x02', |
- 'FINAL': '0x04', |
- 'TOP_LEVEL_STATIC': '0x08', |
- 'PRIVATE': '0x10', |
- 'DEPRECATED': '0x20', |
-}; |
- |
-/** |
- * A map between the method names and field names to generate additional methods on the Element object: |
- * |
- * public boolean isFinal() { |
- * return (flags & FINAL) != 0; |
- * } |
- */ |
-const Map<String, String> _extraMethodsOnElement = const { |
- 'isAbstract': 'ABSTRACT', |
- 'isConst': 'CONST', |
- 'isDeprecated': 'DEPRECATED', |
- 'isFinal': 'FINAL', |
- 'isPrivate': 'PRIVATE', |
- 'isTopLevelOrStatic': 'TOP_LEVEL_STATIC', |
-}; |
- |
-/** |
- * Type references in the spec that are named something else in Java. |
- */ |
-const Map<String, String> _typeRenames = const {'Override': 'OverrideMember',}; |
- |
-/** |
- * Translate spec_input.html into AnalysisServer.java. |
- */ |
-main() { |
- targetDir.generate(); |
-} |
- |
class CodegenJavaType extends CodegenJavaVisitor { |
final String className; |
final String superclassName; |