Skip to content

Commit

Permalink
fix(acij): make the android module compatible with AGP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiSF committed Oct 20, 2023
1 parent 1497592 commit 5b5391f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
14 changes: 14 additions & 0 deletions packages/amazon-cognito-identity-js/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import com.android.Version

def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
def androidManifestPath = agpVersion >= 7 ? 'src/main/AndroidManifest.xml' : 'src/hasNamespace/AndroidManifest.xml'

buildscript {
repositories {
mavenCentral()
Expand All @@ -15,6 +20,10 @@ def safeExtGet(prop, fallback) {
}

android {
if (agpVersion >= 7) {
namespace "com.amazonaws"
}

compileSdkVersion safeExtGet('compileSdkVersion', 26)
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')

Expand All @@ -24,6 +33,11 @@ android {
versionCode 1
versionName "1.0"
}
sourceSets {
main {
manifest.srcFile androidManifestPath
}
}
lintOptions {
abortOnError false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws">

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>

0 comments on commit 5b5391f

Please sign in to comment.