build.zig.zon ve Paket Yöneticisi
Bağımlılıkları bir bildirim dosyasında tanımlayın.
build.zig.zon ve Paket Yöneticisi, CoddyKit'te ücretsiz bir Zig Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Zig Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Zig Academy kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
A Manifest for Your Package
Beside build.zig sits build.zig.zon, the manifest that names your package and lists what it depends on. 📜
ZON Is Zig Object Notation
The file is written in ZON, which looks just like a Zig anonymous struct literal. Dotted field names map to plain Zig values.
.{
.name = .myapp,
.version = "0.1.0",
}Name and Version
Two required fields stand out: name identifies the package and version follows semantic versioning like 1.2.0.
.name = .myapp,
.version = "0.1.0",List Your Dependencies
The dependencies field is a struct of entries, one per external package you want to pull into your build.
.dependencies = .{
.mylib = .{},
},A URL Points to the Source
Each dependency gives a url to a tarball, usually a tagged archive on a code host. Zig fetches and unpacks it for you.
.url = "https://example.com/mylib-1.0.0.tar.gz",The hash Locks It Down
A hash field pins the exact bytes of that download. If the content ever changes, the hash mismatches and the build refuses it.
.hash = "122012ab...",Let zig fetch Fill It In
You rarely type a hash by hand. Run zig fetch with the url and it downloads, computes the hash, and writes the entry for you.
zig fetch --save https://example.com/mylib-1.0.0.tar.gzThe Global Cache
Fetched packages land in a shared cache on your machine. Many projects reuse one copy, so the same dependency is not stored twice.
paths Declares What Ships
The paths field lists the files included when your package is itself a dependency. Use .{""} to ship everything in the folder.
.paths = .{ "build.zig", "src" },Commit the Manifest
Because it carries exact hashes, build.zig.zon makes builds reproducible. Commit it so every teammate fetches the identical code.
build.zig Reads It
The manifest pairs with build.zig, which turns each declared dependency into a usable module. The .zon describes, the build script wires.
const dep = b.dependency("mylib", .{});Quick Check
Recall what guarantees a dependency download has not been tampered with.
Recap
You met build.zig.zon: a ZON manifest with name, version, and dependencies, where each dep carries a url and a hash that zig fetch can fill in. 🎯
Sıkça Sorulan Sorular
“build.zig.zon ve Paket Yöneticisi” dersi ücretsiz mi?
Evet — “build.zig.zon ve Paket Yöneticisi” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Zig Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Zig Academy kursu toplamda 4 dersten oluşur.
“build.zig.zon ve Paket Yöneticisi” dersinde ne öğreneceğim?
Bağımlılıkları bir bildirim dosyasında tanımlayın. Zig Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Zig Academy öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Zig Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.
“build.zig.zon ve Paket Yöneticisi” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Zig Academy dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Zig Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- @import ile Dosyaları İçe Aktarma
- Çok Dosyalı Projeyi Yapılandırma
- build.zig.zon ve Paket Yöneticisi
- Üçüncü Taraf Modülü Ekleme