cincheo / jsweet-examples

A set of simple examples to show what can be done with the JSweet transpiler (Java to JavaScript)
Apache License 2.0
37 stars 18 forks source link

JSweet examples

A set of simple examples to show what can be done in Java with the JSweet transpiler.

All these example are written in Java using the JSweet APIs (candies)] They are then transpiled to JavaScript by the JSweet transpiler.

Visit the live JSweet's example page (http://www.jsweet.org/examples) to browse the examples, run them and debug the Java code within your favorite browser. Note that all these examples are responsive and should work as well on a Web browser and on a mobile.

Visit also https://github.com/cincheo/jsweet-examples-threejs for some examples using the Threejs framework (WebGL-powered 3D)]

Usage

> git clone https://github.com/cincheo/jsweet-examples.git
> cd jsweet-examples

Build with Gradle

./gradlew jsweetClean jsweet (--refresh-dependencies) (--info)

Build with Maven

mvn clean generate-sources

Build with Ant

ant

Run in your favorite browser

> firefox webapp/${example-name}/index.html

Prerequisites

The node and npm executables must be in the path (https://nodejs.org)] Install Maven (https://maven.apache.org/install.html)]