Skip to content

Commit

Permalink
Update Dependencies (#209)
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
  • Loading branch information
Skrilltrax committed Oct 27, 2023
1 parent 53006f0 commit 350e4b9
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 74 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/android_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Check codestyle
Expand All @@ -39,7 +39,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Run unit tests
Expand All @@ -66,7 +66,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Build debug APKs
Expand All @@ -86,7 +86,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Run Lint on debug variants
Expand All @@ -106,7 +106,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Generate coverage reports with kotlinx-kover
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/android_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Check codestyle
Expand All @@ -39,7 +39,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Run unit tests
Expand All @@ -66,7 +66,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Build debug APKs
Expand All @@ -86,7 +86,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Run Lint on debug variants
Expand All @@ -106,7 +106,7 @@ jobs:
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: '17'
java-version: '19'
cache: 'gradle'

- name: Generate coverage reports with kotlinx-kover
Expand Down
11 changes: 7 additions & 4 deletions build-logic/android-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ plugins { `kotlin-dsl` }

afterEvaluate {
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
sourceCompatibility = JavaVersion.VERSION_19.toString()
targetCompatibility = JavaVersion.VERSION_19.toString()
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() }
kotlinOptions { jvmTarget = JavaVersion.VERSION_19.toString() }
}
}

dependencies { implementation(libs.build.agp) }
dependencies {
implementation(libs.build.r8)
implementation(libs.build.agp)
}
7 changes: 7 additions & 0 deletions build-logic/android-plugins/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.getByType

internal val Project.libs: VersionCatalog
get() = extensions.getByType<VersionCatalogsExtension>().named("libs")
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ fun Project.isSnapshot(): Boolean {
}
}

@Suppress("UnstableApiUsage")
android {
val minifySwitch = project.providers.environmentVariable("DISABLE_MINIFY")

adbOptions.installOptions("--user 0")
adbOptions.setInstallOptions("--user 0")

buildFeatures { buildConfig = true }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import com.android.build.gradle.TestedExtension

extensions.configure<TestedExtension> {
setCompileSdkVersion(33)
setCompileSdkVersion(34)
defaultConfig {
minSdk = 23
targetSdk = 33
targetSdk = 34
}

sourceSets {
Expand All @@ -13,7 +13,6 @@ extensions.configure<TestedExtension> {
named("androidTest") { java.srcDirs("src/androidTest/kotlin") }
}

@Suppress("UnstableApiUsage")
packagingOptions {
resources.excludes.add("**/*.version")
resources.excludes.add("**/*.txt")
Expand All @@ -24,12 +23,15 @@ extensions.configure<TestedExtension> {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
}

testOptions {
animationsDisabled = true
unitTests.isReturnDefaultValues = true
}
}

dependencies { "coreLibraryDesugaring"(libs.findLibrary("build.corelibdesugar").get()) }
7 changes: 4 additions & 3 deletions build-logic/integration-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ plugins { `kotlin-dsl` }

afterEvaluate {
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
sourceCompatibility = JavaVersion.VERSION_19.toString()
targetCompatibility = JavaVersion.VERSION_19.toString()
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() }
kotlinOptions { jvmTarget = JavaVersion.VERSION_19.toString() }
}
}

dependencies {
implementation(libs.build.kotlin)
implementation(libs.build.dependencyanalysis)
implementation(libs.build.apollo.graphql)
implementation(libs.build.anvil)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
plugins { id("com.apollographql.apollo3") }

apollo { packageName.set("dev.skrilltrax.baka.core.network") }
apollo {
packageName.set("dev.skrilltrax.baka.core.network")
service("service") { packageName.set("dev.skrilltrax.baka.core.network") }
}
6 changes: 3 additions & 3 deletions build-logic/kotlin-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ plugins { `kotlin-dsl` }

afterEvaluate {
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
sourceCompatibility = JavaVersion.VERSION_19.toString()
targetCompatibility = JavaVersion.VERSION_19.toString()
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() }
kotlinOptions { jvmTarget = JavaVersion.VERSION_19.toString() }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ val additionalCompilerArgs =
)

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
sourceCompatibility = JavaVersion.VERSION_19.toString()
targetCompatibility = JavaVersion.VERSION_19.toString()
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
allWarningsAsErrors = true
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_19.toString()
freeCompilerArgs = freeCompilerArgs + additionalCompilerArgs
languageVersion = "1.6"
languageVersion = "1.9"
allWarningsAsErrors = false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ afterEvaluate {
}
}
// disable kapt tasks for unit tests
tasks.matching { it.name.startsWith("kapt") && it.name.endsWith("UnitTestKotlin") }.configureEach {
enabled = false
}
tasks
.matching { it.name.startsWith("kapt") && it.name.endsWith("UnitTestKotlin") }
.configureEach { enabled = false }

fun Project.hasDaggerCompilerDependency(): Boolean {
return configurations.any {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ tasks.withType<KotlinCompile>().configureEach {
}
}

tasks.koverXmlReport {
xmlReportFile.set(rootProject.layout.buildDirectory.file("coverage-reports/${project.name}.xml"))
}
extensions.configure<kotlinx.kover.gradle.plugin.dsl.KoverReportExtension> {
defaults {
// reports configs for XML, HTML, verify reports
html { setReportDir(rootProject.layout.buildDirectory.dir("coverage-reports/${project.name}")) }

tasks.koverHtmlReport {
htmlReportDir.set(rootProject.layout.buildDirectory.dir("coverage-reports/${project.name}"))
xml {
setReportFile(rootProject.layout.buildDirectory.file("coverage-reports/${project.name}.xml"))
}
}
}
1 change: 1 addition & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://storage.googleapis.com/r8-releases/raw/main")
}
versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import java.io.File
*
* Do NOT use the file outside of DataStore.
*
* @this the context of the application used to get the files directory
* @fileName the file name
* @this the context of the application used to get the files directory @fileName the file name
*/
public fun dataStoreFile(filesDir: String, fileName: String): File =
File(filesDir, "datastore/$fileName")
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,16 @@ import kotlinx.coroutines.SupervisorJob
* ```
*
* @param name The name of the preferences. The preferences will be stored in a file in the
* "datastore/" subdirectory in the application context's files directory and is generated using
* [preferencesDataStoreFile].
* "datastore/" subdirectory in the application context's files directory and is generated using
* [preferencesDataStoreFile].
* @param corruptionHandler The corruptionHandler is invoked if DataStore encounters a
* [androidx.datastore.core.CorruptionException] when attempting to read data. CorruptionExceptions
* are thrown by serializers when data can not be de-serialized.
* [androidx.datastore.core.CorruptionException] when attempting to read data.
* CorruptionExceptions are thrown by serializers when data can not be de-serialized.
* @param produceMigrations produce the migrations. The ApplicationContext is passed in to these
* callbacks as a parameter. DataMigrations are run before any access to data can occur. Each
* producer and migration may be run more than once whether or not it already succeeded (potentially
* because another migration failed or a write to disk failed.)
* callbacks as a parameter. DataMigrations are run before any access to data can occur. Each
* producer and migration may be run more than once whether or not it already succeeded
* (potentially because another migration failed or a write to disk failed.)
* @param scope The scope in which IO operations and transform functions will execute.
*
* @return a property delegate that manages a datastore as a singleton.
*/
@Suppress("MissingJvmstatic")
Expand Down Expand Up @@ -109,7 +108,9 @@ internal constructor(
corruptionHandler = corruptionHandler,
migrations = produceMigrations(),
scope = scope
) { preferencesDataStoreFile(filesDir, name) }
) {
preferencesDataStoreFile(filesDir, name)
}
}
INSTANCE!!
}
Expand Down
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
# Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
# SPDX-License-Identifier: GPL-3.0-only
#

# Enable experimental K2 compiler
#kotlin.experimental.tryK2=true

org.gradle.parallel=true
org.gradle.configureondemand=false
org.gradle.caching=true

# Enable configuration cache
org.gradle.unsafe.configuration-cache=false
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn

# Enable filesystem watching
Expand Down Expand Up @@ -47,7 +51,7 @@ android.enableResourceOptimizations=true
android.defaults.buildfeatures.buildconfig=false
android.defaults.buildfeatures.aidl=false
android.defaults.buildfeatures.renderscript=false
android.defaults.buildfeatures.resvalues=false
android.defaults.buildfeatures.resvalu`es=false
android.defaults.buildfeatures.shaders=false

# Disable warnings about unsupported features, we know what we're doing
Expand Down

0 comments on commit 350e4b9

Please sign in to comment.