Use new DEPS conditionals.

See
https://groups.google.com/a/chromium.org/d/msg/infra-announce/A6_zQKzCHDo/ZKqSptzeBgAJ.
This allows us to avoid checking out unnecessary things (right now every
Windows bot downloads clang). We also can maintain the SDE bits in DEPS
rather than having to update the recipe for it.

This is the first half of the change which conditions things on
variables but leaves the defaults as they are. This will be followed up
by a change to the recipe to set the variables, then to switch the
defaults.

Change-Id: Iebcc4d0a146d0b0df94f480e539d70cbf4c862d3
Reviewed-on: https://boringssl-review.googlesource.com/21804
Reviewed-by: Steven Valdez <svaldez@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/util/bot/DEPS b/util/bot/DEPS
index ccaf75d..f433a58 100644
--- a/util/bot/DEPS
+++ b/util/bot/DEPS
@@ -14,21 +14,26 @@
 
 vars = {
   'chromium_git': 'https://chromium.googlesource.com',
+
+  # TODO(davidben): Switch this to False by default once the recipes configure it.
+  'checkout_clang': True,
+  # TODO(davidben): Switch this to False by default once the recipes configure it.
+  'checkout_fuzzer': 'checkout_linux',
+  'checkout_sde': False,
 }
 
 deps = {
+  'boringssl/util/bot/android_tools': {
+    'url': Var('chromium_git') + '/android_tools.git' + '@' + 'e9d4018e149d50172ed462a7c21137aa915940ec',
+    'condition': 'checkout_android',
+  },
+
   'boringssl/util/bot/gyp':
     Var('chromium_git') + '/external/gyp.git' + '@' + 'eb296f67da078ec01f5e3a9ea9cdc6d26d680161',
-}
 
-deps_os = {
-  'android': {
-    'boringssl/util/bot/android_tools':
-      Var('chromium_git') + '/android_tools.git' + '@' + 'e9d4018e149d50172ed462a7c21137aa915940ec',
-  },
-  'unix': {
-    'boringssl/util/bot/libFuzzer':
-      Var('chromium_git') + '/chromium/llvm-project/llvm/lib/Fuzzer.git' + '@' + '16f5f743c188c836d32cdaf349d5d3effb8a3518',
+  'boringssl/util/bot/libFuzzer': {
+    'url': Var('chromium_git') + '/chromium/llvm-project/llvm/lib/Fuzzer.git' + '@' + '16f5f743c188c836d32cdaf349d5d3effb8a3518',
+    'condition': 'checkout_fuzzer',
   },
 }
 
@@ -41,6 +46,7 @@
   {
     'name': 'cmake_linux64',
     'pattern': '.',
+    'condition': 'host_os == "linux"',
     'action': [ 'download_from_google_storage',
                 '--no_resume',
                 '--platform=linux*',
@@ -50,8 +56,19 @@
     ],
   },
   {
+    'name': 'cmake_linux64_extract',
+    'pattern': '.',
+    'condition': 'host_os == "linux"',
+    'action': [ 'python',
+                'boringssl/util/bot/extract.py',
+                'boringssl/util/bot/cmake-linux64.tar.gz',
+                'boringssl/util/bot/cmake-linux64/',
+    ],
+  },
+  {
     'name': 'cmake_mac',
     'pattern': '.',
+    'condition': 'host_os == "mac"',
     'action': [ 'download_from_google_storage',
                 '--no_resume',
                 '--platform=darwin',
@@ -61,8 +78,19 @@
     ],
   },
   {
+    'name': 'cmake_mac_extract',
+    'pattern': '.',
+    'condition': 'host_os == "mac"',
+    'action': [ 'python',
+                'boringssl/util/bot/extract.py',
+                'boringssl/util/bot/cmake-mac.tar.gz',
+                'boringssl/util/bot/cmake-mac/',
+    ],
+  },
+  {
     'name': 'cmake_win32',
     'pattern': '.',
+    'condition': 'host_os == "win"',
     'action': [ 'download_from_google_storage',
                 '--no_resume',
                 '--platform=win32',
@@ -72,8 +100,19 @@
     ],
   },
   {
+    'name': 'cmake_win32_extract',
+    'pattern': '.',
+    'condition': 'host_os == "win"',
+    'action': [ 'python',
+                'boringssl/util/bot/extract.py',
+                'boringssl/util/bot/cmake-win32.zip',
+                'boringssl/util/bot/cmake-win32/',
+    ],
+  },
+  {
     'name': 'perl_win32',
     'pattern': '.',
+    'condition': 'host_os == "win"',
     'action': [ 'download_from_google_storage',
                 '--no_resume',
                 '--platform=win32',
@@ -83,8 +122,20 @@
     ],
   },
   {
+    'name': 'perl_win32_extract',
+    'pattern': '.',
+    'condition': 'host_os == "win"',
+    'action': [ 'python',
+                'boringssl/util/bot/extract.py',
+                '--no-prefix',
+                'boringssl/util/bot/perl-win32.zip',
+                'boringssl/util/bot/perl-win32/',
+    ],
+  },
+  {
     'name': 'yasm_win32',
     'pattern': '.',
+    'condition': 'host_os == "win"',
     'action': [ 'download_from_google_storage',
                 '--no_resume',
                 '--platform=win32',
@@ -96,6 +147,7 @@
   {
     'name': 'win_toolchain',
     'pattern': '.',
+    'condition': 'host_os == "win"',
     'action': [ 'python',
                 'boringssl/util/bot/vs_toolchain.py',
                 'update',
@@ -104,45 +156,29 @@
   {
     'name': 'clang',
     'pattern': '.',
+    'condition': 'checkout_clang',
     'action': [ 'python',
                 'boringssl/util/bot/update_clang.py',
     ],
   },
   {
-    'name': 'cmake_linux64_extract',
+    'name': 'sde_linux64',
     'pattern': '.',
-    'action': [ 'python',
-                'boringssl/util/bot/extract.py',
-                'boringssl/util/bot/cmake-linux64.tar.gz',
-                'boringssl/util/bot/cmake-linux64/',
+    'condition': 'checkout_sde and host_os == "linux"',
+    'action': [ 'download_from_google_storage',
+                '--no_resume',
+                '--bucket', 'chrome-boringssl-sde',
+                '-s', 'boringssl/util/bot/sde-linux64.tar.bz2.sha1'
     ],
   },
   {
-    'name': 'cmake_mac_extract',
+    'name': 'sde_linux64_extract',
     'pattern': '.',
+    'condition': 'checkout_sde and host_os == "linux"',
     'action': [ 'python',
                 'boringssl/util/bot/extract.py',
-                'boringssl/util/bot/cmake-mac.tar.gz',
-                'boringssl/util/bot/cmake-mac/',
-    ],
-  },
-  {
-    'name': 'cmake_win32_extract',
-    'pattern': '.',
-    'action': [ 'python',
-                'boringssl/util/bot/extract.py',
-                'boringssl/util/bot/cmake-win32.zip',
-                'boringssl/util/bot/cmake-win32/',
-    ],
-  },
-  {
-    'name': 'perl_win32_extract',
-    'pattern': '.',
-    'action': [ 'python',
-                'boringssl/util/bot/extract.py',
-                '--no-prefix',
-                'boringssl/util/bot/perl-win32.zip',
-                'boringssl/util/bot/perl-win32/',
+                'boringssl/util/bot/sde-linux64.tar.bz2',
+                'boringssl/util/bot/sde-linux64/',
     ],
   },
 ]