forked from thomas-bouvier/persistent-cookie-jar-okhttp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Datastore kotlin new implementation (#1)
- Adjustments to make the Library non-blocking - Adjusting Build mechanism & Repository Publication
- Loading branch information
1 parent
10b8934
commit a6341b4
Showing
46 changed files
with
1,693 additions
and
1,274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "Configure Cache" | ||
description: "Download dependencies and save required cache" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Make gradle executable | ||
shell: bash | ||
run: chmod +x ./gradlew | ||
|
||
- name: Download Depdendencies | ||
shell: bash | ||
env: | ||
GRADLE_OPTS: "-Xms1g -Xmx4608M -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.daemon=false -Dorg.gradle.caching=false -Dorg.gradle.configureondemand=true -Dfile.encoding=UTF-8 -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false" | ||
run: | | ||
./gradlew dependencies persistent-cookie-jar-okhttp:dependencies persistent-cookie-jar-okhttp:androidDependencies --no-parallel --no-daemon --max-workers 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Development build | ||
|
||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/config-action | ||
|
||
- name: Run Unit Tests | ||
run: ./gradlew persistent-cookie-jar-okhttp:test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: Publish persistent-cookie-jar-okhttp Library | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v**' | ||
env: | ||
REPO_PUBLISH_URL: ${{ secrets.REPO_PUBLISH_URL }} | ||
REPO_PUBLISH_USERID: ${{ secrets.REPO_PUBLISH_USERID }} | ||
REPO_PUBLISH_PW: ${{ secrets.REPO_PUBLISH_PW }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/config-action | ||
|
||
- name: Run Unit Tests | ||
run: ./gradlew persistent-cookie-jar-okhttp:test | ||
|
||
- name: Publish Library | ||
run: ./gradlew --stacktrace -PrepoPublishURL=$REPO_PUBLISH_URL -PrepoPublishUsername=$REPO_PUBLISH_USERID -PrepoPublishPassword=$REPO_PUBLISH_PW clean persistent-cookie-jar-okhttp:assembleRelease publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
plugins { | ||
alias(libs.plugins.androidLib) apply false | ||
alias(libs.plugins.jetbrainsKotlinAndroid) apply false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxPermSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true | ||
# org.gradle.parallel=true | ||
android.useAndroidX=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[versions] | ||
agp = "8.3.0" | ||
kotlin = "1.9.10" | ||
coreKtx = "1.12.0" | ||
junit = "4.13.2" | ||
junitVersion = "1.1.5" | ||
espressoCore = "3.5.1" | ||
appcompat = "1.6.1" | ||
material = "1.11.0" | ||
okHttp = "4.12.0" | ||
datastore = "1.0.0" | ||
testCoreKtx = "1.5.0" | ||
robolectric = "4.7.3" | ||
mockito = "5.11.0" | ||
mockitoKotlin = "5.2.1" | ||
coroutinesTest = "1.8.0" | ||
|
||
[libraries] | ||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } | ||
junit = { group = "junit", name = "junit", version.ref = "junit" } | ||
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } | ||
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } | ||
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } | ||
material = { group = "com.google.android.material", name = "material", version.ref = "material" } | ||
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okHttp" } | ||
androidx-datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore" } | ||
androidx-test-core-ktx = { group = "androidx.test", name = "core-ktx", version.ref = "testCoreKtx" } | ||
robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" } | ||
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" } | ||
mockito-kotlin = { group = "org.mockito.kotlin", name = "mockito-kotlin", version.ref = "mockitoKotlin" } | ||
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutinesTest" } | ||
|
||
[plugins] | ||
androidLib = { id = "com.android.library", version.ref = "agp" } | ||
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Nov 12 21:26:03 CET 2019 | ||
#Fri Mar 08 09:52:39 CET 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
plugins { | ||
alias(libs.plugins.androidLib) | ||
alias(libs.plugins.jetbrainsKotlinAndroid) | ||
`maven-publish` | ||
} | ||
|
||
group = "tv.pluto.android.libs" | ||
version = "1.0.2-beta01-2024.03.19" | ||
|
||
android { | ||
namespace = "com.andreuzaitsev.persistentcookiejar" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 21 | ||
} | ||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
} | ||
|
||
|
||
dependencies { | ||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.androidx.appcompat) | ||
implementation(libs.androidx.datastore.preferences) | ||
implementation(libs.material) | ||
implementation(libs.okhttp) | ||
testImplementation(libs.mockito) | ||
testImplementation(libs.mockito.kotlin) | ||
testImplementation(libs.robolectric) | ||
testImplementation(libs.junit) | ||
testImplementation(libs.androidx.test.core.ktx) | ||
testImplementation(libs.kotlinx.coroutines.test) | ||
androidTestImplementation(libs.androidx.junit) | ||
androidTestImplementation(libs.androidx.espresso.core) | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
// These values are provided by the CI environment, args are retrieved from the command line. | ||
val repoPublishURL: String? by project | ||
val repoPublishUsername: String? by project | ||
val repoPublishPassword: String? by project | ||
|
||
repositories { | ||
maven { | ||
url = uri(repoPublishURL ?: "") | ||
credentials { | ||
username = repoPublishUsername | ||
password = repoPublishPassword | ||
} | ||
} | ||
} | ||
publications { | ||
publications.register<MavenPublication>("release") { | ||
// Provide artifacts information requited by Maven Central | ||
pom { | ||
name.set("Custom persistent-cookie-jar-okhttp Library") | ||
description.set( | ||
"Custom version of persistent-cookie-jar-okhttp Library" | ||
) | ||
url.set("https://github.com/Pluto-tv/persistent-cookie-jar-okhttp") | ||
|
||
developers { | ||
developer { | ||
id.set("Pluto TV") | ||
name.set("Android Team (MH)") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/Pluto-tv/persistent-cookie-jar-okhttp") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
...ar-okhttp/src/androidTest/java/com/thomasbouvier/persistentcookiejar/ApplicationTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.