aboutsummaryrefslogtreecommitdiffstats
path: root/emulator
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@google.com>2014-05-15 17:57:32 +0000
committerandroid-build-merger <android-build-merger@google.com>2014-05-15 17:57:32 +0000
commit985356d669038f83f41e6b7225a454c5470f3bbc (patch)
tree9e19f6260d113e430d8856095713c9d3d4ad9691 /emulator
parentaf61219ead61343570703f063498e05f1855d85b (diff)
parent180a34c165f2497cae1018701278df7398186bb0 (diff)
downloadsdk-985356d669038f83f41e6b7225a454c5470f3bbc.zip
sdk-985356d669038f83f41e6b7225a454c5470f3bbc.tar.gz
sdk-985356d669038f83f41e6b7225a454c5470f3bbc.tar.bz2
Merge "Build mksdcard for mac/linux with Gradle." into idea133
Auto-merge: 180a34c * commit '180a34c165f2497cae1018701278df7398186bb0': Build mksdcard for mac/linux with Gradle.
Diffstat (limited to 'emulator')
-rw-r--r--emulator/mksdcard/.gitignore3
-rw-r--r--emulator/mksdcard/Android.mk2
-rw-r--r--emulator/mksdcard/build.gradle62
-rw-r--r--emulator/mksdcard/src/source/mksdcard.c (renamed from emulator/mksdcard/mksdcard.c)0
4 files changed, 66 insertions, 1 deletions
diff --git a/emulator/mksdcard/.gitignore b/emulator/mksdcard/.gitignore
new file mode 100644
index 0000000..4a78fc8
--- /dev/null
+++ b/emulator/mksdcard/.gitignore
@@ -0,0 +1,3 @@
+build
+.gradle
+
diff --git a/emulator/mksdcard/Android.mk b/emulator/mksdcard/Android.mk
index a5641b4..0547f00 100644
--- a/emulator/mksdcard/Android.mk
+++ b/emulator/mksdcard/Android.mk
@@ -5,7 +5,7 @@ LOCAL_PATH:= $(call my-dir)
# host executable
#
include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= mksdcard.c
+LOCAL_SRC_FILES:= src/source/mksdcard.c
LOCAL_MODULE = mksdcard
include $(BUILD_HOST_EXECUTABLE)
diff --git a/emulator/mksdcard/build.gradle b/emulator/mksdcard/build.gradle
new file mode 100644
index 0000000..6dd0aa0
--- /dev/null
+++ b/emulator/mksdcard/build.gradle
@@ -0,0 +1,62 @@
+apply plugin: 'c'
+apply plugin: 'sdk-files'
+
+executables {
+ mksdcard {}
+}
+
+sources {
+ mksdcard {
+ c {
+ source {
+ srcDir "src/source"
+ include "**/*.c"
+ }
+ }
+ }
+}
+
+model {
+ platforms {
+ linux {
+ architecture "i386"
+ operatingSystem "linux"
+ }
+ darwin {
+ architecture "i386"
+ operatingSystem "osx"
+ }
+ }
+}
+
+binaries.all {
+ // Define toolchain-specific compiler and linker options
+
+ if (toolChain in Gcc) {
+ cCompiler.args "-O2"
+ linker.args "-S"
+ }
+}
+
+sdk {
+ mac {
+ item( { getExeName("darwin") } ) {
+ executable true
+ builtBy 'darwinMksdcardExecutable'
+ }
+ }
+ linux {
+ item( { getExeName("linux") } ) {
+ executable true
+ builtBy 'linuxMksdcardExecutable'
+ }
+ }
+}
+
+def getExeName(String platform) {
+ // binaries will return a set of binaries
+ def binaries = executables.mksdcard.binaries.matching { it.name == "${platform}MksdcardExecutable" }
+ // calling .exeFile on the set returns an array with the result from each item in the set...
+ return binaries.executableFile.get(0)
+}
+
diff --git a/emulator/mksdcard/mksdcard.c b/emulator/mksdcard/src/source/mksdcard.c
index c9a3eeb..c9a3eeb 100644
--- a/emulator/mksdcard/mksdcard.c
+++ b/emulator/mksdcard/src/source/mksdcard.c