artisinal-pickle-maker


License

License

GroupId

GroupId

com.julianpeeters
ArtifactId

ArtifactId

artisinal-pickle-maker_2.10
Last Version

Last Version

0.5
Release Date

Release Date

Type

Type

jar
Description

Description

artisinal-pickle-maker
artisinal-pickle-maker
Project URL

Project URL

https://github.com/julianpeeters/artisinal-pickle-maker
Project Organization

Project Organization

com.julianpeeters

Download artisinal-pickle-maker_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.julianpeeters/artisinal-pickle-maker_2.10/ -->
<dependency>
    <groupId>com.julianpeeters</groupId>
    <artifactId>artisinal-pickle-maker_2.10</artifactId>
    <version>0.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.julianpeeters/artisinal-pickle-maker_2.10/
implementation 'com.julianpeeters:artisinal-pickle-maker_2.10:0.5'
// https://jarcasting.com/artifacts/com.julianpeeters/artisinal-pickle-maker_2.10/
implementation ("com.julianpeeters:artisinal-pickle-maker_2.10:0.5")
'com.julianpeeters:artisinal-pickle-maker_2.10:jar:0.5'
<dependency org="com.julianpeeters" name="artisinal-pickle-maker_2.10" rev="0.5">
  <artifact name="artisinal-pickle-maker_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.julianpeeters', module='artisinal-pickle-maker_2.10', version='0.5')
)
libraryDependencies += "com.julianpeeters" % "artisinal-pickle-maker_2.10" % "0.5"
[com.julianpeeters/artisinal-pickle-maker_2.10 "0.5"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.3
org.scala-lang : scala-compiler jar 2.10.2

test (2)

Group / Artifact Type Version
org.specs2 : specs2_2.10 jar 2.2
com.novus : salat_2.10 jar 1.9.3

Project Modules

There are no modules declared in this project.

Artisanal-Pickle-Maker

Make your own Scala pickled signatures.

Takes class info as strings and gives back pickled Scala signatures. For use with Java bytecode engineering libraries.

Why? Because existing Java bytecode-engineering tools can't see or alter a pickled Scala signature, thus the altered classes are incomplete in cases where Scala code has no Java equivalent. Artisanal-Pickle-Maker hopes to solve this by updating an altered class's Scala signtature to reflect changes made to the bytecode.

##Usage:## Available for Scala 2.11 (see branches for other supported versions). Build Status

Add the following dependency to your build.sbt file:

libraryDependencies += "com.julianpeeters" %% "artisanal-pickle-maker" % "0.10.1"

Get an artisanal.pickle.maker.ScalaSig with:

val scalaSig = new ScalaSig(List("case class"), List("mypackage", "MyRecord"), List(("x", "String"), ("y", "Option[Int]"))

scalaSig.bytes gives the encoded bytes as a UTF-8 String. This is the normal storage format of a natural pickled Scala signature.

Thus, scalaSig.bytes is identical to the encoded string that would be found in the ScalaSignature annotation of the conventionally defined class:

    `package models`
    `case class MyRecord(x: String, y: Option[Int])`

##Currently supports:## Are you generating or modifying Scala classes with ASM or another bytecode engineering library? Then add an updated pickled sig and make your class whole!

Classes - The generation of Scala sigs for regular and case classes that have value members only (signatures will not reflect user-defined defs, i.e., this doesn't yet support classes with defs due to concerns of hygiene).

Datatypes -

  • Byte
  • Short
  • Int
  • Long
  • Float
  • Double
  • Char
  • String
  • Boolean
  • Null
  • Nothing
  • Any
  • AnyRef
  • List
  • Option
  • user-defined (i.e. other classes)

##In the future:##

Datatypes - Support for more collections besides just List and Option

Extension - Support for flags that allow arbitrary extension (?)

Classes - Support for flags other than "case class" (?)

##Constructive advice is appreciated!##

Versions

Version
0.5
0.3