Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade okhttp in android sdk #750

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions templates/android/library/build.gradle.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ ext {
version PUBLISH_VERSION

android {
compileSdkVersion(33)
compileSdkVersion(34)

defaultConfig {
minSdkVersion(21)
targetSdkVersion(33)
targetSdkVersion(34)
versionCode = 1
versionName = "1.0"
buildConfigField "String", "SDK_VERSION", "\"${PUBLISH_VERSION}\""
Expand Down Expand Up @@ -57,7 +57,7 @@ dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1")

api(platform("com.squareup.okhttp3:okhttp-bom:4.10.0"))
api(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
api("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:okhttp-urlconnection")
implementation("com.squareup.okhttp3:logging-interceptor")
Expand All @@ -77,4 +77,4 @@ dependencies {
testApi("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1")
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
36 changes: 36 additions & 0 deletions tests/Android14Java11Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Tests;

class Android14Java11Test extends Base
{
protected string $sdkName = 'android';
protected string $sdkPlatform = 'client';
protected string $sdkLanguage = 'android';
protected string $version = '0.0.1';

protected string $language = 'android';
protected string $class = 'Appwrite\SDK\Language\Android';
protected array $build = [
'mkdir -p tests/sdks/android/library/src/test/java',
'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt',
'chmod +x tests/sdks/android/gradlew',
];
protected string $command =
'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/android alvrme/alpine-android:android-34-jdk11 sh -c "./gradlew :library:testReleaseUnitTest --stacktrace -q && cat library/result.txt"';

protected array $expectedOutput = [
...Base::FOO_RESPONSES,
...Base::BAR_RESPONSES,
...Base::GENERAL_RESPONSES,
...Base::LARGE_FILE_RESPONSES,
...Base::LARGE_FILE_RESPONSES,
...Base::LARGE_FILE_RESPONSES,
...Base::EXCEPTION_RESPONSES,
...Base::REALTIME_RESPONSES,
// ...Base::COOKIE_RESPONSES,
...Base::QUERY_HELPER_RESPONSES,
...Base::PERMISSION_HELPER_RESPONSES,
...Base::ID_HELPER_RESPONSES
];
}
36 changes: 36 additions & 0 deletions tests/Android14Java8Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Tests;

class Android14Java8Test extends Base
{
protected string $sdkName = 'android';
protected string $sdkPlatform = 'client';
protected string $sdkLanguage = 'android';
protected string $version = '0.0.1';

protected string $language = 'android';
protected string $class = 'Appwrite\SDK\Language\Android';
protected array $build = [
'mkdir -p tests/sdks/android/library/src/test/java',
'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt',
'chmod +x tests/sdks/android/gradlew',
];
protected string $command =
'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/android alvrme/alpine-android:android-34-jdk8 sh -c "./gradlew :library:testReleaseUnitTest --stacktrace -q && cat library/result.txt"';

protected array $expectedOutput = [
...Base::FOO_RESPONSES,
...Base::BAR_RESPONSES,
...Base::GENERAL_RESPONSES,
...Base::LARGE_FILE_RESPONSES,
...Base::LARGE_FILE_RESPONSES,
...Base::LARGE_FILE_RESPONSES,
...Base::EXCEPTION_RESPONSES,
...Base::REALTIME_RESPONSES,
// ...Base::COOKIE_RESPONSES,
...Base::QUERY_HELPER_RESPONSES,
...Base::PERMISSION_HELPER_RESPONSES,
...Base::ID_HELPER_RESPONSES
];
}
Loading