Android: Introduce Kotlin support

This commit is contained in:
Charles Lombardo 2022-12-11 03:16:33 -05:00
parent cac5d0b8f5
commit 8226506c84
4 changed files with 35 additions and 24 deletions

View File

@ -1,4 +1,7 @@
apply plugin: 'com.android.application' plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android { android {
compileSdkVersion 33 compileSdkVersion 33
@ -14,6 +17,10 @@ android {
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
kotlinOptions {
jvmTarget = '1.8'
}
lint { lint {
// This is important as it will run lint but not abort on error // This is important as it will run lint but not abort on error
// Lint has some overly obnoxious "errors" that should really be warnings // Lint has some overly obnoxious "errors" that should really be warnings
@ -111,6 +118,7 @@ android {
dependencies { dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.exifinterface:exifinterface:1.3.5' implementation 'androidx.exifinterface:exifinterface:1.3.5'
implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0'

View File

@ -1,17 +1,6 @@
buildscript { // Top-level build file where you can add configuration options common to all sub-projects/modules.
repositories { plugins {
google() id 'com.android.application' version '7.3.1' apply false
mavenCentral() id 'com.android.library' version '7.3.1' apply false
} id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
} }

View File

@ -6,11 +6,11 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html # http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode. android.enableJetifier=true
# This option should only be used with decoupled projects. More details, visit # AndroidX package structure to make it clearer which packages are bundled with the
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # Android operating system, and which are packaged with your app's APK
# org.gradle.parallel=true # https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

View File

@ -1,2 +1,16 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
include ':app' include ':app'
include ':benchmark' include ':benchmark'