Preliminary support for scala.js

Review Request #2453 - Created July 10, 2015 and submitted

Information
Stu Hood
pants
2737
1378453...
Reviewers
pants-reviews
benjyw, fkorotkov, gmalmquist, jsirois, nhoward_tw, patricklaw, tejal

This review includes integration of scala/scala.js with the node.js contrib module, to allow cross compiling and running a Javascript binary via node.js.

  • Add scalajs contrib module
  • Split a base class out of ZincCompile
  • Add a ScalaJSZincCompile subclass which forces the ScalaJS compiler plugin
  • Add ScalaJSLink to generate javascript as resources via scalajsld, which can be bundled into dependent targets.
  • Add scala_js_binary and scala_js_library targets: this supports the "macro centric" approach to cross compilation, where if you wanted to cross compile something as both a scala_library and a scala_js_library, you'd add a macro that generated both target types with unique names, and unique transitive dep names
  • Add ScalaJSPlatform to automatically inject the appropriate runtime libs, and to act as a NodeResolver for scala_js_binary targets
  • Integration tests to open a node.js repl that calls a scala.js compiled binary, and to confirm that the scala.js binary is available as a resource on a JVM classpath

https://travis-ci.org/pantsbuild/pants/builds/99190958


Can test manually via:

$ ./pants repl contrib/scalajs/examples/src/scala/org/pantsbuild/scalajs/example/factfinder
...
> var _ = require('factfinder');
> org.pantsbuild.scalajs.example.factfinder.Factfinder().fact(10);
3628800

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Nick Howard (Twitter)
Stu Hood
Stu Hood
Stu Hood
Fedor Korotkov
Stu Hood
Stu Hood
Stu Hood
Stu Hood
Stu Hood
Nick Howard (Twitter)
Stu Hood
Stu Hood
Stu Hood
Nick Howard (Twitter)
Stu Hood
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 4236611aa6066238b1d59380ff140b258c6df2d5

Loading...