mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Updates description of build process
This commit is contained in:
parent
305c54b72d
commit
d560f249ba
21
README.md
21
README.md
|
@ -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
|
||||||
-------------------
|
-------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user