├── README.md ├── VendorPackages ├── _Proxy │ ├── Sources │ │ └── VendorPackages │ │ │ └── VendorPackages.swift │ └── Package.swift ├── Package.swift └── refre.sh └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # spm-local 2 | 3 | `cd VendorPackages` 4 | `./refre.sh` -------------------------------------------------------------------------------- /VendorPackages/_Proxy/Sources/VendorPackages/VendorPackages.swift: -------------------------------------------------------------------------------- 1 | // The Swift Programming Language 2 | // https://docs.swift.org/swift-book 3 | -------------------------------------------------------------------------------- /VendorPackages/_Proxy/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.8 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "VendorPackages", 8 | platforms: [ 9 | .iOS(.v15), 10 | .macOS(.v12), 11 | ], 12 | products: [ 13 | .library( 14 | name: "VendorPackages", 15 | targets: ["VendorPackages"] 16 | ), 17 | ], 18 | dependencies: [ 19 | .package( 20 | url: "https://github.com/devicekit/DeviceKit.git", 21 | exact: "5.0.0" 22 | ), 23 | .package( 24 | url: "https://github.com/kean/Nuke.git", 25 | exact: "12.1.2" 26 | ), 27 | .package( 28 | url: "https://github.com/groue/GRDB.swift.git", 29 | exact: "6.15.1" 30 | ), 31 | .package( 32 | url: "https://github.com/SnapKit/SnapKit", 33 | exact: "5.6.0" 34 | ), 35 | .package( 36 | url: "https://github.com/airbnb/lottie-ios", 37 | exact: "4.2.0" 38 | ), 39 | ], 40 | targets: [ 41 | .target( 42 | name: "VendorPackages", 43 | dependencies: [ 44 | "DeviceKit", 45 | .product(name: "Nuke", package: "Nuke"), 46 | .product(name: "NukeUI", package: "Nuke"), 47 | .product(name: "NukeExtensions", package: "Nuke"), 48 | "SnapKit", 49 | .product(name: "GRDB", package: "GRDB.swift"), 50 | .product(name: "Lottie", package: "lottie-ios"), 51 | ] 52 | ), 53 | ] 54 | ) 55 | -------------------------------------------------------------------------------- /VendorPackages/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.7 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "VendorPackages", 8 | platforms: [ 9 | .iOS(.v15), 10 | .macOS(.v12), 11 | ], 12 | products: [ 13 | .library(name: "DeviceKit", targets: ["DeviceKit"]), 14 | .library(name: "GRDB", targets: ["GRDB"]), 15 | .library(name: "Lottie", targets: ["Lottie"]), 16 | .library(name: "Nuke", targets: ["Nuke"]), 17 | .library(name: "NukeUI", targets: ["NukeUI"]), 18 | .library(name: "NukeExtensions", targets: ["NukeExtensions"]), 19 | .library(name: "SnapKit", targets: ["SnapKit"]), 20 | ], 21 | targets: [ 22 | .target( 23 | name: "DeviceKit", 24 | path: "Sources/DeviceKit/Source" 25 | ), 26 | .target( 27 | name: "Nuke", 28 | path: "Sources/Nuke/Sources/Nuke" 29 | ), 30 | .target( 31 | name: "NukeUI", 32 | dependencies: ["Nuke"], 33 | path: "Sources/Nuke/Sources/NukeUI" 34 | ), 35 | .target( 36 | name: "NukeExtensions", 37 | dependencies: ["Nuke"], 38 | path: "Sources/Nuke/Sources/NukeExtensions" 39 | ), 40 | .target( 41 | name: "GRDB", 42 | dependencies: ["CSQLite"], 43 | path: "Sources/GRDB.swift/GRDB" 44 | ), 45 | .systemLibrary( 46 | name: "CSQLite", 47 | path: "Sources/GRDB.swift/Sources/CSQLite" 48 | ), 49 | .target( 50 | name: "Lottie", 51 | path: "Sources/lottie-ios/Sources" 52 | ), 53 | .target( 54 | name: "SnapKit", 55 | path: "Sources/SnapKit/Sources" 56 | ), 57 | ], 58 | swiftLanguageVersions: [.v5] 59 | ) 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | .DS_Store 92 | VendorPackages/Sources 93 | *.resolved 94 | -------------------------------------------------------------------------------- /VendorPackages/refre.sh: -------------------------------------------------------------------------------- 1 | if ! which jq > /dev/null 2>&1; then 2 | brew install jq 3 | fi 4 | 5 | rm -rf Sources && mkdir -p Sources 6 | 7 | cd _Proxy 8 | 9 | rm -rf .build .swiftpm Package.resolved 10 | 11 | swift package update 12 | 13 | required_products=$(swift package describe --type json | jq -c '.targets[] | .product_dependencies[]') 14 | 15 | for repo in $(ls .build/checkouts); do 16 | echo $repo 17 | 18 | mkdir -p ../Sources/$repo 19 | 20 | cp -r .build/checkouts/$repo/Package.swift ../Sources/$repo/_Package.swift 21 | 22 | package_json=$(swift package --package-path .build/checkouts/$repo describe --type json | jq -c) 23 | 24 | targets=$(jq -c '(.targets[] | select(.product_memberships != null))' <<< $package_json) 25 | 26 | echo "$package_json" | jq -c '(.targets[] | select(.product_memberships != null))' | while read -r target; do 27 | required_target=false 28 | 29 | target_products=$(jq -c '.product_memberships[]' <<< "$target") 30 | 31 | for target_product in $target_products; do 32 | for required_product in $required_products; do 33 | if [ $required_product == $target_product ]; then 34 | required_target=true 35 | fi 36 | done 37 | done 38 | 39 | if ! $required_target; then 40 | continue 41 | fi 42 | 43 | name=$(jq -r '.name' <<< $target) 44 | path=$(jq -r '.path' <<< $target) 45 | type=$(jq -r '.type' <<< $target) 46 | 47 | if [ $type == "system-target" ]; then 48 | mkdir -p ../Sources/$repo/$path 49 | cp -r .build/checkouts/$repo/$path/. ../Sources/$repo/$path 50 | fi 51 | 52 | if [ $type == "library" ]; then 53 | echo "$target" | jq --raw-output 'if has("resources") then (.resources[] | .path) else null end' | while read -r resource; do 54 | if [ "$resource" == "null" ]; then 55 | continue 56 | fi 57 | resource_path="${resource##*.build/checkouts/$repo/$path/}" 58 | mkdir -p ../Sources/$repo/$path/"$(dirname "$resource_path")" 59 | cp .build/checkouts/$repo/$path/"$resource_path" ../Sources/$repo/$path/"$resource_path" 60 | done 61 | 62 | echo "$target" | jq --raw-output '.sources[]' | while read -r source; do 63 | mkdir -p ../Sources/$repo/$path/"$(dirname "$source")" 64 | cp .build/checkouts/$repo/$path/"$source" ../Sources/$repo/$path/"$source" 65 | done 66 | fi 67 | done 68 | done 69 | 70 | rm -rf .build .swiftpm Package.resolved 71 | --------------------------------------------------------------------------------