AW: gradle file to build boundary interfaces as a jar in AndroidX

Build boundary interfaces as a jar using java-library plugin instead of
"com.android.library" plugin. This makes it simpler and easier to embed
the compiled jar in webkit AAR file without any dirty workarounds like
unzipping the AAR or accessing intermediates build files.

Removing AndroidManifest.xml file since it's no longer needed by android
library plugin.

Bug: https://issuetracker.google.com/issues/142394338
Bug: https://issuetracker.google.com/issues/140178227
Test: manually cherry-pick change to //external and run gradlew :webkit:assembleRelease and gradlew :webview-support-interfaces:assembleRelease
Change-Id: I1df2f04bb737c1f376d7d1a70c6c5d0664e2f39c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859990
Reviewed-by: Aurimas Liutikas <aurimas@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Hazem Ashmawy <hazems@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#706177}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e52d53222dc0ad97b333470a88e6dc9d641d6ffb
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
deleted file mode 100644
index b11a3e8..0000000
--- a/AndroidManifest.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.chromium.support_lib_boundary">
-  <!-- This AndroidManifest file only exists to provide package name needed by
-       gradle script to build these interfaces as part of AndroidX. -->
-</manifest>
diff --git a/build.gradle b/build.gradle
index 6bf1a27..4fbc108 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,27 +5,21 @@
 // This file is to build WebView boundary interfaces as part of the AndroidX webkit library.
 // It is not meant to be used or build any targets in chromium project.
 
+import androidx.build.SdkHelperKt
 import androidx.build.SupportConfig
 
 plugins {
-    id('AndroidXPlugin')
-    id('com.android.library')
+    id('java-library')
 }
 
 dependencies {
     api("androidx.annotation:annotation:1.1.0")
+    implementation fileTree(dir: "${SdkHelperKt.getSdkPath(project.rootDir)}/platforms/$SupportConfig.COMPILE_SDK_VERSION/",
+            include: "android.jar")
 }
 
-android {
-    // COMPILE_SDK_VERSION provided by AndroidX build scripts to build all AndroidX modules.
-    compileSdkVersion SupportConfig.COMPILE_SDK_VERSION
-
-    sourceSets {
-        main.manifest.srcFile 'AndroidManifest.xml'
-        main.java.srcDirs += ['src']
-    }
-
-    buildTypes.all {
-        consumerProguardFiles 'proguard.flags'
+sourceSets {
+    main {
+        java.srcDirs = ['src']
     }
 }