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

Unified Diff: build/android/pylib/constants/__init__.py

Issue 1660693002: Add --output-dir flag to third_party/android_platform/development/scripts/stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: redo Created 4 years, 11 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
« no previous file with comments | « no previous file | build/android/tombstones.py » ('j') | build/android/tombstones.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/constants/__init__.py
diff --git a/build/android/pylib/constants/__init__.py b/build/android/pylib/constants/__init__.py
index 1a48723d584e308175ccf2a05cf504246d9b89b7..316b383e735b52d34db683e8bb19ad67178305c4 100644
--- a/build/android/pylib/constants/__init__.py
+++ b/build/android/pylib/constants/__init__.py
@@ -244,6 +244,27 @@ def GetOutDirectory(build_type=None):
GetBuildType() if build_type is None else build_type))
+def CheckOutDirectory():
pasko 2016/02/04 12:53:40 nit: s/Out/Output/ because it is done after SetOut
agrieve 2016/02/04 18:30:50 Done.
+ """Checks that CHROMIUM_OUT_DIR or CHROMIUM_OUTPUT_DIR is set.
+
+ If neither are set, but the current working directory is a build directory,
+ then CHROMIUM_OUTPUT_DIR is set to the current working directory.
+
+ Raises:
+ EnvironmentError: If no output directory is detected.
+ """
+ output_dir = os.environ.get('CHROMIUM_OUTPUT_DIR')
+ out_dir = os.environ.get('CHROMIUM_OUT_DIR')
+ if not output_dir and not out_dir:
+ # If CWD is an output directory, then assume it's the desired one.
+ if os.path.exists('build.ninja'):
+ output_dir = os.getcwd()
+ SetOutputDirectory(output_dir)
+ else:
+ raise EnvironmentError('Neither CHROMIUM_OUTPUT_DIR nor CHROMIUM_OUT_DIR '
pasko 2016/02/04 12:53:40 EnvironmentError is something that keeps a filenam
jbudorick 2016/02/04 16:13:45 Agreed.
agrieve 2016/02/04 18:30:50 Done.
+ 'has been set')
+
+
# TODO(jbudorick): Convert existing callers to AdbWrapper.GetAdbPath() and
# remove this.
def GetAdbPath():
« no previous file with comments | « no previous file | build/android/tombstones.py » ('j') | build/android/tombstones.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698