50 Commits

Author SHA1 Message Date
80eb5bb6ba Update libs.versions.toml 2023-03-13 10:07:44 +06:00
8f1bd13ac5 Update libs.versions.toml 2023-03-01 15:39:09 +06:00
12220fab46 Update libs.versions.toml 2023-02-24 16:24:08 +06:00
263ee6475c Update libs.versions.toml 2022-12-18 10:09:09 +06:00
33b25af9a4 Update gradle-wrapper.properties 2022-12-09 21:32:57 +06:00
8f716be674 update android part 2022-11-21 21:21:05 +06:00
3de2e1ceb5 Update libs.versions.toml 2022-11-21 10:45:52 +06:00
836e768705 Update libs.versions.toml 2022-11-21 10:38:10 +06:00
c4ab6cbf74 Update libs.versions.toml 2022-09-26 03:51:16 +06:00
c881165417 improve lib and add template for libs 2022-09-12 14:32:45 +06:00
0ba983cf94 Update libs.versions.toml 2022-08-19 21:48:58 +06:00
04be74561d Update libs.versions.toml 2022-08-06 08:44:01 +06:00
37fe3701fb Update libs.versions.toml 2022-08-06 08:38:08 +06:00
9022faa898 Update gradle-wrapper.properties 2022-08-06 08:35:52 +06:00
e053157dd4 Update libs.versions.toml 2022-08-06 08:35:34 +06:00
7f6e9ae5e4 Update gradle-wrapper.properties 2022-07-22 20:23:30 +06:00
8339c290b9 Update mppProjectWithSerialization.gradle 2022-06-29 13:36:42 +06:00
b575a2ca2f Update mppJavaProject.gradle 2022-06-29 13:36:15 +06:00
71effb81c2 fixes 2022-06-01 01:29:44 +06:00
c2dce5f0b5 Update gradle-wrapper.properties 2022-05-22 23:10:04 +06:00
3974a48d93 Update libs.versions.toml 2022-05-16 17:39:26 +06:00
a964864c58 Update libs.versions.toml 2022-05-12 15:55:18 +06:00
bbfd5886d3 Update libs.versions.toml 2022-04-26 15:49:17 +06:00
323d7c9ee3 Update gradle-wrapper.properties 2022-02-12 12:57:53 +06:00
b7b6f4f7e2 Update libs.versions.toml 2022-02-12 12:57:34 +06:00
5494671ee1 updates and migration onto toml 2022-01-29 21:47:34 +06:00
052072dd5a Update build.yml 2022-01-14 23:22:26 +06:00
ffdfd4b4c5 Update gradle-wrapper.properties 2022-01-14 23:21:52 +06:00
a3cb678f76 Update gradle.properties 2022-01-14 23:21:27 +06:00
36de2d7082 Update gradle.properties 2021-11-26 14:28:17 +06:00
bda4913bf2 Update gradle.properties 2021-11-16 23:26:00 +06:00
acdb9d573e Update mppJsProject.gradle 2021-10-25 15:16:16 +06:00
3a2fda60ed Update mppJavaProject.gradle 2021-10-25 15:16:07 +06:00
da7aefa8ce Update mppProjectWithSerialization.gradle 2021-10-25 15:15:50 +06:00
4ac954d05f Update gradle.properties 2021-10-23 21:59:49 +06:00
c0bbaf0578 update serialization 2021-09-30 12:18:38 +06:00
d1c63deaec add java toolchain setup 2021-09-23 13:20:20 +06:00
e96207516f Update build.yml 2021-09-22 20:23:28 +06:00
adae653e33 Update gradle.properties 2021-09-22 19:48:29 +06:00
9d220c91e3 Update build.gradle 2021-09-04 18:54:59 +06:00
9bc410ccf8 Update gradle-wrapper.properties 2021-09-04 18:51:58 +06:00
018df3cd55 Update gradle.properties 2021-08-25 15:51:33 +06:00
20b356a22c Update gradle.properties 2021-08-17 09:25:09 +06:00
4816349d2d updates 2021-07-03 13:53:30 +06:00
6e7ea5688f Update gradle.properties 2021-07-03 13:25:25 +06:00
9aebefa6cd Update gradle.properties 2021-05-29 17:23:23 +06:00
5aa6388883 Update gradle-wrapper.properties 2021-05-18 11:58:37 +06:00
7e059271c2 Update build.gradle 2021-05-18 11:58:21 +06:00
4decf1ff0a Update gradle.properties 2021-05-06 17:56:28 +06:00
3eaeaf284e Merge pull request #1 from InsanusMokrassar/kotlin/1.5.0
Update gradle.properties
2021-05-02 00:49:19 +06:00
19 changed files with 140 additions and 99 deletions

View File

@@ -8,9 +8,12 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 1.8 - name: Set up JDK 11
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 11
- name: Fix android 32.0.0 dx
continue-on-error: true
run: cd /usr/local/lib/android/sdk/build-tools/32.0.0/ && mv d8 dx && cd lib && mv d8.jar dx.jar
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew build run: ./gradlew build

4
.gitignore vendored
View File

@@ -10,6 +10,8 @@ build/
out/ out/
secret.gradle secret.gradle
local.properties local.*
local/
kotlin-js-store/
publishing.sh publishing.sh

View File

@@ -26,17 +26,21 @@ this case you must rename it in `settings.gradle` file.
## JVM sources in Android target ## 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 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`: next method in the `sourceSets` section of your `build.gradle`:
```groovy ```groovy
enableIncludingJvmCodeInAndroidPart() kotlin {
sourceSets {
// Some other code
androidMain {
// Some other code (like dependencies)
dependsOn jvmMain
}
}
}
``` ```
In case when you need to be sure that JVM sources are not included in Android part, use this snippet: In case when you need to be sure that JVM sources are not included in Android part, just remove line with `dependsOn jvmMain`
```groovy
disableIncludingJvmCodeInAndroidPart()
```
## Types of projects ## Types of projects

View File

@@ -1,6 +1,5 @@
buildscript { buildscript {
repositories { repositories {
jcenter()
google() google()
mavenCentral() mavenCentral()
mavenLocal() mavenLocal()
@@ -8,21 +7,19 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.2' classpath libs.android.tools.build
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath libs.android.dexcount
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath libs.kotlin.gradle.plugin
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version" classpath libs.kotlin.serialization.plugin
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" classpath libs.kotlin.dokka.plugin
} }
} }
allprojects { allprojects {
repositories { repositories {
mavenLocal() mavenLocal()
jcenter()
mavenCentral() mavenCentral()
google() google()
maven { url "https://kotlin.bintray.com/kotlinx" }
} }
} }

View File

@@ -1,37 +1,12 @@
apply plugin: 'com.getkeepsafe.dexcount' apply plugin: 'com.getkeepsafe.dexcount'
android { android {
ext { compileSdkVersion libs.versions.android.compileSdk.get().toInteger()
jvmKotlinFolderFile = { buildToolsVersion libs.versions.android.buildTools.get()
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"
defaultConfig { defaultConfig {
minSdkVersion "$android_minSdkVersion".toInteger() minSdkVersion libs.versions.android.minSdk.get().toInteger()
targetSdkVersion "$android_compileSdkVersion".toInteger() targetSdkVersion libs.versions.android.compileSdk.get().toInteger()
versionCode "${android_code_version}".toInteger() versionCode "${android_code_version}".toInteger()
versionName "$version" versionName "$version"
} }

View File

@@ -6,25 +6,6 @@ kotlin.incremental.js=true
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
kotlin_version=1.5.0
kotlin_serialisation_core_version=1.2.0
# github_release_plugin_version=2.2.12
# ANDROID
android_minSdkVersion=21
android_compileSdkVersion=30
android_buildToolsVersion=30.0.2
dexcount_version=2.0.0
junit_version=4.12
test_ext_junit_version=1.1.2
espresso_core=3.3.0
# Dokka
dokka_version=1.4.30
# Project data # Project data
group=project_group group=project_group

40
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,40 @@
[versions]
kotlin = "1.8.10"
kotlin-serialization = "1.5.0"
dokka = "1.8.10"
dexcount = "3.1.0"
junit_version = "4.12"
test_ext_junit_version = "1.1.3"
espresso_core = "3.4.0"
android-gradle-plugin = "7.3.1"
android-minSdk = "21"
android-compileSdk = "33"
android-buildTools = "33.0.1"
[libraries]
kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" }
kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlin" }
kotlin-test-annotations-common = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "kotlin" }
android-test-junit = { module = "androidx.test.ext:junit", version.ref = "test_ext_junit_version" }
android-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso_core" }
# buildscript classpaths
android-tools-build = { module = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" }
android-dexcount = { module = "com.getkeepsafe.dexcount:dexcount-gradle-plugin", version.ref = "dexcount" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -1,4 +1,4 @@
package project_group package project_group.project_name.lib
class Library { class Library {
fun someLibraryMethod(): Boolean { fun someLibraryMethod(): Boolean {

View File

@@ -1,7 +1,7 @@
/* /*
* This Kotlin source file was generated by the Gradle 'init' task. * This Kotlin source file was generated by the Gradle 'init' task.
*/ */
package project_group package project_group.project_name.lib
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertTrue import kotlin.test.assertTrue

View File

@@ -1 +1 @@
<manifest package="project_group.lib"/> <manifest package="project_group.project_name.lib"/>

View File

@@ -11,13 +11,21 @@ kotlin {
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
implementation kotlin('stdlib') implementation libs.kotlin
api libs.kotlin.serialization
} }
} }
commonTest { commonTest {
dependencies { dependencies {
implementation kotlin('test-common') implementation libs.kotlin.test.common
implementation kotlin('test-annotations-common') implementation libs.kotlin.test.annotations.common
}
}
androidTest {
dependencies {
implementation libs.kotlin.test.junit
implementation libs.android.test.junit
implementation libs.android.test.espresso.core
} }
} }
} }

View File

@@ -5,26 +5,35 @@ project.group = "$group"
kotlin { kotlin {
jvm { jvm {
compilations.main.kotlinOptions.useIR = true compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
} }
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
implementation kotlin('stdlib') implementation libs.kotlin
api libs.kotlin.serialization
} }
} }
commonTest { commonTest {
dependencies { dependencies {
implementation kotlin('test-common') implementation libs.kotlin.test.common
implementation kotlin('test-annotations-common') implementation libs.kotlin.test.annotations.common
} }
} }
jvmTest { jvmTest {
dependencies { dependencies {
implementation kotlin('test-junit') implementation libs.kotlin.test.junit
} }
} }
} }
} }
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -4,7 +4,7 @@ project.group = "$group"
// apply from: "$publishGradlePath" // apply from: "$publishGradlePath"
kotlin { kotlin {
js (BOTH) { js (IR) {
browser() browser()
nodejs() nodejs()
} }
@@ -12,19 +12,20 @@ kotlin {
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
implementation kotlin('stdlib') implementation libs.kotlin
api libs.kotlin.serialization
} }
} }
commonTest { commonTest {
dependencies { dependencies {
implementation kotlin('test-common') implementation libs.kotlin.test.common
implementation kotlin('test-annotations-common') implementation libs.kotlin.test.annotations.common
} }
} }
jsTest { jsTest {
dependencies { dependencies {
implementation kotlin('test-js') implementation libs.kotlin.test.js
implementation kotlin('test-junit') implementation libs.kotlin.test.junit
} }
} }
} }

View File

@@ -5,9 +5,13 @@ project.group = "$group"
kotlin { kotlin {
jvm { jvm {
compilations.main.kotlinOptions.useIR = true compilations.main {
kotlinOptions {
jvmTarget = "1.8"
} }
js (BOTH) { }
}
js (IR) {
browser() browser()
nodejs() nodejs()
} }
@@ -18,35 +22,40 @@ kotlin {
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
implementation kotlin('stdlib') implementation libs.kotlin
api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_core_version" api libs.kotlin.serialization
} }
} }
commonTest { commonTest {
dependencies { dependencies {
implementation kotlin('test-common') implementation libs.kotlin.test.common
implementation kotlin('test-annotations-common') implementation libs.kotlin.test.annotations.common
} }
} }
jvmTest { jvmTest {
dependencies { dependencies {
implementation kotlin('test-junit') implementation libs.kotlin.test.junit
} }
} }
jsTest { jsTest {
dependencies { dependencies {
implementation kotlin('test-js') implementation libs.kotlin.test.js
implementation kotlin('test-junit') implementation libs.kotlin.test.junit
} }
} }
androidTest { androidTest {
dependencies { dependencies {
implementation kotlin('test-junit') implementation libs.kotlin.test.junit
implementation "androidx.test.ext:junit:$test_ext_junit_version" implementation libs.android.test.junit
implementation "androidx.test.espresso:espresso-core:$espresso_core" implementation libs.android.test.espresso.core
} }
} }
} }
} }
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
apply from: "$defaultAndroidSettingsPresetPath" apply from: "$defaultAndroidSettingsPresetPath"

View File

@@ -6,11 +6,13 @@ String[] includes = [
includes.each { originalName -> includes.each { originalName ->
String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replaceAll(":", File.separator)}" String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replace(":", File.separator)}"
String projectName = "${rootProject.name}${originalName.replaceAll(":", ".")}" String projectName = "${rootProject.name}${originalName.replace(":", ".")}"
String projectIdentifier = ":${projectName}" String projectIdentifier = ":${projectName}"
include projectIdentifier include projectIdentifier
ProjectDescriptor project = project(projectIdentifier) ProjectDescriptor project = project(projectIdentifier)
project.name = projectName project.name = projectName
project.projectDir = new File(projectDirectory) project.projectDir = new File(projectDirectory)
} }
enableFeaturePreview("VERSION_CATALOGS")

8
template/build.gradle Normal file
View File

@@ -0,0 +1,8 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.android.library"
}
apply from: "$mppProjectWithSerializationPresetPath"

View File

@@ -0,0 +1 @@
package project_group.project_name.template

View File

@@ -0,0 +1 @@
<manifest package="project_group.project_name.template"/>