mirror of
https://github.com/InsanusMokrassar/KotlinMultiplatformProjectTemplate.git
synced 2024-11-22 16:23:56 +00:00
Merge pull request #1 from InsanusMokrassar/kotlin/1.5.0
Update gradle.properties
This commit is contained in:
commit
3eaeaf284e
15
README.md
15
README.md
@ -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`
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user