Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Unified Diff: mojo/dart/packages/mojom/lib/src/generate.dart

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Move and Standardize Mojom Type Functions Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/dart/packages/mojom/lib/src/generate.dart
diff --git a/mojo/dart/packages/mojom/lib/src/generate.dart b/mojo/dart/packages/mojom/lib/src/generate.dart
index e9c73d4964b80fd29905f7b7d5f61861ea993bda..eeba3855432bab15158cec4b3a029e54aa826d2f 100644
--- a/mojo/dart/packages/mojom/lib/src/generate.dart
+++ b/mojo/dart/packages/mojom/lib/src/generate.dart
@@ -16,6 +16,8 @@ import 'package:path/path.dart' as path;
part 'mojom_finder.dart';
+const String mojoTestPackage = '_mojo_for_test_only';
+
class MojomGenerator {
static dev.Counter _genMs;
final bool _errorOnDuplicate;
@@ -161,6 +163,9 @@ class MojomGenerator {
final servicesPath = _sniffForMojoServicesInclude(mojom.path);
+ final generateTypeInfoFlag = packageName == mojoTestPackage ?
zra 2016/01/27 18:15:12 Please add a TODO and file a bug to remove this ha
alexfandrianto 2016/01/28 03:45:12 Done.
+ '--generate-type-info' : '--no-generate-type-info';
+
final arguments = [
'--use_bundled_pylibs',
'-g',
@@ -171,7 +176,8 @@ class MojomGenerator {
sdkInc,
'-I',
importDir.path,
- '--no-gen-imports'
+ '--no-gen-imports',
+ generateTypeInfoFlag
];
if (servicesPath != null) {
arguments.add('-I');
@@ -197,7 +203,7 @@ class MojomGenerator {
// Generated .mojom.dart is under $output/dart-gen/$PACKAGE/lib/$X
// Move $X to |destination|/lib/$X.
- // Throw an exception if $PACKGE != [packageName].
+ // Throw an exception if $PACKAGE != [packageName].
final generatedDirName = path.join(output, 'dart-gen');
final generatedDir = new Directory(generatedDirName);
log.info("generatedDir= $generatedDir");

Powered by Google App Engine
This is Rietveld 408576698