Upgrade ktfmt to v0.54

This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update external/ktfmt
For more info, check https://cs.android.com/android/platform/superproject/main/+/main:tools/external_updater/README.md

Test: TreeHugger
Change-Id: Icccbcd59cd85986cddc5fc99c4ff11cbd9b45df0
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index ded40a0..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "vendor/google-java-format"]
-	path = vendor/google-java-format
-	url = https://github.com/google/google-java-format.git
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..c54baa9
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,55 @@
+//
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// README:
+// - Before expanding the visiblity of any of the targets in this file,
+//   please add a test that covers the new dependencies in the TEST_MAPPING file
+//   of this directory. We cannot guarantee that ExoPlayer dependents will not
+//   be accidentally broken if it is not covered by presubmit.
+// - The names in this files follow the pattern exoplayer-dep_name[-module_name]
+//   where dep_name identifies the client, and module_name disambiguates the
+//   module for cases where necessary (example: The same client depends
+//   separately on two exoplayer modules).
+
+package {
+    default_applicable_licenses: ["external_ktfmt_license"],
+}
+
+license {
+    name: "external_ktfmt_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "LICENSE",
+    ],
+}
+
+java_binary_host {
+    name: "ktfmt",
+    manifest: "MANIFEST.mf",
+    srcs: ["core/src/main/**/*.kt"],
+    static_libs: [
+        "google_java_format",
+        "guava",
+        "jna-prebuilt",
+        "kotlin-compiler-embeddable",
+        "kotlin-stdlib-jdk7",
+        "kotlinx_coroutines",
+        "trove-prebuilt",
+    ],
+}
diff --git a/MANIFEST.mf b/MANIFEST.mf
new file mode 100644
index 0000000..a6f54fb
--- /dev/null
+++ b/MANIFEST.mf
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Main-Class: com.facebook.ktfmt.cli.Main
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..187a3a7
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,19 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update external/ktfmt
+# For more info, check https://cs.android.com/android/platform/superproject/main/+/main:tools/external_updater/README.md
+
+name: "ktfmt"
+description: "A formatter for Kotlin code."
+third_party {
+  license_type: NOTICE
+  last_upgrade_date {
+    year: 2025
+    month: 3
+    day: 12
+  }
+  identifier {
+    type: "Git"
+    value: "https://github.com/facebookincubator/ktfmt.git"
+    version: "v0.54"
+  }
+}
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_APACHE2
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..58e3bb2
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,3 @@
[email protected]
[email protected]
+include platform/system/core:/janitors/OWNERS #{LAST_RESORT_SUGGESTION}
diff --git a/ktfmt.sh b/ktfmt.sh
new file mode 100755
index 0000000..619fd7f
--- /dev/null
+++ b/ktfmt.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+java -jar `dirname $0`/../../prebuilts/build-tools/common/framework/ktfmt.jar $@