Section 2/171 menit
2. Masalah yang Dipecahkan di Level Lanjutan
2. Masalah yang Dipecahkan di Level Lanjutan
Inconsistency Arsitektur di Tim Besar
swift
// ❌ TANPA Tuist scaffolding: developer baru membuat module secara manual
// Module A (developer senior):
// - SWIFT_VERSION = 6.0
// - strict concurrency
// - test target included
//
// Module B (developer baru):
// - SWIFT_VERSION = 5.9 (lupa update)
// - no strict concurrency
// - test target missing
//
// Setelah 3 bulan: 20 module dengan konfigurasi yang berbeda-beda
swift
// ✓ DENGAN Tuist scaffold: satu template, semua module konsisten
// $ tuist scaffold feature --name FeaturePayment
//
// → Otomatis generate:
// Projects/Features/FeaturePayment/
// ├── Project.swift (dari template)
// ├── Sources/FeaturePayment/FeaturePaymentView.swift
// └── Tests/FeaturePaymentTests/FeaturePaymentTests.swift
//
// Semua module dari template memiliki konfigurasi identik
Build Time CI yang Tidak Berkurang Meski Pakai Cache
swift
# ❌ TANPA pemahaman cache key Tuist:
# Developer: "Kenapa CI masih lambat padahal sudah pakai tuist cache?"
#
# Sebab: cache miss karena hash berubah akibat:
# - Xcode version berbeda di CI vs local
# - Environment variable yang tidak di-isolate
# - Build setting yang tidak deterministik
# Solusi: perlu pahami apa yang masuk ke hash calculation
swift
# ✓ DENGAN pemahaman cache key:
# tuist cache --print-hashes ← lihat hash tiap target
# Hash berdasarkan: source files + dependencies + build settings + Xcode version
# CI dan local harus pakai Xcode version yang sama → .xcode-version file
Circular Dependencies yang Baru Ketahuan Saat Build
swift
// ❌ TANPA graph enforcement:
// FeatureCheckout bergantung ke FeatureCart
// FeatureCart bergantung ke FeatureCheckout
// → Tidak ketahuan sampai Xcode gagal build
// ✓ DENGAN tuist inspect implicit-imports:
// Tuist mendeteksi dependency cycle saat generate
// → Tidak perlu menunggu sampai build time