Skip to content

Commit

Permalink
feat: Downgrade Kotlin version and dependencies to support AGP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Denes Sapi committed Sep 27, 2023
1 parent b61f60e commit 989ee5b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 14 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.1.1' apply false
id 'com.android.library' version '8.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
id 'maven-publish'
id 'org.jetbrains.dokka' version '1.9.0'
id 'jacoco'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
id 'org.jetbrains.kotlin.jvm' version '1.9.0' apply false
id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false
}
17 changes: 11 additions & 6 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

android {
namespace 'com.cursorinsight.trap.example'
compileSdk 34
compileSdk 33

defaultConfig {
applicationId "com.cursorinsight.trap.example"
Expand All @@ -14,7 +14,7 @@ android {
targetSdk 33
versionCode 1
versionName "1.0"

multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -25,6 +25,7 @@ android {
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand All @@ -37,25 +38,29 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.0'
kotlinCompilerExtensionVersion '1.4.1'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
configurations.all {
resolutionStrategy.force 'androidx.emoji2:emoji2:1.3.0'
}
}

dependencies {
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.compose.material3:material3:1.1.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.compose.ui:ui:1.5.0'
implementation 'androidx.compose.ui:ui-graphics:1.5.0'
implementation 'androidx.compose.ui:ui-tooling-preview:1.5.0'
implementation 'androidx.compose.ui:ui:1.4.3'
implementation 'androidx.compose.ui:ui-graphics:1.4.3'
implementation 'androidx.compose.ui:ui-tooling-preview:1.4.3'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation project(path: ':trap')
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jul 25 17:44:55 CEST 2023
#Wed Sep 27 15:20:00 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion trap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ signing {
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'org.java-websocket:Java-WebSocket:1.5.4'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'com.google.android.gms:play-services-location:21.0.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class TrapPointerCollector(
private val storage: SynchronizedQueue<JSONArray>,
@Suppress("UNUSED_PARAMETER") config: TrapConfig,
): TrapDatasource {
@OptIn(ExperimentalStdlibApi::class)
private val handler = { event: MotionEvent? ->
if (event != null && event.getToolType(0) == TOOL_TYPE_MOUSE) {
when (event.actionMasked) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TrapStylusCollector(
private val storage: SynchronizedQueue<JSONArray>,
@Suppress("UNUSED_PARAMETER") config: TrapConfig,
): TrapDatasource {
@OptIn(ExperimentalStdlibApi::class)
private val handler = { event: MotionEvent? ->
if (event != null && (event.getToolType(0) == TOOL_TYPE_STYLUS || event.getToolType(0) == TOOL_TYPE_ERASER)) {
when (event.actionMasked) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TrapTouchCollector(
private val storage: SynchronizedQueue<JSONArray>,
@Suppress("UNUSED_PARAMETER") config: TrapConfig,
) : TrapDatasource {
@OptIn(ExperimentalStdlibApi::class)
private val handler = { event: MotionEvent? ->
if (event != null && (event.getToolType(0) == MotionEvent.TOOL_TYPE_FINGER || event.getToolType(0) == TOOL_TYPE_UNKNOWN)) {
when(event.actionMasked) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ internal class TrapCachedTransport(
}

@Throws(Exception::class)
@OptIn(ExperimentalStdlibApi::class)
override fun send(data: String) {
try {
// Attempt to send the cache contents
Expand Down

0 comments on commit 989ee5b

Please sign in to comment.