mirror of
				https://github.com/InsanusMokrassar/KotlinMultiplatformProjectTemplate.git
				synced 2025-10-30 19:50:22 +00:00 
			
		
		
		
	Compare commits
	
		
			80 Commits
		
	
	
		
			7f6e9ae5e4
			...
			renovate/k
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 4276c11469 | ||
| 373906e156 | |||
| 5fe23903a4 | |||
|  | ecf1238085 | ||
| fdde796281 | |||
|  | 4cc23d72bf | ||
| b29e381ee3 | |||
| d388806d3b | |||
| 185285c1ca | |||
|  | 23cc432d21 | ||
| 005491c256 | |||
|  | 0ad128a11a | ||
| ab7f703227 | |||
| 66b55947ae | |||
|  | b5230087da | ||
|  | 0b2be65b9e | ||
| 896028d0bb | |||
| 6dced2d86e | |||
| 29a4154490 | |||
|  | 4f524ebf1b | ||
| 1d2cf6025d | |||
|  | 00aab9e228 | ||
| 375e3c1d6e | |||
|  | d7b5ea6d83 | ||
| 4d8992e86f | |||
|  | 1b113fe006 | ||
| 3c8822e3e7 | |||
|  | f7d115c624 | ||
| bb798ccc67 | |||
|  | c4f147df83 | ||
| c2fed22e80 | |||
|  | ec8915aed1 | ||
| 1d602c5d26 | |||
| 2d36722c37 | |||
| 37763d2221 | |||
| 3ae29248af | |||
| 8f81904cdb | |||
| 33782f0cdb | |||
| 3bab6a95b2 | |||
| a757c4cf06 | |||
| 453ae19a49 | |||
| 631d74dc6b | |||
| bd455bebba | |||
| bd07fb382e | |||
| 297114273f | |||
| 05f029c257 | |||
| 11ac3aebda | |||
| c5c7fd26e4 | |||
| ce0aea6b77 | |||
| 9d7955b9b0 | |||
| 18b84216a5 | |||
| 1366dd55c2 | |||
| 049dc8f5d7 | |||
| dac20a8a02 | |||
| c1d6dae359 | |||
| 4ed6f8e104 | |||
| dc07633928 | |||
| be7fa9241f | |||
| df6c8b8358 | |||
| ca1ec3f208 | |||
| deba42332a | |||
| e0bce311d5 | |||
| ebc07f5c3d | |||
| 488e4b283d | |||
| c55087ce1b | |||
| 80eb5bb6ba | |||
| 8f1bd13ac5 | |||
| 12220fab46 | |||
| 263ee6475c | |||
| 33b25af9a4 | |||
| 8f716be674 | |||
| 3de2e1ceb5 | |||
| 836e768705 | |||
| c4ab6cbf74 | |||
| c881165417 | |||
| 0ba983cf94 | |||
| 04be74561d | |||
| 37fe3701fb | |||
| 9022faa898 | |||
| e053157dd4 | 
							
								
								
									
										8
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -5,15 +5,11 @@ on: [push] | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|       - name: Set up JDK 11 | ||||
|       - name: Set up JDK 17 | ||||
|         uses: actions/setup-java@v1 | ||||
|         with: | ||||
|           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 | ||||
|           java-version: 17 | ||||
|       - name: Build with Gradle | ||||
|         run: ./gradlew build | ||||
|   | ||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,5 @@ | ||||
| .idea | ||||
| .kotlin | ||||
| out/* | ||||
| *.iml | ||||
| target | ||||
|   | ||||
							
								
								
									
										4
									
								
								.templates/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								.templates/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| # Templates | ||||
|  | ||||
| This folder contains templates to generate your modules in Intellij Idea with plugin | ||||
| [ModuleGenerator](https://plugins.jetbrains.com/plugin/21100-segment-generator) | ||||
							
								
								
									
										5
									
								
								.templates/mpp_android_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.templates/mpp_android_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| { | ||||
|    "module_name": "sample", | ||||
|    "module_package": "feature.{{.module_name}}", | ||||
|    "full_module_package": "project_group.project_name.{{.module_package}}" | ||||
| } | ||||
| @@ -0,0 +1,8 @@ | ||||
| plugins { | ||||
|     id "org.jetbrains.kotlin.multiplatform" | ||||
|     id "org.jetbrains.kotlin.plugin.serialization" | ||||
|     id "com.android.library" | ||||
| } | ||||
|  | ||||
| apply from: "$mppAndroidProject" | ||||
|  | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
							
								
								
									
										5
									
								
								.templates/mpp_java_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.templates/mpp_java_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| { | ||||
|    "module_name": "sample", | ||||
|    "module_package": "feature.{{.module_name}}", | ||||
|    "full_module_package": "project_group.project_name.{{.module_package}}" | ||||
| } | ||||
| @@ -0,0 +1,7 @@ | ||||
| plugins { | ||||
|     id "org.jetbrains.kotlin.multiplatform" | ||||
|     id "org.jetbrains.kotlin.plugin.serialization" | ||||
| } | ||||
|  | ||||
| apply from: "$mppJavaProject" | ||||
|  | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
							
								
								
									
										5
									
								
								.templates/mpp_js_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.templates/mpp_js_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| { | ||||
|    "module_name": "sample", | ||||
|    "module_package": "feature.{{.module_name}}", | ||||
|    "full_module_package": "project_group.project_name.{{.module_package}}" | ||||
| } | ||||
| @@ -0,0 +1,7 @@ | ||||
| plugins { | ||||
|     id "org.jetbrains.kotlin.multiplatform" | ||||
|     id "org.jetbrains.kotlin.plugin.serialization" | ||||
| } | ||||
|  | ||||
| apply from: "$mppJsProject" | ||||
|  | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
							
								
								
									
										5
									
								
								.templates/mpp_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.templates/mpp_module/ModuleGenerator.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| { | ||||
|    "module_name": "sample", | ||||
|    "module_package": "feature.{{.module_name}}", | ||||
|    "full_module_package": "project_group.project_name.{{.module_package}}" | ||||
| } | ||||
| @@ -0,0 +1,8 @@ | ||||
| plugins { | ||||
|     id "org.jetbrains.kotlin.multiplatform" | ||||
|     id "org.jetbrains.kotlin.plugin.serialization" | ||||
|     id "com.android.library" | ||||
| } | ||||
|  | ||||
| apply from: "$mppProjectWithSerialization" | ||||
|  | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
| @@ -0,0 +1 @@ | ||||
| package {{.full_module_package}} | ||||
							
								
								
									
										18
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								README.md
									
									
									
									
									
								
							| @@ -26,17 +26,21 @@ 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`: | ||||
| next method in the `sourceSets` section of your `build.gradle`: | ||||
|  | ||||
| ```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: | ||||
|  | ||||
| ```groovy | ||||
| disableIncludingJvmCodeInAndroidPart() | ||||
| ``` | ||||
| In case when you need to be sure that JVM sources are not included in Android part, just remove line with `dependsOn jvmMain` | ||||
|  | ||||
| ## Types of projects | ||||
|  | ||||
|   | ||||
| @@ -1,66 +0,0 @@ | ||||
| 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 libs.versions.android.compileSdk.get().toInteger() | ||||
|     buildToolsVersion libs.versions.android.buildTools.get() | ||||
|  | ||||
|     defaultConfig { | ||||
|         minSdkVersion libs.versions.android.minSdk.get().toInteger() | ||||
|         targetSdkVersion libs.versions.android.compileSdk.get().toInteger() | ||||
|         versionCode "${android_code_version}".toInteger() | ||||
|         versionName "$version" | ||||
|     } | ||||
|     buildTypes { | ||||
|         release { | ||||
|             minifyEnabled false | ||||
|         } | ||||
|         debug { | ||||
|             debuggable true | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     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() | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         String sep = File.separator | ||||
|         main.java.srcDirs += "src${sep}main${sep}kotlin" | ||||
|     } | ||||
| } | ||||
| @@ -1,25 +1,32 @@ | ||||
| allprojects { | ||||
|     ext { | ||||
|         projectByName = { String name -> | ||||
|             for (subproject in rootProject.subprojects) { | ||||
|                 if (subproject.name == name) { | ||||
|                     return subproject | ||||
|                 } | ||||
|             } | ||||
|             return null | ||||
|         } | ||||
| File templatesFolder = new File("$rootProject.projectDir.absolutePath${File.separatorChar}gradle${File.separatorChar}templates") | ||||
|  | ||||
|         internalProject = { String name -> | ||||
|             projectByName(name) | ||||
|         } | ||||
| Map properties = new HashMap<String, String>() | ||||
|  | ||||
|         mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle" | ||||
|         mppJavaProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJavaProject.gradle" | ||||
|         mppJsProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJsProject.gradle" | ||||
|         mppAndroidProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppAndroidProject.gradle" | ||||
|  | ||||
|         defaultAndroidSettingsPresetPath = "${rootProject.projectDir.absolutePath}/defaultAndroidSettings.gradle" | ||||
|  | ||||
|         // publishGradlePath = "${rootProject.projectDir.absolutePath}/publish.gradle" | ||||
| if (templatesFolder.exists() && templatesFolder.isDirectory()) { | ||||
|     templatesFolder.listFiles().each { | ||||
|         properties[it.name - ".gradle"] = it.absolutePath | ||||
|     } | ||||
| } | ||||
|  | ||||
| properties["projectByName"] = { name -> | ||||
|     for (subproject in rootProject.subprojects) { | ||||
|         if (subproject.name == name) { | ||||
|             return subproject | ||||
|         } | ||||
|     } | ||||
|     return null | ||||
| } | ||||
|  | ||||
| properties["internalProject"] = { name -> | ||||
|     projectByName("$name") | ||||
| } | ||||
|  | ||||
| allprojects { | ||||
|     ext { | ||||
|         releaseMode = (project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true" | ||||
|  | ||||
|         properties.forEach { k, v -> | ||||
|             it[k] = v | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,36 +1,41 @@ | ||||
| [versions] | ||||
|  | ||||
| kotlin = "1.6.21" | ||||
| kotlin-serialization = "1.3.3" | ||||
| kotlin-gradle-plugin = "7.0.4" | ||||
| kotlin = "2.1.20" | ||||
| kotlin-serialization = "1.9.0" | ||||
| kotlin-coroutines = "1.10.2" | ||||
|  | ||||
| dexcount = "3.1.0" | ||||
| dokka = "2.0.0" | ||||
|  | ||||
| dexcount = "4.0.0" | ||||
| junit_version = "4.12" | ||||
| test_ext_junit_version = "1.1.2" | ||||
| espresso_core = "3.3.0" | ||||
| test_ext_junit_version = "1.2.1" | ||||
| espresso_core = "3.6.1" | ||||
|  | ||||
| android-gradle-plugin = "8.7.2" | ||||
| android-minSdk = "21" | ||||
| android-compileSdk = "32" | ||||
| android-buildTools = "32.0.0" | ||||
| android-compileSdk = "35" | ||||
| android-buildTools = "35.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-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" } | ||||
| kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlin-coroutines" } | ||||
| 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" } | ||||
| android-test-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso_core" } | ||||
|  | ||||
| # buildscript classpaths | ||||
|  | ||||
| android-tools-build = { module = "com.android.tools.build:gradle", version.ref = "kotlin-gradle-plugin" } | ||||
| 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" } | ||||
| kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } | ||||
|  | ||||
| [plugins] | ||||
|  | ||||
|   | ||||
							
								
								
									
										34
									
								
								gradle/templates/defaultAndroidSettings.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								gradle/templates/defaultAndroidSettings.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| apply plugin: 'com.getkeepsafe.dexcount' | ||||
|  | ||||
| android { | ||||
|     compileSdkVersion libs.versions.android.compileSdk.get().toInteger() | ||||
|     buildToolsVersion libs.versions.android.buildTools.get() | ||||
|  | ||||
|     defaultConfig { | ||||
|         minSdkVersion libs.versions.android.minSdk.get().toInteger() | ||||
|         compileSdkVersion libs.versions.android.compileSdk.get().toInteger() | ||||
|         targetSdkVersion libs.versions.android.compileSdk.get().toInteger() | ||||
|         versionCode "${android_code_version}".toInteger() | ||||
|         versionName "$version" | ||||
|         namespace "${project.group}.${project.name}" | ||||
|     } | ||||
|     buildTypes { | ||||
|         release { | ||||
|             minifyEnabled false | ||||
|         } | ||||
|         debug { | ||||
|             debuggable true | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     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_17 | ||||
|         targetCompatibility JavaVersion.VERSION_17 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										24
									
								
								gradle/templates/defaultProject.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								gradle/templates/defaultProject.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| project.version = "$version" | ||||
| project.group = "$group" | ||||
|  | ||||
| kotlin { | ||||
|     sourceSets { | ||||
|         commonMain { | ||||
|             dependencies { | ||||
|                 implementation kotlin('stdlib') | ||||
|             } | ||||
|         } | ||||
|         commonTest { | ||||
|             dependencies { | ||||
|                 implementation kotlin('test-common') | ||||
|                 implementation kotlin('test-annotations-common') | ||||
|                 implementation libs.kotlin.coroutines.test | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| java { | ||||
|     sourceCompatibility = JavaVersion.VERSION_17 | ||||
|     targetCompatibility = JavaVersion.VERSION_17 | ||||
| } | ||||
							
								
								
									
										25
									
								
								gradle/templates/defaultProjectWithSerialization.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								gradle/templates/defaultProjectWithSerialization.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| project.version = "$version" | ||||
| project.group = "$group" | ||||
|  | ||||
| kotlin { | ||||
|     sourceSets { | ||||
|         commonMain { | ||||
|             dependencies { | ||||
|                 implementation kotlin('stdlib') | ||||
|                 api libs.kotlin.serialization | ||||
|             } | ||||
|         } | ||||
|         commonTest { | ||||
|             dependencies { | ||||
|                 implementation kotlin('test-common') | ||||
|                 implementation kotlin('test-annotations-common') | ||||
|                 implementation libs.kotlin.coroutines.test | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| java { | ||||
|     sourceCompatibility = JavaVersion.VERSION_17 | ||||
|     targetCompatibility = JavaVersion.VERSION_17 | ||||
| } | ||||
							
								
								
									
										31
									
								
								gradle/templates/enableMPPAndroid.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								gradle/templates/enableMPPAndroid.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| kotlin { | ||||
|     androidTarget { | ||||
|         publishAllLibraryVariants() | ||||
|         compilations.all { | ||||
|             kotlinOptions { | ||||
|                 jvmTarget = "17" | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         androidUnitTest { | ||||
|             dependencies { | ||||
|                 implementation kotlin('test-junit') | ||||
|                 implementation libs.android.test.junit | ||||
|                 implementation libs.android.test.espresso | ||||
|             } | ||||
|         } | ||||
|         androidInstrumentedTest { | ||||
|             dependencies { | ||||
|                 implementation kotlin('test-junit') | ||||
|                 implementation libs.android.test.junit | ||||
|                 implementation libs.android.test.espresso | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         androidMain.dependsOn jvmMain | ||||
|     } | ||||
| } | ||||
|  | ||||
| apply from: "$defaultAndroidSettings" | ||||
							
								
								
									
										30
									
								
								gradle/templates/enableMPPJs.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								gradle/templates/enableMPPJs.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| kotlin { | ||||
|     js (IR) { | ||||
|         browser { | ||||
|             testTask { | ||||
|                 useMocha { | ||||
|                     timeout = "240000" | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         nodejs { | ||||
|             testTask { | ||||
|                 useMocha { | ||||
|                     timeout = "240000" | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         jsMain { | ||||
|             dependencies { | ||||
|             } | ||||
|         } | ||||
|         jsTest { | ||||
|             dependencies { | ||||
|                 implementation kotlin('test-js') | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										21
									
								
								gradle/templates/enableMPPJvm.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								gradle/templates/enableMPPJvm.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| kotlin { | ||||
|     jvm { | ||||
|         compilations.main { | ||||
|             kotlinOptions { | ||||
|                 jvmTarget = "17" | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         jvmMain { | ||||
|             dependencies { | ||||
|             } | ||||
|         } | ||||
|         jvmTest { | ||||
|             dependencies { | ||||
|                 implementation kotlin('test-junit') | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										8
									
								
								gradle/templates/enableMPPNativeArm64.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								gradle/templates/enableMPPNativeArm64.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| kotlin { | ||||
|     linuxArm64() | ||||
|  | ||||
|     sourceSets { | ||||
|         nativeMain.dependsOn commonMain | ||||
|         linuxArm64Main.dependsOn nativeMain | ||||
|     } | ||||
| } | ||||
							
								
								
									
										10
									
								
								gradle/templates/enableMPPNativeX64.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								gradle/templates/enableMPPNativeX64.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| kotlin { | ||||
|     linuxX64() | ||||
|     mingwX64() | ||||
|  | ||||
|     sourceSets { | ||||
|         nativeMain.dependsOn commonMain | ||||
|         linuxX64Main.dependsOn nativeMain | ||||
|         mingwX64Main.dependsOn nativeMain | ||||
|     } | ||||
| } | ||||
							
								
								
									
										27
									
								
								gradle/templates/enableMPPWasmJs.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								gradle/templates/enableMPPWasmJs.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| kotlin { | ||||
|     wasmJs { | ||||
|         browser { | ||||
|             testTask { | ||||
|                 useKarma { | ||||
|                     useChromeHeadless() | ||||
|                     useConfigDirectory(rootProject.relativeProjectPath("gradle/karma.config.d")) | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         nodejs { | ||||
|             testTask { | ||||
|                 timeout = Duration.ofSeconds(240) | ||||
|                 nodeJsArgs.add("--unhandled-rejections=warn") | ||||
|                 nodeJsArgs.add("--trace-warnings") | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         wasmJsTest { | ||||
|             dependencies { | ||||
|                 implementation kotlin('test-wasm-js') | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										5
									
								
								gradle/templates/mppAndroidProject.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								gradle/templates/mppAndroidProject.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| apply from: "$defaultProject" | ||||
| apply from: "$enableMPPJvm" | ||||
| apply from: "$enableMPPJs" | ||||
| apply from: "$enableMPPWasmJs" | ||||
| apply from: "$enableMPPAndroid" | ||||
							
								
								
									
										2
									
								
								gradle/templates/mppJavaProject.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								gradle/templates/mppJavaProject.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| apply from: "$defaultProject" | ||||
| apply from: "$enableMPPJvm" | ||||
							
								
								
									
										2
									
								
								gradle/templates/mppJsProject.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								gradle/templates/mppJsProject.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| apply from: "$defaultProject" | ||||
| apply from: "$enableMPPJs" | ||||
							
								
								
									
										5
									
								
								gradle/templates/mppProjectWithSerialization.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								gradle/templates/mppProjectWithSerialization.gradle
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| apply from: "$defaultProjectWithSerialization" | ||||
| apply from: "$enableMPPJvm" | ||||
| apply from: "$enableMPPJs" | ||||
| apply from: "$enableMPPWasmJs" | ||||
| apply from: "$enableMPPAndroid" | ||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -1,5 +1,5 @@ | ||||
| distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip | ||||
| zipStoreBase=GRADLE_USER_HOME | ||||
| zipStorePath=wrapper/dists | ||||
|   | ||||
| @@ -4,5 +4,5 @@ plugins { | ||||
|     id "com.android.library" | ||||
| } | ||||
|  | ||||
| apply from: "$mppProjectWithSerializationPresetPath" | ||||
| apply from: "$mppProjectWithSerialization" | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| package project_group | ||||
| package project_group.project_name.lib | ||||
| 
 | ||||
| class Library { | ||||
|     fun someLibraryMethod(): Boolean { | ||||
| @@ -1,7 +1,7 @@ | ||||
| /* | ||||
|  * 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.assertTrue | ||||
| @@ -1 +0,0 @@ | ||||
| <manifest package="project_group.lib"/> | ||||
| @@ -1,34 +0,0 @@ | ||||
| project.version = "$version" | ||||
| project.group = "$group" | ||||
|  | ||||
| // apply from: "$publishGradlePath" | ||||
|  | ||||
| kotlin { | ||||
|     android { | ||||
|         publishAllLibraryVariants() | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         commonMain { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin | ||||
|                 api libs.kotlin.serialization | ||||
|             } | ||||
|         } | ||||
|         commonTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.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 | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| apply from: "$defaultAndroidSettingsPresetPath" | ||||
| @@ -1,39 +0,0 @@ | ||||
| project.version = "$version" | ||||
| project.group = "$group" | ||||
|  | ||||
| // apply from: "$publishGradlePath" | ||||
|  | ||||
| kotlin { | ||||
|     jvm { | ||||
|         compilations.main { | ||||
|             kotlinOptions { | ||||
|                 jvmTarget = "1.8" | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         commonMain { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin | ||||
|                 api libs.kotlin.serialization | ||||
|             } | ||||
|         } | ||||
|         commonTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.common | ||||
|                 implementation libs.kotlin.test.annotations.common | ||||
|             } | ||||
|         } | ||||
|         jvmTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.junit | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| java { | ||||
|     sourceCompatibility = JavaVersion.VERSION_1_8 | ||||
|     targetCompatibility = JavaVersion.VERSION_1_8 | ||||
| } | ||||
| @@ -1,32 +0,0 @@ | ||||
| project.version = "$version" | ||||
| project.group = "$group" | ||||
|  | ||||
| // apply from: "$publishGradlePath" | ||||
|  | ||||
| kotlin { | ||||
|     js (IR) { | ||||
|         browser() | ||||
|         nodejs() | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         commonMain { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin | ||||
|                 api libs.kotlin.serialization | ||||
|             } | ||||
|         } | ||||
|         commonTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.common | ||||
|                 implementation libs.kotlin.test.annotations.common | ||||
|             } | ||||
|         } | ||||
|         jsTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.js | ||||
|                 implementation libs.kotlin.test.junit | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,61 +0,0 @@ | ||||
| project.version = "$version" | ||||
| project.group = "$group" | ||||
|  | ||||
| // apply from: "$publishGradlePath" | ||||
|  | ||||
| kotlin { | ||||
|     jvm { | ||||
|         compilations.main { | ||||
|             kotlinOptions { | ||||
|                 jvmTarget = "1.8" | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     js (IR) { | ||||
|         browser() | ||||
|         nodejs() | ||||
|     } | ||||
|     android { | ||||
|         publishAllLibraryVariants() | ||||
|     } | ||||
|  | ||||
|     sourceSets { | ||||
|         commonMain { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin | ||||
|                 api libs.kotlin.serialization | ||||
|             } | ||||
|         } | ||||
|         commonTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.common | ||||
|                 implementation libs.kotlin.test.annotations.common | ||||
|             } | ||||
|         } | ||||
|         jvmTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.junit | ||||
|             } | ||||
|         } | ||||
|         jsTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.js | ||||
|                 implementation libs.kotlin.test.junit | ||||
|             } | ||||
|         } | ||||
|         androidTest { | ||||
|             dependencies { | ||||
|                 implementation libs.kotlin.test.junit | ||||
|                 implementation libs.android.test.junit | ||||
|                 implementation libs.android.test.espresso.core | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| java { | ||||
|     sourceCompatibility = JavaVersion.VERSION_1_8 | ||||
|     targetCompatibility = JavaVersion.VERSION_1_8 | ||||
| } | ||||
|  | ||||
| apply from: "$defaultAndroidSettingsPresetPath" | ||||
							
								
								
									
										6
									
								
								renovate.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								renovate.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| { | ||||
|   "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||||
|   "extends": [ | ||||
|     "config:recommended" | ||||
|   ] | ||||
| } | ||||
| @@ -14,5 +14,3 @@ includes.each { originalName -> | ||||
|     project.name = projectName | ||||
|     project.projectDir = new File(projectDirectory) | ||||
| } | ||||
|  | ||||
| enableFeaturePreview("VERSION_CATALOGS") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user