GithubHelp home page GithubHelp logo

isabella232 / k2v8 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from salesforce/k2v8

0.0 0.0 0.0 259 KB

Library for converting objects between Kotlin and J2V8

License: BSD 3-Clause "New" or "Revised" License

Kotlin 100.00%

k2v8's Introduction

K2V8

Android

K2V8 is a de/serialization library for converting between Kotlin objects and J2V8 V8Objects.

K2V8 uses Kotlin Serialization for the serialization strategy.

Usage

    @Serializable
    data class ExampleClass (
        val value: String
    )

    val fromObject = ExampleClass("foo")
    val v8 = V8.createV8Runtime()
    
    // Initialize K2V8 with an instance of the V8 Runtime
    val k2V8 = K2V8(Configuration(v8))
    val serializer = ExampleClass.serializer()
    
    // Call toV8 and fromV8 with the serializer to use and the source object
    val v8Object = k2V8.toV8(serializer, fromObject)
    val kotlinObject = k2V8.fromV8(serializer, v8Object)

Consuming

Add dependency in build.gradle

dependencies {
    implementation("com.salesforce.k2v8:k2v8:$k2v8_version")
    //  optionally J2V8 can be excluded to use specific/newer version
    //  { exclude group: "com.eclipsesource.j2v8" }
}

Publishing

To publish a new version

  1. Update the VERSION in (gradle.properties](gradle.properties#L15)
  2. Commit changes
  3. ./gradlew createTag (creates a tag locally and pushes to github)
  4. ./gradlew bintrayUpload (builds latest and publishes to bintray)

k2v8's People

Contributors

ben-zhang-at-salesforce avatar jamie-houston avatar mattkranzler5 avatar nadeem-sfdc avatar svc-scm avatar threeve 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.