Patch by Alexey Andreev to allow use of the chess demo on top of teavm teavm
authorJaroslav Tulach <jtulach@netbeans.org>
Tue, 11 Mar 2014 20:50:57 +0100
branchteavm
changeset 105ea79b73d590a
parent 97 1a8a5abe1adb
child 115 c9ea9ae71c2c
Patch by Alexey Andreev to allow use of the chess demo on top of teavm
chess/pom.xml
chess/src/main/assembly/teabrwsr.xml
     1.1 --- a/chess/pom.xml	Thu Mar 06 22:13:28 2014 +0100
     1.2 +++ b/chess/pom.xml	Tue Mar 11 20:50:57 2014 +0100
     1.3 @@ -141,6 +141,11 @@
     1.4        <scope>provided</scope>
     1.5        <type>jar</type>
     1.6      </dependency>
     1.7 +    <dependency>
     1.8 +      <groupId>org.netbeans.html</groupId>
     1.9 +      <artifactId>ko4j</artifactId>
    1.10 +      <version>${net.java.html.version}</version>
    1.11 +    </dependency>
    1.12    </dependencies>
    1.13    <profiles>
    1.14        <profile>
    1.15 @@ -252,5 +257,78 @@
    1.16                </dependency>
    1.17            </dependencies>
    1.18        </profile>
    1.19 +      <profile>
    1.20 +          <id>teabrwsr</id>
    1.21 +          <build>
    1.22 +              <plugins>
    1.23 +                  <plugin>
    1.24 +                      <groupId>org.teavm</groupId>
    1.25 +                      <artifactId>teavm-maven-plugin</artifactId>
    1.26 +                      <version>0.0.1-SNAPSHOT</version>
    1.27 +                      <dependencies>
    1.28 +                          <dependency>
    1.29 +                              <groupId>org.teavm</groupId>
    1.30 +                              <artifactId>teavm-classlib</artifactId>
    1.31 +                              <version>0.0.1-SNAPSHOT</version>
    1.32 +                          </dependency>
    1.33 +                          <!-- This module adds html4j support. It mainly includes JavaScriptBuilder support.
    1.34 +                          Also there are some little patches to JCL emulation, that are required to pass TCK -->
    1.35 +                          <dependency>
    1.36 +                              <groupId>org.teavm</groupId>
    1.37 +                              <artifactId>teavm-html4j</artifactId>
    1.38 +                              <version>0.0.1-SNAPSHOT</version>
    1.39 +                          </dependency>
    1.40 +                      </dependencies>
    1.41 +                      <executions>
    1.42 +                          <execution>
    1.43 +                              <id>generate-minesweeper</id>
    1.44 +                              <goals>
    1.45 +                                  <goal>build-javascript</goal>
    1.46 +                              </goals>
    1.47 +                              <phase>process-classes</phase>
    1.48 +                              <configuration>
    1.49 +                                  <!-- Whether we want TeaVM to minify (obfuscate) the generated JavaScript -->
    1.50 +                                  <minifying>false</minifying>
    1.51 +                                  <properties>
    1.52 +                                      <!-- This classes (separated with , ; space) will be available through vm.loadClass() -->
    1.53 +                                      <html4j.entryPoints>org.apidesign.html.demo.chess.LoadMain</html4j.entryPoints>
    1.54 +                                  </properties>
    1.55 +                                  <!-- Don't include main page - we created it by ourselves -->
    1.56 +                                  <mainPageIncluded>false</mainPageIncluded>
    1.57 +                                  <!-- Merge runtime.js instead of putting as a separate file -->
    1.58 +                                  <runtime>MERGED</runtime>
    1.59 +                                  <!-- Name of the generated file -->
    1.60 +                                  <targetFileName>bck2brwsr.js</targetFileName>
    1.61 +                                  <targetDirectory>${project.build.directory}/teavm</targetDirectory>
    1.62 +                                  <!-- This transformer adds null checks before virtual calls. It is not included
    1.63 +                                  by default as we don't always need these null checks -->
    1.64 +                                  <transformers>
    1.65 +                                      <param>org.teavm.javascript.NullPointerExceptionTransformer</param>
    1.66 +                                  </transformers>
    1.67 +                              </configuration>
    1.68 +                          </execution>
    1.69 +                      </executions>
    1.70 +                  </plugin>
    1.71 +                  <plugin>
    1.72 +                      <artifactId>maven-assembly-plugin</artifactId>
    1.73 +                      <version>2.4</version>
    1.74 +                      <executions>
    1.75 +                          <execution>
    1.76 +                              <id>distro-assembly</id>
    1.77 +                              <phase>package</phase>
    1.78 +                              <goals>
    1.79 +                                  <goal>single</goal>
    1.80 +                              </goals>
    1.81 +                              <configuration>
    1.82 +                                  <descriptors>
    1.83 +                                      <descriptor>src/main/assembly/teabrwsr.xml</descriptor>
    1.84 +                                  </descriptors>
    1.85 +                              </configuration>
    1.86 +                          </execution>
    1.87 +                      </executions>                
    1.88 +                  </plugin>      
    1.89 +              </plugins>
    1.90 +          </build>
    1.91 +      </profile>
    1.92    </profiles>
    1.93  </project>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/chess/src/main/assembly/teabrwsr.xml	Tue Mar 11 20:50:57 2014 +0100
     2.3 @@ -0,0 +1,47 @@
     2.4 +<?xml version="1.0"?>
     2.5 +<!--
     2.6 +
     2.7 +    The MIT License (MIT)
     2.8 +
     2.9 +    Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
    2.10 +
    2.11 +    Permission is hereby granted, free of charge, to any person obtaining a copy
    2.12 +    of this software and associated documentation files (the "Software"), to deal
    2.13 +    in the Software without restriction, including without limitation the rights
    2.14 +    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    2.15 +    copies of the Software, and to permit persons to whom the Software is
    2.16 +    furnished to do so, subject to the following conditions:
    2.17 +
    2.18 +    The above copyright notice and this permission notice shall be included in
    2.19 +    all copies or substantial portions of the Software.
    2.20 +
    2.21 +    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    2.22 +    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    2.23 +    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    2.24 +    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    2.25 +    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    2.26 +    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    2.27 +    THE SOFTWARE.
    2.28 +
    2.29 +-->
    2.30 +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    2.31 +  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
    2.32 +  
    2.33 +  <id>teabrwsr</id>
    2.34 +  <formats>
    2.35 +      <format>zip</format>
    2.36 +  </formats>
    2.37 +  <baseDirectory>public_html</baseDirectory>
    2.38 +  <fileSets>
    2.39 +      <fileSet>
    2.40 +          <directory>src/main/webapp/pages</directory>
    2.41 +          <outputDirectory>/</outputDirectory>
    2.42 +          <filtered>true</filtered>
    2.43 +      </fileSet>
    2.44 +      <fileSet>
    2.45 +          <directory>${project.build.directory}/teavm/</directory>
    2.46 +          <outputDirectory>/</outputDirectory>
    2.47 +          <filtered>false</filtered>
    2.48 +      </fileSet>
    2.49 +  </fileSets>
    2.50 +</assembly>