Updates description of build process

This commit is contained in:
konsoletyper 2013-12-18 17:34:49 +04:00
parent 305c54b72d
commit d560f249ba

View File

@ -51,28 +51,17 @@ Third, you add `teavm-maven-plugin` in your build configuration:
</goals> </goals>
<phase>process-classes</phase> <phase>process-classes</phase>
<configuration> <configuration>
<minifiying>true</minifiying> <minifying>true</minifying>
<mainClass>org.teavm.samples.HelloWorld</mainClass> <mainClass>org.teavm.samples.HelloWorld</mainClass>
<mainPageIncluded>true</mainPageIncluded>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
Now you can execute `mvn clean package` and get the generated JavaScript file `target/javascript/classes.js`. Now you can execute `mvn clean package` and get the generated JavaScript files in `target/javascript` folder.
It contains the `main` global function, which you may call. In the general case you should provide Just open `target/javascript/main.html` page in your browser, open developer's console and press *Refresh* and
an HTML page, which includes both of see what happen.
[runtime.js](https://github.com/konsoletyper/teavm/blob/master/teavm-core/src/main/resources/org/teavm/javascript/runtime.js)
and `classes.js` files and calls `main` function in some condition. Here is an example:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="runtime.js">
<script type="text/javascript" src="classes.js">
</head>
<body onload="main()">
</body>
</html>
Advantages over GWT Advantages over GWT
------------------- -------------------