GithubHelp home page GithubHelp logo

nharbo / r.swift.plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quentinfasquel/r.swift.plugin

0.0 0.0 0.0 8 KB

A plugin to support R.swift in your own Swift packages

License: MIT License

Swift 100.00%

r.swift.plugin's Introduction

R.swift.Plugin

Use R.swift for resources in your own Swift package.

How ?

  1. This is a plugin for Swift Package Manager, which supports plugins since Swift 5.6, therefore the proper swift tools needs to be used

    // swift-tools-version:5.6

  2. You need two dependencies, R.swift.Library as usual, but also R.swift.Plugin

    dependencies: [
        .package(url: "https://github.com/mac-cain13/R.swift.Library", from: "5.4.0"),
        .package(url: "https://github.com/quentinfasquel/R.swift.Plugin", from: "5.4.0")
    ],
    
  3. Your target needs to link with R.swift.Library and use the plugin

    targets: [
        .target(
            name: "YourTarget",
            dependencies: [.product(name: "RswiftDynamic", package: "R.swift.Library")],
            resources: [
                .copy("someImage.png") // Resource example
            ],
            plugins: [.plugin(name: "RswiftPlugin", package: "R.swift.Plugin")]
        ),
    
  4. Use R.swift like before :

    let image = R.image.someImage()
    

--

More...

This plugin may not be bullet-proof since it was barely tested. It is awaiting to become officially supported by the official R.swift, here is what to know about how it works :

  • The SPM plugin uses an executable variant of the official R.swift. It is currently hosted through a github release built from this branch.

  • It uses --accessLevel public so that the resources of a package, and mostly R.validate(), are accessible in the package's test target.

  • The executable is slightly big (~ 24Mb) since it carries along a dependency on Swift Package Manager's own package model

  • Your feedback is welcome!

r.swift.plugin's People

Contributors

nharbo avatar quentinfasquel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.