[go: nahoru, domu]

Android: Move android_lint to android_build_tools

Rather than being a top-level target, android_lint is taken from the SDK
and belongs under //third_party/android_build_tools.

A subsequent CL will update the package name in DEPS once the 3pp bot
uploads a new instance under the new package name.

Bug: 1273512
Change-Id: Ie4ba0e3d97d1c7b8a258db11697dbd77ca0c9adb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3738921
Auto-Submit: Peter Wen <wnwen@chromium.org>
Reviewed-by: Mohamed Heikal <mheikal@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1020067}
diff --git a/BUILD.gn b/BUILD.gn
index d77f41b..861191e82 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -366,7 +366,7 @@
       "//net/android:net_junit_tests",
       "//services:services_junit_tests",
       "//testing/android/junit:junit_unit_tests",
-      "//third_party/android_lint:custom_lint_java",
+      "//third_party/android_build_tools/lint:custom_lint_java",
       "//third_party/catapult/devil",
       "//third_party/r8:custom_d8_java",
       "//tools/android:android_tools",
diff --git a/DEPS b/DEPS
index e241b32..48b26b83 100644
--- a/DEPS
+++ b/DEPS
@@ -980,9 +980,10 @@
       'dep_type': 'cipd',
   },
 
-  'src/third_party/android_lint': {
+  'src/third_party/android_build_tools/lint': {
       'packages': [
           {
+               # TODO(wnwen): Switch to chromium/third_party/android_build_tools/lint.
                'package': 'chromium/third_party/android_lint',
                'version': 'f5g1G8eyExIUPHk4lH3xx_xV4pza9WSBaITgmLPgF2cC',
           },
diff --git a/WATCHLISTS b/WATCHLISTS
index 803c141b..3c953c6 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -72,8 +72,9 @@
                   'chrome/android/javatests/src/org/chromium/chrome/browser/.*ChooserDialogTest.java'
     },
     'android_lint': {
-      'filepath': '/lint-baseline.xml|'\
-                  '/lint-suppressions.xml'
+      'filepath': '/lint-baseline.xml' \
+                  '|/lint-suppressions.xml' \
+                  '|third_party/android_build_tools/lint'
     },
     'android_omnibox': {
       'filepath': 'chrome/browser/ui/android/omnibox/',
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index b34a81e..7d1c897 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -91,8 +91,8 @@
 _desugar_jdk_libs_configuration_jar = "//third_party/android_deps/libs/com_android_tools_desugar_jdk_libs_configuration/desugar_jdk_libs_configuration-1.1.5.jar"
 _robolectric_jar_path =
     "//third_party/robolectric/lib/android-all-12-robolectric-7732740.jar"
-_lint_jar_path = "//third_party/android_lint/lint.jar"
-_custom_lint_jar_path = "//third_party/android_lint/custom_lint.jar"
+_lint_jar_path = "//third_party/android_build_tools/lint/lint.jar"
+_custom_lint_jar_path = "//third_party/android_build_tools/lint/custom_lint.jar"
 
 # Put the bug number in the target name so that false-positives have a hint in
 # the error message about why non-existent dependencies are there.
diff --git a/third_party/android_lint/.gitignore b/third_party/android_build_tools/lint/.gitignore
similarity index 100%
rename from third_party/android_lint/.gitignore
rename to third_party/android_build_tools/lint/.gitignore
diff --git a/third_party/android_lint/3pp/3pp.pb b/third_party/android_build_tools/lint/3pp/3pp.pb
similarity index 75%
rename from third_party/android_lint/3pp/3pp.pb
rename to third_party/android_build_tools/lint/3pp/3pp.pb
index 388f771..5274a2b 100644
--- a/third_party/android_lint/3pp/3pp.pb
+++ b/third_party/android_build_tools/lint/3pp/3pp.pb
@@ -1,6 +1,7 @@
-# Copyright 2021 The Chromium Authors. All rights reserved.
+# Copyright 2022 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
+
 create {
   source {
     script {
@@ -17,6 +18,6 @@
 }
 
 upload {
-  pkg_prefix: "chromium/third_party"
+  pkg_prefix: "chromium/third_party/android_build_tools"
   universal: true
 }
diff --git a/third_party/android_lint/3pp/fetch.py b/third_party/android_build_tools/lint/3pp/fetch.py
similarity index 100%
rename from third_party/android_lint/3pp/fetch.py
rename to third_party/android_build_tools/lint/3pp/fetch.py
diff --git a/third_party/android_lint/3pp/install.py b/third_party/android_build_tools/lint/3pp/install.py
similarity index 100%
rename from third_party/android_lint/3pp/install.py
rename to third_party/android_build_tools/lint/3pp/install.py
diff --git a/third_party/android_lint/BUILD.gn b/third_party/android_build_tools/lint/BUILD.gn
similarity index 87%
rename from third_party/android_lint/BUILD.gn
rename to third_party/android_build_tools/lint/BUILD.gn
index ed4d4382..9d342b98 100644
--- a/third_party/android_lint/BUILD.gn
+++ b/third_party/android_build_tools/lint/BUILD.gn
@@ -11,5 +11,5 @@
 
   # Avoid using java_prebuilt() to ensure all uses go through the checked-in
   # version.
-  input_jars_paths = [ "//third_party/android_lint/lint.jar" ]
+  input_jars_paths = [ "//third_party/android_build_tools/lint/lint.jar" ]
 }
diff --git a/third_party/android_lint/LICENSE b/third_party/android_build_tools/lint/LICENSE
similarity index 100%
rename from third_party/android_lint/LICENSE
rename to third_party/android_build_tools/lint/LICENSE
diff --git a/third_party/android_lint/OWNERS b/third_party/android_build_tools/lint/OWNERS
similarity index 100%
rename from third_party/android_lint/OWNERS
rename to third_party/android_build_tools/lint/OWNERS
diff --git a/third_party/android_lint/README.chromium b/third_party/android_build_tools/lint/README.chromium
similarity index 71%
rename from third_party/android_lint/README.chromium
rename to third_party/android_build_tools/lint/README.chromium
index 12f1534..49c32c9 100644
--- a/third_party/android_lint/README.chromium
+++ b/third_party/android_build_tools/lint/README.chromium
@@ -12,8 +12,9 @@
 Local Modifications:
 * For the custom lint jar:
   * This is required only when CustomLint.java changes.
-autoninja -C out/Debug third_party/android_lint:custom_lint_java
-cp out/Debug/obj/third_party/android_lint/custom_lint_java.javac.jar third_party/android_lint/custom_lint.jar
+autoninja -C out/Debug third_party/android_build_tools/lint:custom_lint_java
+cp out/Debug/obj/third_party/android_build_tools/lint/custom_lint_java.javac.jar \
+   third_party/android_build_tools/lint/custom_lint.jar
 
 What version is this:
   * New instances are uploaded by the packager bot:
@@ -21,4 +22,4 @@
   * The bot autoruns every 6 hours. Ping a trooper or a clank-build-core@ dev to
     trigger it if you need it sooner:
     https://luci-scheduler.appspot.com/jobs/chromium/3pp-linux-amd64-packager
-  * New versions need to be manually added by updating //DEPS.
+  * Switching to a newer verison requires manually updating //DEPS.
diff --git a/third_party/android_lint/custom_lint.jar b/third_party/android_build_tools/lint/custom_lint.jar
similarity index 100%
rename from third_party/android_lint/custom_lint.jar
rename to third_party/android_build_tools/lint/custom_lint.jar
Binary files differ
diff --git a/third_party/android_lint/java/src/org/chromium/build/CustomLint.java b/third_party/android_build_tools/lint/java/src/org/chromium/build/CustomLint.java
similarity index 100%
rename from third_party/android_lint/java/src/org/chromium/build/CustomLint.java
rename to third_party/android_build_tools/lint/java/src/org/chromium/build/CustomLint.java