Run licenses check on Linux Unopt

This is so that we can remove it from the
Cirrus run.

Test run here:

https://ci.chromium.org/raw/build/logs.chromium.org/flutter/led/zra_google.com/40f7094924b6baa3b34ea7bcd31ddcd7ddc587441072aa0a859164ff31056794/+/build.proto?server=chromium-swarm.appspot.com

Change-Id: I319828724c547d22860a899c2913453078669bb0
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/15001
Reviewed-by: Dan Field <dnfield@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
diff --git a/recipes/engine_unopt.expected/linux.json b/recipes/engine_unopt.expected/linux.json
index 3f047a3..514a198 100644
--- a/recipes/engine_unopt.expected/linux.json
+++ b/recipes/engine_unopt.expected/linux.json
@@ -838,6 +838,30 @@
   },
   {
     "cmd": [
+      "[CACHE]/builder/src/flutter/ci/licenses.sh"
+    ],
+    "cwd": "[CACHE]/builder/src",
+    "env": {
+      "ANDROID_HOME": "[CACHE]/builder/src/third_party/android_tools/sdk",
+      "GOMA_DIR": "[CACHE]/goma/client"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[CACHE]/builder/src/third_party/dart/tools/sdks/dart-sdk/bin"
+      ]
+    },
+    "env_suffixes": {
+      "DEPOT_TOOLS_UPDATE": [
+        "0"
+      ],
+      "PATH": [
+        "RECIPE_REPO[depot_tools]"
+      ]
+    },
+    "name": "licenses check"
+  },
+  {
+    "cmd": [
       "python",
       "[CACHE]/builder/src/flutter/tools/gn",
       "--goma",
diff --git a/recipes/engine_unopt.expected/linux_lto.json b/recipes/engine_unopt.expected/linux_lto.json
index edb9daa..22bd12e 100644
--- a/recipes/engine_unopt.expected/linux_lto.json
+++ b/recipes/engine_unopt.expected/linux_lto.json
@@ -837,6 +837,30 @@
   },
   {
     "cmd": [
+      "[CACHE]/builder/src/flutter/ci/licenses.sh"
+    ],
+    "cwd": "[CACHE]/builder/src",
+    "env": {
+      "ANDROID_HOME": "[CACHE]/builder/src/third_party/android_tools/sdk",
+      "GOMA_DIR": "[CACHE]/goma/client"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[CACHE]/builder/src/third_party/dart/tools/sdks/dart-sdk/bin"
+      ]
+    },
+    "env_suffixes": {
+      "DEPOT_TOOLS_UPDATE": [
+        "0"
+      ],
+      "PATH": [
+        "RECIPE_REPO[depot_tools]"
+      ]
+    },
+    "name": "licenses check"
+  },
+  {
+    "cmd": [
       "python",
       "[CACHE]/builder/src/flutter/tools/gn",
       "--goma",
diff --git a/recipes/engine_unopt.py b/recipes/engine_unopt.py
index df5133d..120ec0b 100644
--- a/recipes/engine_unopt.py
+++ b/recipes/engine_unopt.py
@@ -92,6 +92,13 @@
       api.step('dart bin/main.dart', ['dart', 'bin/main.dart'])
 
 
+def CheckLicenses(api):
+  checkout = GetCheckoutPath(api)
+  with api.context(cwd=checkout):
+    licenses_cmd = checkout.join('flutter', 'ci', 'licenses.sh')
+    api.step('licenses check', [licenses_cmd])
+
+
 def BuildLinuxAndroid(api, swarming_task_id):
   # Build Android Unopt and run tests
   RunGN(api, '--android', '--unoptimized')
@@ -227,6 +234,7 @@
       FormatAndDartTest(api)
       Lint(api)
       AnalyzeDartUI(api)
+      CheckLicenses(api)
       BuildLinux(api)
       TestObservatory(api)
       LintAndroidHost(api)