Renamed build provider to apk provider

Test: ./gradlew :benchmark:integration-tests:baselineprofiles-library-consumer:testBaselineProfilesGeneration :benchmark:integration-tests:baselineprofiles-flavor-consumer:testBaselineProfilesGeneration :benchmark:integration-tests:baselineprofiles-consumer:testBaselineProfilesGeneration :benchmark:benchmark-baseline-profiles-gradle-plugin:test
Fixes: 265438721
Change-Id: I7595b50ee5d809ae85bc6e51416f3ca255547d75
diff --git a/benchmark/baseline-profiles-gradle-plugin/build.gradle b/benchmark/baseline-profiles-gradle-plugin/build.gradle
index a3cfd33..e766a55 100644
--- a/benchmark/baseline-profiles-gradle-plugin/build.gradle
+++ b/benchmark/baseline-profiles-gradle-plugin/build.gradle
@@ -49,9 +49,9 @@
             id = "androidx.baselineprofiles.consumer"
             implementationClass = "androidx.baselineprofiles.gradle.consumer.BaselineProfilesConsumerPlugin"
         }
-        baselineProfilesBuildProvider {
-            id = "androidx.baselineprofiles.buildprovider"
-            implementationClass = "androidx.baselineprofiles.gradle.buildprovider.BaselineProfilesBuildProviderPlugin"
+        baselineProfilesApkProvider {
+            id = "androidx.baselineprofiles.apkprovider"
+            implementationClass = "androidx.baselineprofiles.gradle.apkprovider.BaselineProfilesApkProviderPlugin"
         }
     }
 }
diff --git a/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/buildprovider/BaselineProfilesBuildProviderPlugin.kt b/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/apkprovider/BaselineProfilesApkProviderPlugin.kt
similarity index 86%
rename from benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/buildprovider/BaselineProfilesBuildProviderPlugin.kt
rename to benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/apkprovider/BaselineProfilesApkProviderPlugin.kt
index 2abd6ef..4d3c2ac 100644
--- a/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/buildprovider/BaselineProfilesBuildProviderPlugin.kt
+++ b/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/apkprovider/BaselineProfilesApkProviderPlugin.kt
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The Android Open Source Project
+ * Copyright 2023 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.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package androidx.baselineprofiles.gradle.buildprovider
+package androidx.baselineprofiles.gradle.apkprovider
 
 import androidx.baselineprofiles.gradle.utils.checkAgpVersion
 import androidx.baselineprofiles.gradle.utils.createNonObfuscatedBuildTypes
@@ -24,15 +24,13 @@
 import org.gradle.api.Project
 
 /**
- * This is the build provider plugin for baseline profile generation. In order to generate baseline
+ * This is the apk provider plugin for baseline profile generation. In order to generate baseline
  * profiles three plugins are needed: one is applied to the app or the library that should consume
  * the baseline profile when building (consumer), one is applied to the project that should supply
- * the test apk (build provider) and the last one is applied to a test module containing the ui
+ * the test apk (apk provider) and the last one is applied to a test module containing the ui
  * test that generate the baseline profile on the device (producer).
- *
- * TODO (b/265438721): build provider should be changed to apk provider.
  */
-class BaselineProfilesBuildProviderPlugin : Plugin<Project> {
+class BaselineProfilesApkProviderPlugin : Plugin<Project> {
 
     override fun apply(project: Project) {
         var foundAppPlugin = false
@@ -58,7 +56,7 @@
                         if (!foundLibraryPlugin) {
                             """
                     The module ${project.name} does not have the `com.android.application` plugin
-                    applied. The `androidx.baselineprofiles.buildprovider` plugin supports only
+                    applied. The `androidx.baselineprofiles.apkprovider` plugin supports only
                     android application modules. Please review your build.gradle to ensure this
                     plugin is applied to the correct module.
                     """.trimIndent()
@@ -67,7 +65,7 @@
                     The module ${project.name} does not have the `com.android.application` plugin
                     but has the `com.android.library` plugin. If you're trying to generate a
                     baseline profile for a library, you'll need to apply the
-                    `androidx.baselineprofiles.buildprovider` to an android application that
+                    `androidx.baselineprofiles.apkprovider` to an android application that
                     has the `com.android.application` plugin applied. This should be a sample app
                     running the code of the library for which you want to generate the profile.
                     Please review your build.gradle to ensure this plugin is applied to the
@@ -78,7 +76,7 @@
                 }
                 project.logger.debug(
                     """
-                    [BaselineProfilesBuildProviderPlugin] afterEvaluate check: app plugin was applied
+                    [BaselineProfilesApkProviderPlugin] afterEvaluate check: app plugin was applied
                     """.trimIndent()
                 )
             }
diff --git a/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/consumer/BaselineProfilesConsumerPlugin.kt b/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/consumer/BaselineProfilesConsumerPlugin.kt
index 7e94208..b931899 100644
--- a/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/consumer/BaselineProfilesConsumerPlugin.kt
+++ b/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/consumer/BaselineProfilesConsumerPlugin.kt
@@ -42,7 +42,7 @@
  * This is the consumer plugin for baseline profile generation. In order to generate baseline
  * profiles three plugins are needed: one is applied to the app or the library that should consume
  * the baseline profile when building (consumer), one is applied to the project that should supply
- * the apk under test (build provider) and the last one is applied to a test module containing
+ * the apk under test (apk provider) and the last one is applied to a test module containing
  * the ui test that generate the baseline profile on the device (producer).
  */
 class BaselineProfilesConsumerPlugin : Plugin<Project> {
diff --git a/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPlugin.kt b/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPlugin.kt
index de80cf5..e4dd2f0 100644
--- a/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPlugin.kt
+++ b/benchmark/baseline-profiles-gradle-plugin/src/main/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPlugin.kt
@@ -40,7 +40,7 @@
  * This is the producer plugin for baseline profile generation. In order to generate baseline
  * profiles three plugins are needed: one is applied to the app or the library that should consume
  * the baseline profile when building (consumer), one is applied to the project that should supply
- * the apk under test (build provider) and the last one is applied to a test module containing
+ * the apk under test (apk provider) and the last one is applied to a test module containing
  * the ui test that generate the baseline profile on the device (producer).
  */
 class BaselineProfilesProducerPlugin : Plugin<Project> {
@@ -93,7 +93,7 @@
         val testExtension = project.extensions.getByType(TestExtension::class.java)
         testExtension.experimentalProperties["android.experimental.self-instrumenting"] = true
 
-        // Creates the new build types to match the build provider. Note that release does not
+        // Creates the new build types to match the apk provider. Note that release does not
         // exist by default so we need to create nonMinifiedRelease and map it manually to
         // `release`. All the existing build types beside `debug`, that is the default one, are
         // added manually in the configuration so we can assume they've been added for the purpose
diff --git a/benchmark/baseline-profiles-gradle-plugin/src/main/resources/META-INF/gradle-plugins/androidx.baselineprofiles.buildprovider.gradle.properties b/benchmark/baseline-profiles-gradle-plugin/src/main/resources/META-INF/gradle-plugins/androidx.baselineprofiles.apkprovider.gradle.properties
similarity index 85%
rename from benchmark/baseline-profiles-gradle-plugin/src/main/resources/META-INF/gradle-plugins/androidx.baselineprofiles.buildprovider.gradle.properties
rename to benchmark/baseline-profiles-gradle-plugin/src/main/resources/META-INF/gradle-plugins/androidx.baselineprofiles.apkprovider.gradle.properties
index 863bea9..ff2c758 100644
--- a/benchmark/baseline-profiles-gradle-plugin/src/main/resources/META-INF/gradle-plugins/androidx.baselineprofiles.buildprovider.gradle.properties
+++ b/benchmark/baseline-profiles-gradle-plugin/src/main/resources/META-INF/gradle-plugins/androidx.baselineprofiles.apkprovider.gradle.properties
@@ -13,4 +13,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-implementation-class=androidx.baselineprofiles.gradle.buildprovider.BaselineProfilesBuildProviderPlugin
+implementation-class=androidx.baselineprofiles.gradle.apkprovider.BaselineProfilesApkProviderPlugin
diff --git a/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/buildprovider/BaselineProfilesBuildProviderPluginTest.kt b/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/apkprovider/BaselineProfilesApkProviderPluginTest.kt
similarity index 89%
rename from benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/buildprovider/BaselineProfilesBuildProviderPluginTest.kt
rename to benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/apkprovider/BaselineProfilesApkProviderPluginTest.kt
index df3ffc6..78ef80f 100644
--- a/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/buildprovider/BaselineProfilesBuildProviderPluginTest.kt
+++ b/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/apkprovider/BaselineProfilesApkProviderPluginTest.kt
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The Android Open Source Project
+ * Copyright 2023 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.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package androidx.baselineprofiles.gradle.buildprovider
+package androidx.baselineprofiles.gradle.apkprovider
 
 import androidx.testutils.gradle.ProjectSetupRule
 import com.google.common.truth.Truth.assertThat
@@ -26,7 +26,7 @@
 import org.junit.runners.JUnit4
 
 @RunWith(JUnit4::class)
-class BaselineProfilesBuildProviderPluginTest {
+class BaselineProfilesApkProviderPluginTest {
 
     @get:Rule
     val projectSetup = ProjectSetupRule()
@@ -46,7 +46,7 @@
             prefix = """
                 plugins {
                     id("com.android.application")
-                    id("androidx.baselineprofiles.buildprovider")
+                    id("androidx.baselineprofiles.apkprovider")
                 }
                 android {
                     namespace 'com.example.namespace'
diff --git a/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPluginTest.kt b/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPluginTest.kt
index 0e8a36f..c7e5fc3 100644
--- a/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPluginTest.kt
+++ b/benchmark/baseline-profiles-gradle-plugin/src/test/kotlin/androidx/baselineprofiles/gradle/producer/BaselineProfilesProducerPluginTest.kt
@@ -38,21 +38,21 @@
     val producerProjectSetup = ProjectSetupRule(rootFolder.root)
 
     @get:Rule
-    val buildProviderProjectSetup = ProjectSetupRule(rootFolder.root)
+    val apkProviderProjectSetup = ProjectSetupRule(rootFolder.root)
 
     private lateinit var producerModuleName: String
-    private lateinit var buildProviderModuleName: String
+    private lateinit var apkProviderModuleName: String
     private lateinit var gradleRunner: GradleRunner
 
     @Before
     fun setUp() {
         producerModuleName = producerProjectSetup.rootDir.relativeTo(rootFolder.root).name
-        buildProviderModuleName = buildProviderProjectSetup.rootDir.relativeTo(rootFolder.root).name
+        apkProviderModuleName = apkProviderProjectSetup.rootDir.relativeTo(rootFolder.root).name
 
         rootFolder.newFile("settings.gradle").writeText(
             """
             include '$producerModuleName'
-            include '$buildProviderModuleName'
+            include '$apkProviderModuleName'
         """.trimIndent()
         )
         gradleRunner = GradleRunner.create()
@@ -62,11 +62,11 @@
 
     @Test
     fun verifyTasksWithAndroidTestPlugin() {
-        buildProviderProjectSetup.writeDefaultBuildGradle(
+        apkProviderProjectSetup.writeDefaultBuildGradle(
             prefix = """
                 plugins {
                     id("com.android.application")
-                    id("androidx.baselineprofiles.buildprovider")
+                    id("androidx.baselineprofiles.apkprovider")
                 }
                 android {
                     namespace 'com.example.namespace'
@@ -81,7 +81,7 @@
                     id("androidx.baselineprofiles.producer")
                 }
                 android {
-                    targetProjectPath = ":$buildProviderModuleName"
+                    targetProjectPath = ":$apkProviderModuleName"
                     namespace 'com.example.namespace.test'
                 }
                 tasks.register("mergeNonMinifiedReleaseTestResultProtos") { println("Stub") }
diff --git a/benchmark/integration-tests/baselineprofiles-consumer/build.gradle b/benchmark/integration-tests/baselineprofiles-consumer/build.gradle
index 81fb569..5c551cd 100644
--- a/benchmark/integration-tests/baselineprofiles-consumer/build.gradle
+++ b/benchmark/integration-tests/baselineprofiles-consumer/build.gradle
@@ -19,7 +19,7 @@
     id("com.android.application")
     id("kotlin-android")
     id("androidx.baselineprofiles.consumer")
-    id("androidx.baselineprofiles.buildprovider")
+    id("androidx.baselineprofiles.apkprovider")
 }
 
 android {
diff --git a/benchmark/integration-tests/baselineprofiles-flavors-consumer/build.gradle b/benchmark/integration-tests/baselineprofiles-flavors-consumer/build.gradle
index 2caef026..283fc83 100644
--- a/benchmark/integration-tests/baselineprofiles-flavors-consumer/build.gradle
+++ b/benchmark/integration-tests/baselineprofiles-flavors-consumer/build.gradle
@@ -18,7 +18,7 @@
     id("AndroidXPlugin")
     id("com.android.application")
     id("kotlin-android")
-    id("androidx.baselineprofiles.buildprovider")
+    id("androidx.baselineprofiles.apkprovider")
     id("androidx.baselineprofiles.consumer")
 }
 
diff --git a/benchmark/integration-tests/baselineprofiles-library-build-provider/build.gradle b/benchmark/integration-tests/baselineprofiles-library-apk-provider/build.gradle
similarity index 94%
rename from benchmark/integration-tests/baselineprofiles-library-build-provider/build.gradle
rename to benchmark/integration-tests/baselineprofiles-library-apk-provider/build.gradle
index fc427b6..26e24c15 100644
--- a/benchmark/integration-tests/baselineprofiles-library-build-provider/build.gradle
+++ b/benchmark/integration-tests/baselineprofiles-library-apk-provider/build.gradle
@@ -18,7 +18,7 @@
     id("AndroidXPlugin")
     id("com.android.application")
     id("kotlin-android")
-    id("androidx.baselineprofiles.buildprovider")
+    id("androidx.baselineprofiles.apkprovider")
 }
 
 android {
@@ -29,7 +29,7 @@
             proguardFiles getDefaultProguardFile("proguard-android-optimize.txt")
         }
     }
-    namespace "androidx.benchmark.integration.baselineprofiles.library.buildprovider"
+    namespace "androidx.benchmark.integration.baselineprofiles.library.apkprovider"
 }
 
 dependencies {
diff --git a/benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/AndroidManifest.xml b/benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/AndroidManifest.xml
similarity index 100%
rename from benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/AndroidManifest.xml
rename to benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/AndroidManifest.xml
diff --git a/benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/java/androidx/benchmark/integration/baselineprofiles/library/buildprovider/EmptyActivity.kt b/benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/java/androidx/benchmark/integration/baselineprofiles/library/apkprovider/EmptyActivity.kt
similarity index 98%
rename from benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/java/androidx/benchmark/integration/baselineprofiles/library/buildprovider/EmptyActivity.kt
rename to benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/java/androidx/benchmark/integration/baselineprofiles/library/apkprovider/EmptyActivity.kt
index c73e6e5..61bd367 100644
--- a/benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/java/androidx/benchmark/integration/baselineprofiles/library/buildprovider/EmptyActivity.kt
+++ b/benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/java/androidx/benchmark/integration/baselineprofiles/library/apkprovider/EmptyActivity.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package androidx.benchmark.integration.baselineprofiles.library.buildprovider
+package androidx.benchmark.integration.baselineprofiles.library.apkprovider
 
 import android.app.Activity
 import android.os.Bundle
diff --git a/benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/res/layout/activity_main.xml b/benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/res/layout/activity_main.xml
similarity index 100%
rename from benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/res/layout/activity_main.xml
rename to benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/res/layout/activity_main.xml
diff --git a/benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/res/values/donottranslate-strings.xml b/benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/res/values/donottranslate-strings.xml
similarity index 100%
rename from benchmark/integration-tests/baselineprofiles-library-build-provider/src/main/res/values/donottranslate-strings.xml
rename to benchmark/integration-tests/baselineprofiles-library-apk-provider/src/main/res/values/donottranslate-strings.xml
diff --git a/benchmark/integration-tests/baselineprofiles-library-producer/build.gradle b/benchmark/integration-tests/baselineprofiles-library-producer/build.gradle
index 9aaaa2a0..6a23e89 100644
--- a/benchmark/integration-tests/baselineprofiles-library-producer/build.gradle
+++ b/benchmark/integration-tests/baselineprofiles-library-producer/build.gradle
@@ -35,7 +35,7 @@
             systemImageSource = "aosp"
         }
     }
-    targetProjectPath = ":benchmark:integration-tests:baselineprofiles-library-build-provider"
+    targetProjectPath = ":benchmark:integration-tests:baselineprofiles-library-apk-provider"
     namespace "androidx.benchmark.integration.baselineprofiles.library.producer"
 }
 
diff --git a/benchmark/integration-tests/baselineprofiles-library-producer/src/main/java/androidx/benchmark/integration/baselineprofiles/library/producer/BaselineProfileTest.kt b/benchmark/integration-tests/baselineprofiles-library-producer/src/main/java/androidx/benchmark/integration/baselineprofiles/library/producer/BaselineProfileTest.kt
index 1d5cdec..2e61dd1 100644
--- a/benchmark/integration-tests/baselineprofiles-library-producer/src/main/java/androidx/benchmark/integration/baselineprofiles/library/producer/BaselineProfileTest.kt
+++ b/benchmark/integration-tests/baselineprofiles-library-producer/src/main/java/androidx/benchmark/integration/baselineprofiles/library/producer/BaselineProfileTest.kt
@@ -49,7 +49,7 @@
 
     companion object {
         private const val PACKAGE_NAME =
-            "androidx.benchmark.integration.baselineprofiles.library.buildprovider"
+            "androidx.benchmark.integration.baselineprofiles.library.apkprovider"
         private const val ACTION =
             "androidx.benchmark.integration.baselineprofiles.EMPTY_ACTIVITY"
     }
diff --git a/buildSrc/public/build.gradle b/buildSrc/public/build.gradle
index 82cab6b..39216a7 100644
--- a/buildSrc/public/build.gradle
+++ b/buildSrc/public/build.gradle
@@ -52,9 +52,9 @@
             id = "androidx.baselineprofiles.consumer"
             implementationClass = "androidx.baselineprofiles.gradle.consumer.BaselineProfilesConsumerPlugin"
         }
-        baselineProfilesBuildProvider {
-            id = "androidx.baselineprofiles.buildprovider"
-            implementationClass = "androidx.baselineprofiles.gradle.buildprovider.BaselineProfilesBuildProviderPlugin"
+        baselineProfilesApkProvider {
+            id = "androidx.baselineprofiles.apkprovider"
+            implementationClass = "androidx.baselineprofiles.gradle.apkprovider.BaselineProfilesApkProviderPlugin"
         }
         inspection {
             id = "androidx.inspection"
diff --git a/settings.gradle b/settings.gradle
index 3cb42bb..a104e55 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -409,7 +409,7 @@
 includeProject(":benchmark:integration-tests:baselineprofiles-flavors-consumer", [BuildType.MAIN])
 includeProject(":benchmark:integration-tests:baselineprofiles-library-consumer", [BuildType.MAIN])
 includeProject(":benchmark:integration-tests:baselineprofiles-library-producer", [BuildType.MAIN])
-includeProject(":benchmark:integration-tests:baselineprofiles-library-build-provider", [BuildType.MAIN])
+includeProject(":benchmark:integration-tests:baselineprofiles-library-apk-provider", [BuildType.MAIN])
 includeProject(":benchmark:integration-tests:dry-run-benchmark", [BuildType.MAIN])
 includeProject(":benchmark:integration-tests:macrobenchmark", [BuildType.MAIN])
 includeProject(":benchmark:integration-tests:macrobenchmark-target", [BuildType.MAIN])