{"id":20545491,"url":"https://github.com/eonist/resourcehelper","last_synced_at":"2025-04-14T10:12:12.988Z","repository":{"id":63909533,"uuid":"231759724","full_name":"eonist/ResourceHelper","owner":"eonist","description":"Enables you to use .bundle and other resources with SPM Unit-tests","archived":false,"fork":false,"pushed_at":"2021-09-09T14:00:44.000Z","size":29,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T23:24:50.542Z","etag":null,"topics":["asset","bundle","ci","continuous-integration","files","spm","swift-package-manager","testing","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eonist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-04T12:31:37.000Z","updated_at":"2023-09-03T00:59:48.000Z","dependencies_parsed_at":"2022-11-29T07:05:20.861Z","dependency_job_id":null,"html_url":"https://github.com/eonist/ResourceHelper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FResourceHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FResourceHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FResourceHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FResourceHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eonist","download_url":"https://codeload.github.com/eonist/ResourceHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860190,"owners_count":21173342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asset","bundle","ci","continuous-integration","files","spm","swift-package-manager","testing","unit-testing"],"created_at":"2024-11-16T01:52:24.747Z","updated_at":"2025-04-14T10:12:12.966Z","avatar_url":"https://github.com/eonist.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![mit](https://img.shields.io/badge/License-MIT-brightgreen.svg)\n![platform](https://img.shields.io/badge/Platform-macOS/iOS-blue.svg)\n![Lang](https://img.shields.io/badge/Language-Swift%205.12-orange.svg)\n[![SPM compatible](https://img.shields.io/badge/SPM-compatible-4BC51D.svg?style=flat)](https://github.com/apple/swift)\n[![codebeat badge](https://codebeat.co/badges/ccf5ea3a-46e7-4922-ae04-3168a07641b4)](https://codebeat.co/projects/github-com-eonist-resourcehelper-master)\n![Builds](https://github.com/eonist/ResourceHelper/workflows/Builds/badge.svg)\n\n# Features\n- Enables you to use .bundle and other resources with SPM Unit-tests. (Perfect for Github action CI)\n- Enables you to also use the same code in Xcode unit tests\n\n### Example code:\n```swift\n// The temp.bundle folder can be in the root of your project (same directory as your `Package.swift`)\n// iOS can only add resources inside .bundle folders\n// macOS can only read files within its SandBox. Turn off Sandbox in info.plist (Using swift 5.3 and native spm assets is a better option here)\nlet path: String = ResourceHelper.projectRootURL(projectRef: #file, fileName: \"temp.bundle/payload.json\").path\nSwift.print(\"path:  \\(path)\") // Users/John/Documents/AwesomeApp/temp.bundle/payload.json\n```\n\n**Note:** [Swift 5.3](https://github.com/apple/swift-evolution/blob/master/proposals/0271-package-manager-resources.md) has support for adding assets with SPM, although a bit cumbersome. here is a tutorial 😅:  [https://medium.com/better-programming/how-to-add-resources-in-swift-package-manager-c437d44ec593](https://medium.com/better-programming/how-to-add-resources-in-swift-package-manager-c437d44ec593)\n\n## Installation\n\n`ResourceHelper` is available using the [Swift Package Manager](https://swift.org/package-manager/):\n\nUsing Xcode 11, go to `File -\u003e Swift Packages -\u003e Add Package Dependency` and search for ResourceHelper or enter: https://github.com/eonist/ResourceHelper\n\nIf you are using `Package.swift`, you can also add `ResourceHelper` as a dependency easily.\n\n```swift\n\nlet package = Package(\n  name: \"TestProject\",\n  dependencies: [\n    .package(url: \"https://github.com/eonist/ResourceHelper.git\", .branch(\"master\"))\n  ],\n  targets: [\n    .target(name: \"TestProject\", dependencies: [\"ResourceHelper\"])\n  ]\n)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feonist%2Fresourcehelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feonist%2Fresourcehelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feonist%2Fresourcehelper/lists"}