Index: samples/android/android.gyp |
diff --git a/samples/android/android.gyp b/samples/android/android.gyp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b89c9e19df7c79ab1374f6ee1e3af6b19dce2d6c |
--- /dev/null |
+++ b/samples/android/android.gyp |
@@ -0,0 +1,110 @@ |
+# 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. |
+ |
+{ |
+ 'conditions': [ |
+ ['OS=="android"', { |
+ 'variables': { |
+ 'android_tool': '../../third_party/android_tools/sdk/tools/android', |
+ }, |
+ 'targets': [ |
+ { |
+ 'target_name': 'android', |
+ 'type': 'none', |
+ 'dependencies': [ |
+ 'android_apk' |
+ ] |
+ }, |
+ { |
+ 'target_name': 'android_apk', |
+ 'type': 'none', |
+ 'dependencies': [ |
+ 'update_build_xml', |
+ 'gather_dart_assets' |
+ ], |
+ 'actions': [ |
+ { |
+ 'action_name': 'generate_apk', |
+ 'inputs': [ |
+ 'AndroidManifest.xml', |
+ 'ant.properties', |
+ 'build.xml', |
+ 'local.properties', |
+ 'project.properties', |
+ 'src/org/dartlang/Dart.java', |
+ 'src/org/dartlang/example/dart/DartActivity.java' |
+ ], |
+ 'outputs': ['bin/DartActivity-debug.apk'], |
+ 'action': [ |
+ 'ant', |
+ 'debug' |
+ ], |
+ 'message': "Generating Android APK." |
+ } |
+ ] |
+ }, |
+ { |
+ 'target_name': 'update_build_xml', |
+ 'type': 'none', |
+ 'actions': [ |
+ { |
+ 'action_name': 'update_ant_build_files', |
+ 'inputs': [ |
+ 'AndroidManifest.xml' |
+ ], |
+ 'outputs': [ |
+ 'build.xml', |
+ 'local.properties', |
+ ], |
+ 'action': ['<(android_tool)', 'update', 'project', '-p', '.'] |
+ } |
+ ] |
+ }, |
+ { |
+ 'target_name': 'gather_dart_assets', |
+ 'type': 'none', |
+ 'dependencies': [ |
+ 'android_extension' |
+ ], |
+ 'copies': [ |
+ # The Dart VM shared library goes into the libs directory because |
+ # that's where the Android Dalvik runtime will look for it. |
+ { |
+ 'destination': 'libs/x86', |
+ 'files': ['<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)dart_so<(SHARED_LIB_SUFFIX)'] |
+ }, |
+ # The Dart Extension libraries go into the same directory as the |
+ # corresponding Dart file that provides the Dart API for the |
+ # extension. |
+ { |
+ 'destination': 'assets/dart', |
+ 'files': ['<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)android_extension<(SHARED_LIB_SUFFIX)'] |
+ } |
+ ], |
+ 'message': "Gathering Dart assets." |
+ }, |
+ { |
+ 'target_name': 'android_extension', |
+ 'type': 'shared_library', |
+ 'dependencies': [ |
+ '../../runtime/dart-runtime.gyp:dart_so', |
+ ], |
+ 'include_dirs': [ |
+ '../../runtime/include', |
+ ], |
+ 'sources': [ |
+ 'android_extension.cc', |
+ ], |
+ 'ldflags': [ |
+ '-lGLESv2', |
+ ], |
+ 'defines': [ |
+ 'DART_SHARED_LIB', |
+ ], |
+ 'dependencies': [ |
+ '../../runtime/dart-runtime.gyp:dart_so', |
+ ], |
+ }], |
+ }]] |
+} |