{"id":13537433,"url":"https://github.com/icerockdev/mobile-multiplatform-gradle-plugin","last_synced_at":"2025-08-11T07:38:25.499Z","repository":{"id":43354598,"uuid":"204842896","full_name":"icerockdev/mobile-multiplatform-gradle-plugin","owner":"icerockdev","description":"Gradle plugin for simplify Kotlin Multiplatform mobile configurations","archived":false,"fork":false,"pushed_at":"2024-09-29T16:22:18.000Z","size":189,"stargazers_count":94,"open_issues_count":7,"forks_count":16,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-03T02:32:56.940Z","etag":null,"topics":["android","gradle-plugin","ios","kotlin-multiplatform","kotlin-native"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icerockdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-28T03:46:06.000Z","updated_at":"2024-10-15T00:43:58.000Z","dependencies_parsed_at":"2023-01-18T10:33:06.140Z","dependency_job_id":null,"html_url":"https://github.com/icerockdev/mobile-multiplatform-gradle-plugin","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmobile-multiplatform-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmobile-multiplatform-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmobile-multiplatform-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmobile-multiplatform-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icerockdev","download_url":"https://codeload.github.com/icerockdev/mobile-multiplatform-gradle-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246756929,"owners_count":20828798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","gradle-plugin","ios","kotlin-multiplatform","kotlin-native"],"created_at":"2024-08-01T09:00:59.025Z","updated_at":"2025-04-02T04:30:43.771Z","avatar_url":"https://github.com/icerockdev.png","language":"Kotlin","readme":"![mobile-multiplatform](https://user-images.githubusercontent.com/5010169/100611874-9aa17f80-3344-11eb-9737-c50ba63b0f6e.png)  \n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock/mobile-multiplatform) ](https://repo1.maven.org/maven2/dev/icerock/mobile-multiplatform)\n\n# Mobile Multiplatform gradle plugin\nThis is a Gradle plugin for simple setup of Kotlin Multiplatform mobile Gradle modules.  \n\n## Setup\n`buildSrc/build.gradle.kts`\n```kotlin\nrepositories {\n    google()\n    gradlePluginPortal()\n}\n\ndependencies {\n    implementation(\"dev.icerock:mobile-multiplatform:0.14.4\")\n    implementation(\"org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25\")\n    implementation(\"com.android.tools.build:gradle:8.3.2\")\n}\n```\n\n## Usage\n### Setup mobile targets without config\n`build.gradle.kts`\n```kotlin\nplugins {\n    id(\"com.android.library\")\n    id(\"org.jetbrains.kotlin.multiplatform\")\n    id(\"dev.icerock.mobile.multiplatform.targets\")\n}\n```\n\nPlugin automatically setup android, ios targets.\nAndroid target also automatically configured with `dev.icerock.mobile.multiplatform.android-manifest` \nand `dev.icerock.mobile.multiplatform.android-sources` plugins.\n\nBy default used `ios()` targets creation with intermediate source set `iosMain`. To disable it add\ninto `gradle.properties` line:\n```\nmobile.multiplatform.useIosShortcut=false\n```\n\nAlso by default `iosSimulatorArm64` target will be created (with connection to `iosMain` and\n `iosTest` if was used ios shortcut. To disable it add into `gradle.properties` line:\n```\nmobile.multiplatform.withoutIosSimulatorArm64=false\n```\n\n### Setup AndroidManifest.xml in androidMain sourceSet\n`build.gradle.kts`\n```kotlin\nplugins {\n    id(\"dev.icerock.mobile.multiplatform.android-manifest\")\n}\n```\n\nAfter enable this plugin you can move `AndroidManifest.xml` from `src/main/AndroidManifest.xml` to\n`src/androidMain/AndroidManifest.xml`\n\n### Setup android sourceSets in android prefixed source sets\n`build.gradle.kts`\n```kotlin\nplugins {\n    id(\"dev.icerock.mobile.multiplatform.android-sources\")\n}\n```\n\nAfter enable this plugin you can move android's `main` source set to `androidMain`, `release` \nto `androidRelease`, `test` to `androidTest` etc.\n\n### Setup cocoapods integration for iOS\n`build.gradle.kts`\n```kotlin\nplugins {\n    id(\"dev.icerock.mobile.multiplatform.ios-framework\")\n}\n```\n\nPlugin will setup `sync` gradle tasks in group `cocoapods` for `cocoapods` integration.\n\nExample of `podspec` for integration here - https://github.com/icerockdev/moko-template/blob/master/mpp-library/MultiPlatformLibrary.podspec\n\n#### Add artifacts to export\n```kotlin\n// optional for export dependencies into framework header\nframework {\n    export(project = project(\":myproject\"))\n    export(kotlinNativeExportable = MultiPlatfomLibrary(\u003c...\u003e))\n    export(kotlinNativeExportable = MultiPlatfomModule(\u003c...\u003e))\n    export(arm64Dependency = \"my.group:name-iosarm64:0.1.0\", x64Dependency = \"my.group:name-iosx64:0.1.0\")\n    export(artifact = \"my.group:name:0.1.0\") // common artifact\n    export(provider = libs.myLib) // gradle 7 version catalog libraries accessors\n}\n```\n\n### Setup cocoapods integration for all Apple frameworks\n`build.gradle.kts`\n```kotlin\nplugins {\n    id(\"dev.icerock.mobile.multiplatform.apple-framework\")\n}\n```\n\nwith `framework` configuration you can add dependencies to export (just like in iOS framework).\n\n### Setup CocoaPods interop\n`build.gradle.kts`\n```kotlin\nplugins {\n    id(\"dev.icerock.mobile.multiplatform.cocoapods\")\n}\n\ncocoaPods {\n    podsProject = file(\"../ios-app/Pods/Pods.xcodeproj\") // here should be path to your Pods project\n    buildConfiguration = \"dev-debug\" // optional, default is \"debug\"\n\n    pod(\"MBProgressHUD\") // create cInterop and link with CocoaPod where schema and module is same\n    pod(schema = \"moko-widgets-flat\", module = \"mokoWidgetsFlat\") // create cInterop and link with CocoaPod where schema and module is different\n    pod(schema = \"moko-widgets-flat\", module = \"mokoWidgetsFlat\", onlyLink = true) // not create cInterop - just link framework with this CocoaPod\n}\n```\n\nAlso path to Pods project and configuration can be set globally into `gradle.properties`\n```properties\nmobile.multiplatform.podsProject=ios-app/Pods/Pods.xcodeproj\nmobile.multiplatform.podsConfiguration=dev-debug\n```\n`podsProject` should be relative path from root gradle project.\n\n### Multiple plugins in one line (deprecated, saved for backward compatibility)\n```kotlin\nplugins { \n    id(\"dev.icerock.mobile.multiplatform\")\n}\n```\nThis line will enable:\n- `dev.icerock.mobile.multiplatform.cocoapods`\n- `dev.icerock.mobile.multiplatform.targets`\n- publish of android build variants - `release` and `debug`\n\n### Definition of dependencies (deprecated, saved for backward compatibility)\n```kotlin\nval mokoTime = MultiPlatformLibrary(\n    android = \"dev.icerock.moko:time-android:0.1.0\",\n    common = \"dev.icerock.moko:time:0.1.0\",\n    iosX64 = \"dev.icerock.moko:time-iosx64:0.1.0\",\n    iosArm64 = \"dev.icerock.moko:time-iosarm64:0.1.0\"\n)\n\nval appCompat = AndroidLibrary(\n    name = \"androidx.appcompat:appcompat:1.1.0\"\n)\n\nval myFeature = MultiPlatformModule(\n    name = \":mpp-library:feature:myFeature\"\n)\n```\n\n### Setup dependencies (deprecated, saved for backward compatibility)\n`build.gradle.kts`\n```kotlin\ndependencies {\n    mppLibrary(mokoTime)\n    androidLibrary(appCompat)\n    mppModule(myFeature)\n}\n```\n\n## License\n        \n    Copyright 2019 IceRock MAG Inc.\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n       http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Build \u0026 Development Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmobile-multiplatform-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficerockdev%2Fmobile-multiplatform-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmobile-multiplatform-gradle-plugin/lists"}