mirror of
				https://github.com/InsanusMokrassar/KotlinMultiplatformProjectTemplate.git
				synced 2025-10-31 20:20:52 +00:00 
			
		
		
		
	Compare commits
	
		
			42 Commits
		
	
	
		
			kotlin/1.5
			...
			c4ab6cbf74
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| c4ab6cbf74 | |||
| c881165417 | |||
| 0ba983cf94 | |||
| 04be74561d | |||
| 37fe3701fb | |||
| 9022faa898 | |||
| e053157dd4 | |||
| 7f6e9ae5e4 | |||
| 8339c290b9 | |||
| b575a2ca2f | |||
| 71effb81c2 | |||
| c2dce5f0b5 | |||
| 3974a48d93 | |||
| a964864c58 | |||
| bbfd5886d3 | |||
| 323d7c9ee3 | |||
| b7b6f4f7e2 | |||
| 5494671ee1 | |||
| 052072dd5a | |||
| ffdfd4b4c5 | |||
| a3cb678f76 | |||
| 36de2d7082 | |||
| bda4913bf2 | |||
| acdb9d573e | |||
| 3a2fda60ed | |||
| da7aefa8ce | |||
| 4ac954d05f | |||
| c0bbaf0578 | |||
| d1c63deaec | |||
| e96207516f | |||
| adae653e33 | |||
| 9d220c91e3 | |||
| 9bc410ccf8 | |||
| 018df3cd55 | |||
| 20b356a22c | |||
| 4816349d2d | |||
| 6e7ea5688f | |||
| 9aebefa6cd | |||
| 5aa6388883 | |||
| 7e059271c2 | |||
| 4decf1ff0a | |||
| 3eaeaf284e | 
							
								
								
									
										7
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -10,6 +10,8 @@ build/ | |||||||
| out/ | out/ | ||||||
|  |  | ||||||
| secret.gradle | secret.gradle | ||||||
| local.properties | local.* | ||||||
|  | local/ | ||||||
|  | kotlin-js-store/ | ||||||
|  |  | ||||||
| publishing.sh | publishing.sh | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								build.gradle
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								build.gradle
									
									
									
									
									
								
							| @@ -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" } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -26,12 +26,12 @@ android { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     compileSdkVersion "$android_compileSdkVersion".toInteger() |     compileSdkVersion libs.versions.android.compileSdk.get().toInteger() | ||||||
|     buildToolsVersion "$android_buildToolsVersion" |     buildToolsVersion libs.versions.android.buildTools.get() | ||||||
|  |  | ||||||
|     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" | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -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 | ||||||
|   | |||||||
							
								
								
									
										38
									
								
								gradle/libs.versions.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								gradle/libs.versions.toml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | |||||||
|  | [versions] | ||||||
|  |  | ||||||
|  | kotlin = "1.7.10" | ||||||
|  | kotlin-serialization = "1.4.0" | ||||||
|  |  | ||||||
|  | dexcount = "3.1.0" | ||||||
|  | junit_version = "4.12" | ||||||
|  | test_ext_junit_version = "1.1.3" | ||||||
|  | espresso_core = "3.4.0" | ||||||
|  |  | ||||||
|  | android-gradle-plugin = "7.2.2" | ||||||
|  | android-minSdk = "21" | ||||||
|  | android-compileSdk = "33" | ||||||
|  | android-buildTools = "33.0.0" | ||||||
|  |  | ||||||
|  | [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 = "kotlin" } | ||||||
|  |  | ||||||
|  | [plugins] | ||||||
|  |  | ||||||
|  | kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } | ||||||
|  | kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } | ||||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -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.5.1-bin.zip | ||||||
| zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| package project_group | package project_group.project_name.lib | ||||||
| 
 | 
 | ||||||
| class Library { | class Library { | ||||||
|     fun someLibraryMethod(): Boolean { |     fun someLibraryMethod(): Boolean { | ||||||
| @@ -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 | ||||||
| @@ -1 +1 @@ | |||||||
| <manifest package="project_group.lib"/> | <manifest package="project_group.project_name.lib"/> | ||||||
|   | |||||||
| @@ -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 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -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 | ||||||
|  | } | ||||||
|   | |||||||
| @@ -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 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -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" | ||||||
|   | |||||||
| @@ -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
									
								
							
							
						
						
									
										8
									
								
								template/build.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | plugins { | ||||||
|  |     id "org.jetbrains.kotlin.multiplatform" | ||||||
|  |     id "org.jetbrains.kotlin.plugin.serialization" | ||||||
|  |     id "com.android.library" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | apply from: "$mppProjectWithSerializationPresetPath" | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								template/src/commonMain/kotlin/PackageInfo.kt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								template/src/commonMain/kotlin/PackageInfo.kt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | package project_group.project_name.template | ||||||
							
								
								
									
										1
									
								
								template/src/main/AndroidManifest.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								template/src/main/AndroidManifest.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | <manifest package="project_group.project_name.template"/> | ||||||
		Reference in New Issue
	
	Block a user