Skip to content

Commit ef9b979

Browse files
committed
migrate to built-in kotlin
1 parent 207e8e7 commit ef9b979

File tree

6 files changed

+7
-19
lines changed

6 files changed

+7
-19
lines changed

app/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
plugins {
22
id 'com.android.application'
3-
id 'kotlin-android'
4-
id 'org.jetbrains.kotlin.android'
53
id 'dagger.hilt.android.plugin'
64
id 'kotlin-parcelize'
75
id 'de.undercouch.download'
86
id "com.google.devtools.ksp"
97
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
108
id 'kotlinx-serialization'
11-
id "com.google.protobuf" version "0.9.1"
129
id "org.jetbrains.kotlin.plugin.compose" version "${kotlinVersion}"
1310
id 'com.google.firebase.firebase-perf'
1411
id 'com.bugsnag.android.gradle'
@@ -17,7 +14,7 @@ plugins {
1714

1815
def versionMajor = 3
1916
def versionMinor = 10
20-
def versionPatch = 1
17+
def versionPatch = 2
2118
def versionBuild = 1
2219

2320
apply plugin: 'com.google.gms.google-services'
@@ -55,11 +52,6 @@ android {
5552
}
5653
}
5754

58-
kotlinOptions {
59-
jvmTarget = '17'
60-
freeCompilerArgs += ['-opt-in=kotlin.contracts.ExperimentalContracts']
61-
}
62-
6355
lintOptions{
6456
disable "ObjectAnimatorBinding", "AnimatorKeep"
6557
disable 'MissingTranslation'

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
3939
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
4040
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />
41-
<uses-sdk
42-
android:minSdkVersion="24"
43-
tools:overrideLibrary="com.google.mlkit.nl.entityextraction" />
4441

4542
<application
4643
android:name=".MixinApp"
@@ -189,7 +186,6 @@
189186

190187
<activity-alias
191188
android:name="one.mixin.messenger.ShareActivity"
192-
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
193189
android:excludeFromRecents="true"
194190
android:exported="true"
195191
android:targetActivity=".ui.forward.ForwardActivity">

app/src/main/java/one/mixin/android/extension/ArrayExtension.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package one.mixin.android.extension
22

3+
import kotlin.contracts.ExperimentalContracts
34
import kotlin.contracts.contract
45

6+
@OptIn(ExperimentalContracts::class)
57
fun ByteArray?.isNullOrEmpty(): Boolean {
68
contract {
79
returns(false) implies (this@isNullOrEmpty != null)

app/src/main/java/one/mixin/android/util/debug/DebugUtil.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import one.mixin.android.BuildConfig
1313
import one.mixin.android.extension.heavyClickVibrate
1414
import one.mixin.android.util.reportEvent
1515
import timber.log.Timber
16+
import kotlin.contracts.ExperimentalContracts
1617
import kotlin.contracts.InvocationKind
1718
import kotlin.contracts.contract
1819

@@ -36,6 +37,7 @@ fun debugLongClick(
3637
}
3738
}
3839

40+
@OptIn(ExperimentalContracts::class)
3941
inline fun <T> measureTimeMillis(
4042
tag: String,
4143
block: () -> T,
@@ -49,6 +51,7 @@ inline fun <T> measureTimeMillis(
4951
return result
5052
}
5153

54+
@OptIn(ExperimentalContracts::class)
5255
inline fun <T> timeoutEarlyWarning(
5356
block: () -> T,
5457
timeout: Long = 50L,

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ buildscript {
162162
plugins {
163163
id 'com.android.application' version '9.1.0' apply false
164164
id 'com.android.library' version '9.1.0' apply false
165-
id 'org.jetbrains.kotlin.android' version "${kotlinVersion}" apply false
166-
id "org.jetbrains.kotlin.kapt" version "${kotlinVersion}" apply false
167165
id 'com.google.dagger.hilt.android' version '2.59.2' apply false
168166
id "org.jetbrains.kotlin.plugin.parcelize" version "${kotlinVersion}" apply false
169167
id "de.undercouch.download" version "5.5.0" apply false

gradle.properties

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ android.r8.optimizedResourceShrinking=true
3030
android.defaults.buildfeatures.resvalues=true
3131
android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
3232
android.enableAppCompileTimeRClass=false
33-
android.usesSdkInManifest.disallowed=false
3433
android.uniquePackageNames=false
3534
android.dependency.useConstraints=true
36-
android.r8.strictFullModeForKeepRules=false
37-
android.builtInKotlin=false
38-
android.newDsl=false
35+
android.r8.strictFullModeForKeepRules=false

0 commit comments

Comments
 (0)