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

Unified Diff: pkg/intl/test/message_extraction/find_output_directory.dart

Issue 12733003: Adds facilities for extracting Intl.message calls and generating code from translations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes from review comments, also made tests more robust, removed scheduled_test dependency Created 7 years, 9 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: pkg/intl/test/message_extraction/find_output_directory.dart
diff --git a/pkg/intl/test/message_extraction/find_output_directory.dart b/pkg/intl/test/message_extraction/find_output_directory.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bb623893c00d9a0b1b85ef2b49322f51541afd57
--- /dev/null
+++ b/pkg/intl/test/message_extraction/find_output_directory.dart
@@ -0,0 +1,19 @@
+/**
+ * A shared library for finding the valu eof the --output-dir parameter
+ * which all of these programs use.
+ */
+library find_output_directory;
+
+const directiveName = '--output-dir=';
+
+_asString(list) => new String.fromCharCodes(list);
+
+findOutputDirectory(List<String> args) {
+ var directive = args.firstWhere(
+ (x) => x.contains(directiveName),
+ orElse: () => null);
+ if (directive == null) return '.';
+ var file = directive.codeUnits.skip(directiveName.length);
+ return _asString(file);
+}
+

Powered by Google App Engine
This is Rietveld 408576698