dart-sdk/samples/build_dart_simple/build.dart
Rico Wind f34fae854a Initial github commit for getting stuff working
Readd samples, samples-dev, tools/testing/bin, third_party removed by cleanup (no history, sorry)

Add DEPS file which will replace the old all.deps and standalone.deps

Add tools/deps/dartium.deps replacing the old dartium.deps (but now editable from a normal checkout)

Fixup tools/utils.py to use the new archiving schema (git count for be, version number for dev/stable

Fix codereview.settings
2015-05-16 15:41:58 +02:00

35 lines
987 B
Dart

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library build_dart_simple;
import "dart:io";
/**
* This minimal build script copies the contents of .foo files to .foobar files.
* In order to be invoked automatically by the Editor, this script must be named
* 'build.dart' and placed in the root of a project.
*/
void main(List<String> arguments) {
for (String arg in arguments) {
if (arg.startsWith("--changed=")) {
String file = arg.substring("--changed=".length);
if (file.endsWith(".foo")) {
_processFile(file);
}
}
}
}
void _processFile(String file) {
String contents = new File(file).readAsStringSync();
if (contents != null) {
IOSink out = new File("${file}bar").openWrite();
out.write("// processed from ${file}:\n${contents}");
out.close();
}
}