Richard-W / scalacrypt

Provides various cryptographic functions for scala.
Apache License 2.0
12 stars 4 forks source link

scalajs support #1

Open antonkulaga opened 8 years ago

antonkulaga commented 8 years ago

I thikn scalajs support will be useful for some usecases. As you do not use any jvm dependnecies moving library to cross-project should not be hard.

Richard-W commented 8 years ago

I will do that in the near future. Thanks for the hint to the plugin. Problem is that sbt-pgp stops to work when including the cross-project plugin. It breaks publishing to maven-central.

You were right though. Scalacrypt compiles without any issues (at first glance) using scala.js.

antonkulaga commented 8 years ago

roblem is that sbt-pgp stops to work when including the cross-project plugin

I personally do not use sbt-pgp, but I can look at your sbt configuration. Crossproject is not an sbt project but a wrapper that creates two sbt projects (one for JVM and one for JS). Try to run sbt-pgp on JVM and JS projects separately and check if it works (if yes, then you will aggregate these two projects from sbt root project).

P.S. I hope you did not forget to update scalatest to the latest milestone to run tests on both scalaJVM/JS

libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.0-M7"
Richard-W commented 8 years ago

Pushed changes to branch wip/scalajs-support. Tests are still failing, but i'll try to get it to work soon.

antonkulaga commented 8 years ago

General rule of porting an app to scalajs is to: avoid runtime relfection, check semantic of regex (there are small differences between scalajs and scalajvm) and check all java parts that are used. I noticed that you have usage of java.security in your code. I am not totally sure that all java.security was ported to scalajs, so it makes sence to check it or ask scalajs core devs about it ( the are active in https://gitter.im/scala-js/scala-js gitter channel)