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

Unified Diff: platform_tools/android/gyp_gen/generate_user_config.py

Issue 388693003: Alphabetize defines in generated SkUserConfig. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Respond to comments. ordered_set -> defines in test. Created 6 years, 5 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: platform_tools/android/gyp_gen/generate_user_config.py
diff --git a/platform_tools/android/gyp_gen/generate_user_config.py b/platform_tools/android/gyp_gen/generate_user_config.py
index 957c363f0256eaf5d59709a78e20e64b637b2eb2..6858d9372fc824e499052a7b2b85507488068ff5 100644
--- a/platform_tools/android/gyp_gen/generate_user_config.py
+++ b/platform_tools/android/gyp_gen/generate_user_config.py
@@ -29,7 +29,7 @@ BUILD_GUARD = 'SkUserConfig_Android_DEFINED'
def generate_user_config(original_sk_user_config, require_sk_user_config,
- target_dir, ordered_set):
+ target_dir, defines):
"""Generate the SkUserConfig file specific to the Android framework.
Android needs its #defines in its skia/include/core directory, so that other
@@ -48,8 +48,7 @@ def generate_user_config(original_sk_user_config, require_sk_user_config,
written. Its name will be the same basename as
original_sk_user_config. If None, the new file will be written to the
working directory.
- ordered_set: A vars_dict_lib.OrderedSet, containing a list of defines to
- be appended to SkUserConfig.
+ defines: Iterable of defines to be appended to SkUserConfig.
Raises:
AssertionError: If original_sk_user_config does not exist.
@@ -95,7 +94,7 @@ def generate_user_config(original_sk_user_config, require_sk_user_config,
dst.write('#endif\n\n')
# Now add the defines from the gyp files.
- for item in ordered_set:
+ for item in sorted(defines):
# Although our defines may have '=' in them, when written to the header
# there should be a space between the macro and what it replaces.
dst.write('#define ' + item.replace('=', ' ') + '\n')
« no previous file with comments | « platform_tools/android/bin/gyp_to_android.py ('k') | platform_tools/android/tests/expectations/SkUserConfig-h.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698