Skip to content

Commit

Permalink
Migrate from AndroidManifest to build.gradle for namespace
Browse files Browse the repository at this point in the history
AGP has deprecated use of packageName in AndroidManifest and
instead wants everyone to use `android { namespace = "foo" }`
in build.gradle files.

Test: ./gradlew tasks -> still passes
Change-Id: I4fa03cacc7214011f3797c36dcb76c2984c7bf52
  • Loading branch information
liutikas committed Mar 16, 2022
1 parent fbb17f3 commit dcfa035
Show file tree
Hide file tree
Showing 1,196 changed files with 1,854 additions and 1,190 deletions.
4 changes: 4 additions & 0 deletions activity/activity-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ androidx {
description = "Compose integration with Activity"
runApiTasks = new RunApiTasks.Yes()
}

android {
namespace "androidx.activity.compose"
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ androidx {
inceptionYear = "2020"
description = "This is a project for Activity demos."
}

android {
namespace "androidx.activity.compose.demos"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
limitations under the License.
-->

<manifest package="androidx.activity.compose.demos" />
<manifest />
4 changes: 4 additions & 0 deletions activity/activity-compose/samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ androidx {
inceptionYear = "2020"
description = "Samples for Compose integration with Activity"
}

android {
namespace "androidx.activity.compose.samples"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
limitations under the License.
-->

<manifest package="androidx.activity.compose.samples" />
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.activity.compose" />
<manifest />
2 changes: 1 addition & 1 deletion activity/activity-compose/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.activity.compose" />
<manifest />
4 changes: 4 additions & 0 deletions activity/activity-ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ androidx {
description = "Kotlin extensions for 'activity' artifact"
}

android {
namespace "androidx.activity.ktx"
}

// needed only while https://youtrack.jetbrains.com/issue/KT-47000 isn't resolved which is
// targeted to 1.6
tasks.withType(KotlinCompile).configureEach {
Expand Down
3 changes: 1 addition & 2 deletions activity/activity-ktx/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.activity.ktx">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity
android:name="androidx.activity.ActivityViewModelLazyTest$TestActivity"
Expand Down
2 changes: 1 addition & 1 deletion activity/activity-ktx/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.activity.ktx"/>
<manifest />
1 change: 1 addition & 0 deletions activity/activity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ android {
multiDexEnabled true
testInstrumentationRunnerArgument "listener", "leakcanary.FailTestOnLeakRunListener"
}
namespace "androidx.activity"
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions activity/activity/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.activity.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application android:name="androidx.activity.LeakCanaryApp">
<activity
Expand Down
2 changes: 1 addition & 1 deletion activity/activity/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.activity">
<manifest>
</manifest>
1 change: 1 addition & 0 deletions activity/integration-tests/testapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ android {

applicationId "androidx.activity.integration.testapp"
}
namespace "androidx.activity.integration.testapp"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest package="androidx.activity.integration.testapp.test">
<manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.activity.integration.testapp">
xmlns:tools="http://schemas.android.com/tools">

<application tools:ignore="AllowBackup,GoogleAppIndexingWarning,MissingApplicationIcon">
<activity
Expand Down
4 changes: 4 additions & 0 deletions ads/ads-identifier-benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ dependencies {
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy)
}

android {
namespace "androidx.ads.identifier.benchmark"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
~ limitations under the License.
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.ads.identifier.benchmark.test">
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:name="androidx.ads.identifier.benchmark.AdsIdentifierBenchmarkApplication">
<!-- enable profiling by shell for non-intrusive profiling tools -->
Expand Down
2 changes: 1 addition & 1 deletion ads/ads-identifier-benchmark/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
~ limitations under the License.
-->

<manifest package="androidx.ads.identifier.benchmark" />
<manifest />
1 change: 1 addition & 0 deletions ads/ads-identifier-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ android {
aidl = true
}
testOptions.unitTests.includeAndroidResources = true
namespace "androidx.ads.identifier.common"
}

androidx {
Expand Down
3 changes: 1 addition & 2 deletions ads/ads-identifier-common/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.ads.identifier.common"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
4 changes: 4 additions & 0 deletions ads/ads-identifier-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ androidx {
inceptionYear = "2019"
description = "AndroidX Ads Identifier Provider"
}

android {
namespace "androidx.ads.identifier.provider"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ android {
applicationId "androidx.ads.identifier.provider.testapp"
minSdkVersion 14
}
namespace "androidx.ads.identifier.provider.testapp"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.ads.identifier.provider.testapp">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".AdsIdentifierProviderApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
limitations under the License
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.ads.identifier.provider.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
3 changes: 1 addition & 2 deletions ads/ads-identifier-provider/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.ads.identifier.provider">
xmlns:tools="http://schemas.android.com/tools">

<application>
<service
Expand Down
1 change: 1 addition & 0 deletions ads/ads-identifier-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ android {
lintOptions {
disable "InvalidPackage" // Lint is unhappy about mockito package
}
namespace "androidx.ads.identifier.testing"
}

androidx {
Expand Down
2 changes: 1 addition & 1 deletion ads/ads-identifier-testing/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
~ limitations under the License.
-->

<manifest package="androidx.ads.identifier.testing" />
<manifest />
4 changes: 4 additions & 0 deletions ads/ads-identifier/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ androidx {
inceptionYear = "2019"
description = "AndroidX Ads Identifier"
}

android {
namespace "androidx.ads.identifier"
}
1 change: 1 addition & 0 deletions ads/ads-identifier/integration-tests/testapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ android {
applicationId "androidx.ads.identifier.testapp"
minSdkVersion 14
}
namespace "androidx.ads.identifier.testapp"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.ads.identifier.testapp">
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="false"
Expand Down
3 changes: 1 addition & 2 deletions ads/ads-identifier/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.ads.identifier.test">
xmlns:tools="http://schemas.android.com/tools">

<application>
<service
Expand Down
3 changes: 1 addition & 2 deletions ads/ads-identifier/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.ads.identifier"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
4 changes: 4 additions & 0 deletions annotation/annotation-experimental/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ androidx {
"conjunction with the Experimental annotation lint checks, this annotation provides " +
"functional parity with Kotlin's Experimental annotation."
}

android {
namespace "androidx.annotation.experimental"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.annotation.experimental" />
<manifest />
4 changes: 4 additions & 0 deletions appcompat/appcompat-benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ dependencies {
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.kotlinStdlib)
}

android {
namespace "androidx.appcompat.benchmark"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
~ limitations under the License.
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.appcompat.benchmark.test">
xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
Expand Down
3 changes: 1 addition & 2 deletions appcompat/appcompat-benchmark/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.appcompat.benchmark"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
1 change: 1 addition & 0 deletions appcompat/appcompat-resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ android {
additionalParameters "--no-version-vectors"
noCompress "ttf"
}
namespace "androidx.appcompat.resources"
}

androidx {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.appcompat.resources.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:theme="@android:style/Theme">
Expand Down
2 changes: 1 addition & 1 deletion appcompat/appcompat-resources/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.appcompat.resources"/>
<manifest />
1 change: 1 addition & 0 deletions appcompat/appcompat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ android {
useLibrary "android.test.runner"
useLibrary "android.test.base"
useLibrary "android.test.mock"
namespace "androidx.appcompat"
}

androidx {
Expand Down
3 changes: 1 addition & 2 deletions appcompat/appcompat/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.appcompat.test">
xmlns:tools="http://schemas.android.com/tools">

<uses-sdk
android:minSdkVersion="14"
Expand Down
2 changes: 1 addition & 1 deletion appcompat/appcompat/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="androidx.appcompat"/>
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ android {
defaultConfig {
minSdkVersion 21
}
namespace "androidx.appcompat.demo.receivecontent"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.appcompat.demo.receivecontent">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
4 changes: 4 additions & 0 deletions appsearch/appsearch-builtin-types/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ androidx {
'apps, as well as structured parameters for semantic intents should use these ' +
'built-in types as appropriate.'
}

android {
namespace "androidx.appsearch.builtintypes"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
limitations under the License
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.appsearch.builtintypes.test"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
limitations under the License.
-->

<manifest package="androidx.appsearch.builtintypes"/>
<manifest />
Loading

0 comments on commit dcfa035

Please sign in to comment.