Skip to content

Commit

Permalink
chore: Upgrade to CompileSDK 34 (#2893)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcreaser authored Aug 14, 2024
1 parent 502bbd1 commit a8a5d86
Show file tree
Hide file tree
Showing 75 changed files with 215 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov_code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
with:
java-version: '11'
java-version: '17'
distribution: 'corretto'

- name: Run test and generate kover report
Expand Down
1 change: 1 addition & 0 deletions annotations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ apply(from = rootProject.file("configuration/publishing.gradle"))
group = properties["POM_GROUP"].toString()

android {
namespace = "com.amplifyframework.annotations"
kotlinOptions {
moduleName = "com.amplifyframework.annotations"
}
Expand Down
5 changes: 1 addition & 4 deletions annotations/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@
permissions and limitations under the License.
-->

<manifest package="com.amplifyframework.annotations"
xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

<manifest />
4 changes: 4 additions & 0 deletions aws-analytics-pinpoint/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ apply(from = rootProject.file("configuration/publishing.gradle"))

group = properties["POM_GROUP"].toString()

android {
namespace = "com.amplifyframework.analytics.pinpoint"
}

dependencies {
implementation(project(":core"))
implementation(project(":aws-core"))
Expand Down
2 changes: 1 addition & 1 deletion aws-analytics-pinpoint/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
permissions and limitations under the License.
-->

<manifest package="com.amplifyframework.analytics.pinpoint" />
<manifest />
4 changes: 4 additions & 0 deletions aws-api-appsync/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ apply(from = rootProject.file("configuration/publishing.gradle"))

group = properties["POM_GROUP"].toString()

android {
namespace = "com.amplifyframework.appsync"
}

dependencies {
implementation(project(":core"))
implementation(project(":aws-core"))
Expand Down
4 changes: 1 addition & 3 deletions aws-api-appsync/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@
permissions and limitations under the License.
-->

<manifest package="com.amplifyframework.appsync">
</manifest>

<manifest />
2 changes: 1 addition & 1 deletion aws-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply(from = rootProject.file("configuration/publishing.gradle"))
group = properties["POM_GROUP"].toString()

android {

namespace = "com.amplifyframework.api.aws"
defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 1 addition & 3 deletions aws-api/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
permissions and limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amplifyframework.api.aws">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

4 changes: 4 additions & 0 deletions aws-auth-cognito/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ apply(from = rootProject.file("configuration/checkstyle.gradle"))

group = properties["POM_GROUP"].toString()

android {
namespace = "com.amplifyframework.auth.cognito"
}

dependencies {
implementation(project(":core"))
implementation(project(":aws-core"))
Expand Down
3 changes: 1 addition & 2 deletions aws-auth-cognito/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
permissions and limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amplifyframework.auth.cognito">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<queries>
<intent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1541,10 +1541,12 @@ internal class RealAWSCognitoAuthPlugin(
getUserRequest
)
val userAttributes = buildList {
user?.userAttributes?.mapTo(this) {
AuthUserAttribute(
AuthUserAttributeKey.custom(it.name),
it.value
user?.userAttributes?.forEach {
add(
AuthUserAttribute(
AuthUserAttributeKey.custom(it.name),
it.value
)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ import io.mockk.mockkConstructor
import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.slot
import io.mockk.unmockkAll
import io.mockk.verify
import java.util.Date
import java.util.concurrent.CountDownLatch
Expand All @@ -116,6 +117,7 @@ import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
import org.json.JSONObject
import org.junit.After
import org.junit.Before
import org.junit.Test

Expand Down Expand Up @@ -200,6 +202,11 @@ class RealAWSCognitoAuthPluginTest {
)
}

@After
fun teardown() {
unmockkAll()
}

@Test
fun testSignUpFailsIfNotConfigured() {
// GIVEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ import kotlinx.coroutines.test.setMain
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner

@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
@RunWith(RobolectricTestRunner::class)
class ResetPasswordUseCaseTest {

private val dummyClientId = "app client id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
},
"api": {
"name": "fetchAuthSession",
"params": {
},
"params": {},
"options": {
"forceRefresh": true
}
Expand All @@ -58,10 +57,7 @@
"awsCredentialsResult": {
"accessKeyId": "someAccessKey",
"expiration": 2342134,
"expiresAt": {
"seconds": 2342134.0,
"nanos": 0.0
},
"expiresAt": {},
"secretAccessKey": "someSecretKey",
"sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDI0LCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.po__hnGh2KF0ibpp--a2YZA9oBAKXc9BkX1IwdhvJp8"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
"preConditions": {
"amplify-configuration": "authconfiguration.json",
"state": "SignedOut_IdentityPoolConfigured.json",
"mockedResponses": [
]
"mockedResponses": []
},
"api": {
"name": "fetchAuthSession",
"params": {
},
"options": {
}
"params": {},
"options": {}
},
"validations": [
{
Expand All @@ -23,10 +20,7 @@
"awsCredentialsResult": {
"accessKeyId": "someAccessKey",
"expiration": 2342134,
"expiresAt": {
"seconds": 2342134.0,
"nanos": 0.0
},
"expiresAt": {},
"secretAccessKey": "someSecretKey",
"sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
"preConditions": {
"amplify-configuration": "authconfiguration.json",
"state": "SignedIn_SessionEstablished.json",
"mockedResponses": [
]
"mockedResponses": []
},
"api": {
"name": "fetchAuthSession",
"params": {
},
"options": {
}
"params": {},
"options": {}
},
"validations": [
{
Expand All @@ -23,10 +20,7 @@
"awsCredentialsResult": {
"accessKeyId": "someAccessKey",
"expiration": 2342134,
"expiresAt": {
"seconds": 2342134.0,
"nanos": 0.0
},
"expiresAt": {},
"secretAccessKey": "someSecretKey",
"sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,10 @@
"value": "value"
}
],
"deviceCreateDate": {
"value": {
"seconds": 1.688674717E9,
"nanos": 2.73132E8
}
},
"deviceCreateDate": 1723480158,
"deviceKey": "deviceKey",
"deviceLastAuthenticatedDate": {
"value": {
"seconds": 1.688674717E9,
"nanos": 2.73136E8
}
},
"deviceLastModifiedDate": {
"value": {
"seconds": 1.688674717E9,
"nanos": 2.73137E8
}
}
"deviceLastAuthenticatedDate": 1723480158,
"deviceLastModifiedDate": 1723480158
}
]
}
Expand All @@ -44,10 +29,8 @@
},
"api": {
"name": "fetchDevices",
"params": {
},
"options": {
}
"params": {},
"options": {}
},
"validations": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,10 @@
"value": "value"
}
],
"deviceCreateDate": {
"value": {
"seconds": 1.688674717E9,
"nanos": 2.73132E8
}
},
"deviceCreateDate": 1723480158,
"deviceKey": "deviceKey",
"deviceLastAuthenticatedDate": {
"value": {
"seconds": 1.688674717E9,
"nanos": 2.73136E8
}
},
"deviceLastModifiedDate": {
"value": {
"seconds": 1.688674717E9,
"nanos": 2.73137E8
}
}
"deviceLastAuthenticatedDate": 1723480158,
"deviceLastModifiedDate": 1723480158
}
]
}
Expand All @@ -44,10 +29,8 @@
},
"api": {
"name": "fetchDevices",
"params": {
},
"options": {
}
"params": {},
"options": {}
},
"validations": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
"responseType": "failure",
"response": {
"errorType": "NotAuthorizedException",
"errorMessage": null
"errorMessage": "Error type: Client, Protocol response: (empty response)"
}
}
]
},
"api": {
"name": "signOut",
"params": {
},
"params": {},
"options": {
"globalSignOut": true
}
Expand All @@ -43,25 +42,16 @@
},
"hostedUIError": null,
"revokeTokenError": {
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU",
"exception": {
"errorType": "RevokeTokenException",
"errorMessage": "Failed to revoke token",
"recoverySuggestion": "See attached exception for more details. RevokeToken can be retried using the CognitoIdentityProviderClient accessible from the escape hatch.",
"detailMessage": "Failed to revoke token",
"cause": {
"detailMessage": "RevokeToken not attempted because GlobalSignOut failed.",
"stackTrace": [
],
"suppressedExceptions": [
]
},
"stackTrace": [
],
"suppressedExceptions": [
]
}
"cause": {}
},
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU"
},
"signedOutLocally": true
}
}
]
}
}
1 change: 1 addition & 0 deletions aws-auth-plugins-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ apply(from = rootProject.file("configuration/publishing.gradle"))
group = properties["POM_GROUP"].toString()

android {
namespace = "com.amplifyframework.plugins.core"
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
Expand Down
4 changes: 1 addition & 3 deletions aws-auth-plugins-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@
permissions and limitations under the License.
-->

<manifest package="com.amplifyframework.plugins.core"
xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
<manifest />
Loading

0 comments on commit a8a5d86

Please sign in to comment.