Generate Android.mk for DM.
ifdef out code that won't build where we don't have jsoncpp.
Include ctype instead of string.h for tolower.
Depends on https://codereview.chromium.org/282053002/
BUG=skia:2447
R=mtklein@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/290603002
git-svn-id: http://skia.googlecode.com/svn/trunk@14768 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/dm/DM.cpp b/dm/DM.cpp
index f4eefa6..8df0ab1 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -21,7 +21,7 @@
#include "DMTestTask.h"
#include "DMWriteTask.h"
-#include <string.h>
+#include <ctype.h>
using skiagm::GM;
using skiagm::GMRegistry;
@@ -32,7 +32,10 @@
DEFINE_int32(gpuThreads, 1, "Threads for GPU work.");
DEFINE_string2(expectations, r, "",
"If a directory, compare generated images against images under this path. "
- "If a file, compare generated images against JSON expectations at this path.");
+#ifdef SK_BUILD_JSON_WRITER
+ "If a file, compare generated images against JSON expectations at this path."
+#endif
+);
DEFINE_string2(resources, i, "resources", "Path to resources directory.");
DEFINE_string(match, "", "[~][^]substring[$] [...] of GM name to run.\n"
"Multiple matches may be separated by spaces.\n"
@@ -225,7 +228,9 @@
if (sk_isdir(path)) {
expectations.reset(SkNEW_ARGS(DM::WriteTask::Expectations, (path)));
} else {
+#ifdef SK_BUILD_JSON_WRITER
expectations.reset(SkNEW_ARGS(DM::JsonExpectations, (path)));
+#endif
}
}
}
diff --git a/dm/DMExpectations.h b/dm/DMExpectations.h
index 238d1c5..5509709 100644
--- a/dm/DMExpectations.h
+++ b/dm/DMExpectations.h
@@ -19,6 +19,7 @@
bool check(const Task&, SkBitmap) const SK_OVERRIDE { return true; }
};
+#ifdef SK_BUILD_JSON_WRITER
class JsonExpectations : public Expectations {
public:
explicit JsonExpectations(const char* path) : fGMExpectations(path) {}
@@ -40,6 +41,7 @@
private:
skiagm::JsonExpectationsSource fGMExpectations;
};
+#endif
} // namespace DM
diff --git a/gyp/dm.gyp b/gyp/dm.gyp
index ac72aee..238a152 100644
--- a/gyp/dm.gyp
+++ b/gyp/dm.gyp
@@ -59,5 +59,15 @@
'gputest.gyp:skgputest',
'record.gyp:*',
],
+ 'conditions': [
+ ['skia_android_framework',
+ {
+ 'libraries': [
+ '-lskia',
+ '-lcutils',
+ ],
+ },
+ ],
+ ],
}]
}
diff --git a/platform_tools/android/bin/gyp_to_android.py b/platform_tools/android/bin/gyp_to_android.py
index f6fc578..cf4f782 100755
--- a/platform_tools/android/bin/gyp_to_android.py
+++ b/platform_tools/android/bin/gyp_to_android.py
@@ -152,6 +152,14 @@
local_module_name='skia_gm',
local_module_tags=['optional'])
+ tool_makefile_writer.generate_tool(gyp_dir=tmp_folder,
+ target_file='dm.gyp',
+ skia_trunk=target_dir,
+ dest_dir='dm',
+ skia_lib_var_dict=common,
+ local_module_name='skia_dm',
+ local_module_tags=['optional'])
+
# Now that the defines have been written to SkUserConfig and they've been
# used to skip adding them to the tools makefiles, they are not needed in
# Android.mk. Reset DEFINES.
diff --git a/platform_tools/android/gyp_gen/makefile_writer.py b/platform_tools/android/gyp_gen/makefile_writer.py
index 948407e..3384773 100644
--- a/platform_tools/android/gyp_gen/makefile_writer.py
+++ b/platform_tools/android/gyp_gen/makefile_writer.py
@@ -124,6 +124,9 @@
# unit-tests
include $(BASE_PATH)/tests/Android.mk
+
+# diamond-master (one test to rule them all)
+include $(BASE_PATH)/dm/Android.mk
"""
)