Gaudenz Alder 64b1d037c1 7.5.8 release 8 лет назад
..
.jsweet 72f21e3fb6 7.5.6 release 8 лет назад
.settings 64b1d037c1 7.5.8 release 8 лет назад
src 72f21e3fb6 7.5.6 release 8 лет назад
.classpath 64b1d037c1 7.5.8 release 8 лет назад
.project 64b1d037c1 7.5.8 release 8 лет назад
HowToRun.txt 72f21e3fb6 7.5.6 release 8 лет назад
LICENSE 72f21e3fb6 7.5.6 release 8 лет назад
README.md 72f21e3fb6 7.5.6 release 8 лет назад
pom.xml 72f21e3fb6 7.5.6 release 8 лет назад

README.md

JSweet quick start

A simple project to get started with JSweet. This project just contains a main method that shows 'Hello world' messages in two different ways. The program uses the J4TS candy to access java.util API, and the jQuery candy. Programmers can use it to set up a new JSweet project and try out some basic features.

Usage

> git clone https://github.com/cincheo/jsweet-quickstart.git
> cd jsweet-quickstart
> mvn generate-sources
> firefox webapp/index.html

Modify

At any time, you can modify the Java files (or add new files) and run mvn generate-sources to generate the corresponding JavaScript files. You can then use them in the index.html file (<script> tags).

You can modify the generation options by modifying the plugin section for jsweet-maven-plugin. When having a project with multiple source files, a good generation option to turn on is the bundle option, in order to generate all the JavaScript classes in a single file. Check the Maven plugin for the full option list.

If you want to use a JavaScript library (besides jQuery which is already enabled), you must add the Maven dependency in the <dependencies> section of the pom.xml. You can copy-paste the Maven dependency description from our Candy browser, or from our online Maven repository. When running mvn generate-sources with a new library, if available in the candy, the JavaScript library will be extracted to the location given by the candiesJsOut option (here in the webapp directory). JavaScript libraries are packaged in the Jar following the WebJars conventions. When not available, you will need to find and download the JavaScript library manually (or using a third-party tool such as Bower).

Prerequisites