[go: nahoru, domu]

jni_zero: move all python and test code into //third_party/jni_zero

This is as close to a pure `mv` as I could do. No functional changes,
and I haven't brought over anything else from the
//base/android/jni_generator folder.

We plan to develop the re-branded jni_generator from within
//third_party for now.

Bug: 1377351, 1456762
Change-Id: I71a9afe0d62c09003e9afa24582eae5f36f09ccf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4722028
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Sam Maier <smaier@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1181106}
diff --git a/third_party/jni_zero/PRESUBMIT.py b/third_party/jni_zero/PRESUBMIT.py
new file mode 100644
index 0000000..274f7a60
--- /dev/null
+++ b/third_party/jni_zero/PRESUBMIT.py
@@ -0,0 +1,37 @@
+# Copyright 2018 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+"""Presubmit script for android buildbot.
+
+See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
+details on the presubmit API built into depot_tools.
+"""
+
+
+def CommonChecks(input_api, output_api):
+  base_android_jni_generator_dir = input_api.PresubmitLocalPath()
+
+  env = dict(input_api.environ)
+  env.update({
+      'PYTHONPATH': base_android_jni_generator_dir,
+      'PYTHONDONTWRITEBYTECODE': '1',
+  })
+
+  return input_api.RunTests(
+      input_api.canned_checks.GetUnitTests(
+          input_api,
+          output_api,
+          unit_tests=[
+              input_api.os_path.join(base_android_jni_generator_dir,
+                                     'integration_tests.py')
+          ],
+          env=env,
+      ))
+
+
+def CheckChangeOnUpload(input_api, output_api):
+  return CommonChecks(input_api, output_api)
+
+
+def CheckChangeOnCommit(input_api, output_api):
+  return CommonChecks(input_api, output_api)