diff --git a/.gitignore b/.gitignore index 2e84d6fc380..8a04b36aa50 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ build/ out/ secret.gradle +local.properties publishing.sh diff --git a/build.gradle b/build.gradle index 867cd6d1c97..ced5e4a2e35 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,18 @@ buildscript { - ext { - kotlin_version = '1.4.10' - } repositories { - mavenLocal() jcenter() + google() mavenCentral() + mavenLocal() maven { url "https://plugins.gradle.org/m2/" } } dependencies { + classpath 'com.android.tools.build:gradle:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version" + classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version" classpath "com.github.breadmoirai:github-release:$github_release_plugin_version" } } @@ -22,6 +22,7 @@ allprojects { mavenLocal() jcenter() mavenCentral() + google() maven { url "https://kotlin.bintray.com/kotlinx" } } } diff --git a/gradle.properties b/gradle.properties index 33eff1cfb61..d1fd270523a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,6 +20,7 @@ uuidVersion=0.2.2 # ANDROID +android_minSdkVersion=24 android_compileSdkVersion=30 android_buildToolsVersion=30.0.2 dexcount_version=2.0.0-RC1 diff --git a/mppAndroidProject b/mppAndroidProject index d3118a62aaa..e4cb95af6f9 100644 --- a/mppAndroidProject +++ b/mppAndroidProject @@ -18,11 +18,35 @@ kotlin { implementation kotlin('test-annotations-common') } } - - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } + } +} + +android { + compileSdkVersion "$android_compileSdkVersion".toInteger() + defaultConfig { + minSdkVersion "$android_minSdkVersion".toInteger() + targetSdkVersion "$android_compileSdkVersion".toInteger() + versionCode "${android_code_version}".toInteger() + versionName "$version" + } + buildTypes { + release { + minifyEnabled false + } + } + + packagingOptions { + exclude 'META-INF/kotlinx-serialization-runtime.kotlin_module' + exclude 'META-INF/kotlinx-serialization-cbor.kotlin_module' + exclude 'META-INF/kotlinx-serialization-properties.kotlin_module' + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8.toString() } } diff --git a/repos/android/build.gradle b/repos/android/build.gradle new file mode 100644 index 00000000000..d35a26fc165 --- /dev/null +++ b/repos/android/build.gradle @@ -0,0 +1,8 @@ +plugins { + id "org.jetbrains.kotlin.multiplatform" + id "org.jetbrains.kotlin.plugin.serialization" + id "com.android.library" + id "kotlin-android-extensions" +} + +apply from: "$mppAndroidProjectPresetPath" diff --git a/repos/android/db/build.gradle b/repos/android/db/build.gradle deleted file mode 100644 index fd1f782dfe7..00000000000 --- a/repos/android/db/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -buildscript { - repositories { - jcenter() - google() - mavenCentral() - mavenLocal() - maven { url "https://plugins.gradle.org/m2/" } - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version" - } -} - -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jetbrains.kotlin.plugin.serialization" -} - -apply plugin: 'com.android.library' - -apply from: "$mppAndroidProjectPresetPath" diff --git a/repos/android/src/main/AndroidManifest.xml b/repos/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..49151ff7948 --- /dev/null +++ b/repos/android/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 6616408933c..3a4bff38743 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,7 +13,7 @@ String[] includes = [ ":repos:ktor:client", ":repos:ktor:common", ":repos:ktor:server", -// ":repos:android:db", + ":repos:android", ":ktor:server", ":ktor:common", ":ktor:client",