الإصدار إلى Maven Central وSPM
وزّع الحزمة عبر Maven Central وSwift Package Manager.
الإصدار إلى Maven Central وSPM درس مجاني في Kotlin Multiplatform Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Kotlin Multiplatform Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Reach Both Ecosystems
Android devs pull libraries from Maven Central, while iOS devs prefer Swift Package Manager. A great KMP release serves both. 🌍
Claim Your Group
Maven Central verifies you own your group id, usually a reversed domain. This stops anyone else from publishing under your name.
group = "io.github.coddykit"Sign Your Artifacts
Central requires every file to be signed with a GPG key. The signature proves the artifact really came from you and was not tampered with.
plugins { id("signing") }Meet the Requirements
Central rejects incomplete releases. You must include sources, docs, and a POM with name, description, license, and developer details.
Point at the Central Repo
Add the Central repository with your portal credentials. The Gradle publish task then uploads every signed artifact to the staging area.
Publish and Release
Run publish to upload, then promote the staged version in the portal. After indexing, anyone can declare it as a dependency.
./gradlew publishAllPublicationsToCentralRepositoryNow Serve Swift
Swift Package Manager needs a Package.swift manifest that points at your XCFramework. This is how iOS devs add your library.
Host the Binary
Upload the zipped XCFramework to a stable url, often a GitHub release. SPM downloads it from there when someone adds the package.
Describe a Binary Target
In the manifest, declare a binaryTarget with the download url and the bundle checksum so SPM can verify the file.
.binaryTarget(
name: "Shared",
url: "...xcframework.zip",
checksum: "abc123"
)Tag a Release
SPM resolves versions from git tags. Tag the repo to match your library version so consumers can pin an exact release.
git tag 1.0.0Automate Future Releases
Manual steps drift over time. Move publishing into CI so every tagged commit signs, uploads, and updates both ecosystems the same way.
Quick Check
Let's check your release knowledge.
Recap
Sign and publish to Maven Central for Android, then host an XCFramework with a Package.swift for SPM, and automate it all in CI. 🎉
الأسئلة الشائعة
هل درس «الإصدار إلى Maven Central وSPM» مجاني؟
نعم — نص درس «الإصدار إلى Maven Central وSPM» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Kotlin Multiplatform Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.
ماذا ستتعلم في «الإصدار إلى Maven Central وSPM»؟
وزّع الحزمة عبر Maven Central وSwift Package Manager. تتمرن على Kotlin Multiplatform Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Kotlin Multiplatform Academy؟
لا تُشترط خبرة سابقة. Kotlin Multiplatform Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «الإصدار إلى Maven Central وSPM»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Kotlin Multiplatform Academy هذا؟
نعم. كل درس في Kotlin Multiplatform Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- تهيئة maven-publish لـ KMP
- إصدار XCFramework لـ iOS
- إدارة الإصدارات واستقرار API
- الإصدار إلى Maven Central وSPM