Merge pull request #1 from InsanusMokrassar/kotlin/1.5.0

Update gradle.properties
This commit is contained in:
InsanusMokrassar 2021-05-02 00:49:19 +06:00 committed by GitHub
commit 3eaeaf284e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 2 deletions

View File

@ -23,6 +23,21 @@ sdk.dir=/your/path/to/android/sdk
In this template there is only one subproject with name `lib`. You are always able to rename it, but remember that in
this case you must rename it in `settings.gradle` file.
## JVM sources in Android target
By default JVM code is not included in Android target. In case you wish to include JVM sources in Android build, use
next method in the end of your `build.gradle`:
```groovy
enableIncludingJvmCodeInAndroidPart()
```
In case when you need to be sure that JVM sources are not included in Android part, use this snippet:
```groovy
disableIncludingJvmCodeInAndroidPart()
```
## Types of projects
### `mppProjectWithSerialization`

View File

@ -1,6 +1,31 @@
apply plugin: 'com.getkeepsafe.dexcount'
android {
ext {
jvmKotlinFolderFile = {
String sep = File.separator
return new File("${project.projectDir}${sep}src${sep}jvmMain${sep}kotlin")
}
enableIncludingJvmCodeInAndroidPart = {
File jvmKotlinFolder = jvmKotlinFolderFile()
if (jvmKotlinFolder.exists()) {
android.sourceSets.main.java.srcDirs += jvmKotlinFolder.path
}
}
disableIncludingJvmCodeInAndroidPart = {
File jvmKotlinFolder = jvmKotlinFolderFile()
String[] oldDirs = android.sourceSets.main.java.srcDirs
android.sourceSets.main.java.srcDirs = []
for (oldDir in oldDirs) {
if (oldDir != jvmKotlinFolder.path) {
android.sourceSets.main.java.srcDirs += oldDir
}
}
}
}
compileSdkVersion "$android_compileSdkVersion".toInteger()
buildToolsVersion "$android_buildToolsVersion"

View File

@ -6,8 +6,8 @@ kotlin.incremental.js=true
android.useAndroidX=true
android.enableJetifier=true
kotlin_version=1.4.32
kotlin_serialisation_core_version=1.1.0
kotlin_version=1.5.0
kotlin_serialisation_core_version=1.2.0
# github_release_plugin_version=2.2.12