कार्टाफिले से कार्टेज से सिर्फ एक लाइब्रेरी को कैसे अपडेट करें?


87

मेरे कार्टफाइल में कई पुस्तकालय हैं। जब मैं करता हूं तो carthage updateयह सभी पुस्तकालयों से होकर गुजरता है। इसमें बहुत लंबा समय लग सकता है।

क्या कार्टेज के साथ सिर्फ एक लाइब्रेरी को अपडेट करने का कोई तरीका है? कुछ इस तरह? (यह काम नहीं करेगा)

carthage update "evgenyneu/moa"

जवाबों:


150

से 0.12 संस्करण build , checkoutऔर updateअतिरिक्त स्थान निर्भरता की सूची अलग ले

निम्नलिखित की तरह एक Cartfile के लिए

github "Alamofire/Alamofire"
github "ReactiveX/RxSwift"

आप एक निर्भरता को अपडेट करने का विकल्प चुन सकते हैं

carthage update Alamofire

या कई निर्भरताएँ

carthage update Alamofire RxSwift

यदि आपको झंडे जोड़ने की आवश्यकता है, तो उन्हें अंतिम जोड़ें:

carthage update Alamofire --platform iOS

24
कार्थेज अद्यतन बॉक्स --no-उपयोग-बाइनरी --platform आईओएस // आप अतिरिक्त झंडे निर्दिष्ट करने की आवश्यकता है, तो
nalexn

@ एलेक्स सैलोम: बॉक्स कार्टफाइल में रेपो का नाम है? यह समझना आसान होगा कि क्या आपने अलमोफायर की तरह कुछ और परिचितों का उपयोग किया है? और परिणाम भाग क्या है? एक और रेपो नाम या?
eonist

1
@GitSyncApp, हाँ, आपको रिक्त स्थान से अलग निर्भरता के नाम लिखना होगा। मैंने अपना उत्तर संपादित किया
एलेक्स सैलोम

@ MartinRomañuk वास्तव में क्या काम नहीं करता है? मैंने सिर्फ ऊपर के उदाहरण की कोशिश की है carthage bootstrapऔर यह केवल कार्टफाइल में परिभाषित दो में से एक निर्भरता को संसाधित करता है। स्क्रीनशॉट पर एक नज़र मेरी टर्मिनल से ले लो pasteboard.co/I9bARyq.png
एलेक्स सलोम

@AlexSalom निष्पक्ष होने के लिए, आप उपयोग कर रहे हैं, bootstrapजबकि उत्तर उपयोग करने के लिए कहता है update। साथ bootstrapआप डाउनलोड कर रहे हैं जो कुछ भी Carfile.resolvedकहते हैं, यह अपडेट नहीं होगा।
लुलिस जेरार्ड

13

कार्थेज अब एकल निर्भरता को अद्यतन करने का समर्थन करता है। यदि आपके कार्टफाइल में ऐसा कुछ है:

github "bitstadium/HockeySDK-iOS"

तब आप केवल एक निर्भरता को अपडेट करके चला सकते हैं

carthage update HockeySDK-iOS

9

अभी जवाब नहीं है ... यदि आपका रन carthage help updateआपको दिखाई देगा

Update and rebuild the project's dependencies

[--configuration Release]
    the Xcode configuration to build (ignored if --no-build option is present)

[--platform all]
    the platform to build for (ignored if --no-build option is present)

[--verbose]
    print xcodebuild output inline (ignored if --no-build option is present)

[--no-build]
    skip the building of dependencies after updating

[--use-ssh]
    use SSH for downloading GitHub repositories

[--use-submodules]
    add dependencies as Git submodules

[--no-use-binaries]
    check out dependency repositories even when prebuilt frameworks exist (ignored if --no-build option is present)

[--color auto]
    whether to apply color and terminal formatting (one of ‘auto’, ‘always’, or ‘never’)

[/path/to/your/app]
    the directory containing the Carthage project

जैसा कि आप देख सकते हैं कि अद्यतन करने के लिए केवल एक निर्भरता निर्दिष्ट करने के विकल्प का कोई उल्लेख नहीं है।

आपको उस परियोजना रेपो पर एक मुद्दा खोलना चाहिए जो समर्थन करने के लिए कह रहा है।


9

यदि GitHub में फ्रेमवर्क संग्रहीत नहीं है, या आप gitपहचानकर्ता का उपयोग कर रहे हैं , और आपका cartfileऐसा दिखता है:

git "ssh://git@bitbucket.org/teamname/repo-name.git" ~> 1.0

तब आप केवल यह ही अपडेट कर सकते हैं कि निम्नलिखित कमांड चल रही है

carthage update repo-name

6

मैंने सभी उत्तरों की कोशिश की, और मेरे लिए केवल हटाने या टिप्पणी करने के लिए अस्थायी रूप से रिपॉजिटरी और चलाने के बाद

carthage update --platform ios

के बाद मैं पिछले राज्य के लिए Catfile को पुनर्स्थापित करता हूं


5

मैंने अपनी स्क्रिप्ट लिखना समाप्त कर दिया, जो मेरे लिए एक एकल निर्भरता बनाता है और इसे मेरी मौजूदा निर्भरता के साथ विलय करता है। आप इसे https://github.com/ruipfcosta/carthage-workarounds पर पा सकते हैं ।


0

स्विफ्ट 5

//MARK:- Step 1
carthage update KeychainAccess --platform iOS

carthage update SDKNAME(like i mention KeychainAccess upper) --platform iOS

यदि आप इस तरह एक त्रुटि का सामना करते हैं

//MARK:- If this error occur
error: unable to find utility "xcodebuild", not a developer tool or in PATH

फिर टर्मिनल 1 में भाग 1 का उपयोग करें

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

और फिर

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

0

[कार्टेज अपडेट फ्लो]

carthage [update|bootstrap|checkout|build] [dependency1] [dependency2] [--no-use-binaries] [--platform <name>]

//--no-use-binaries - does not use prebuild binary and use source code
//--platform - specify a platform

सबसे लंबा चरण एक buildकदम है [xcodebuild] क्योंकि:

  1. fat binary[के बारे में] का उपयोग कर बनाया गया हैlipo
  2. कार्थेज shared frameworks schemesएक परियोजना का निर्माण करता है। यदि आप जानते हैं कि आपको कौन से स्कीमा की आवश्यकता है:

    • xcschemesफ़ोल्डर में विशिष्ट योजनाओं को छोड़ दें.../Carthage/Checkouts/<dependency>/<project>.xcodeproj/xcshareddata/xcschemes/<schema>.xcscheme

    • Carthage/Checkoutsफ़ोल्डर से निर्मित प्रोजेक्ट खोलें -> योजनाएँ प्रबंधित करें ... -> विशिष्ट योजनाएँ छोड़ें


0

ऐसा लगता है कि carthage update repo-nameकाम नहीं करता है Carthage 0.36.0। मैंने मैन्युअल रूप से अपडेट करके इस समस्या को हल किया है Carthage.resolved। उदाहरण के लिए, Cartfileएक नई निर्भरता में जोड़ें :

github "konkab/AlamofireNetworkActivityLogger" ~> 3.0.0

Cartfile.resolvedमैन्युअल रूप से एक नई निर्भरता में जोड़ें :

github "konkab/AlamofireNetworkActivityLogger" "3.0.0"

फिर carthage bootstrapकेवल एक निर्भरता को अपडेट करने के लिए करें:

carthage bootstrap

यह उपयोग करेगा Carthage.resolvedऔर सिर्फ एक निर्भरता को जोड़ेगा।

हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.