Static assembly to use the exported bck2brwsr.js emul
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 05 Feb 2013 15:32:41 +0100
branchemul
changeset 6745d9cd8add4c6
parent 673 62b514a70382
child 683 327a6da275d6
Static assembly to use the exported bck2brwsr.js
javaquery/demo-calculator/pom.xml
javaquery/demo-calculator/src/main/assembly/bck2brwsr.xml
javaquery/demo-calculator/src/main/resources/org/apidesign/bck2brwsr/demo/calc/staticcompilation/Calculator.xhtml
     1.1 --- a/javaquery/demo-calculator/pom.xml	Tue Feb 05 15:32:16 2013 +0100
     1.2 +++ b/javaquery/demo-calculator/pom.xml	Tue Feb 05 15:32:41 2013 +0100
     1.3 @@ -23,7 +23,6 @@
     1.4                  <executions>
     1.5                      <execution>
     1.6                          <goals>
     1.7 -                            <goal>j2js</goal>
     1.8                              <goal>brwsr</goal>
     1.9                          </goals>
    1.10                      </execution>
    1.11 @@ -43,6 +42,19 @@
    1.12              </configuration>
    1.13           </plugin>
    1.14           <plugin>
    1.15 +             <groupId>org.apache.maven.plugins</groupId>
    1.16 +             <artifactId>maven-jar-plugin</artifactId>
    1.17 +             <version>2.4</version>
    1.18 +             <configuration>
    1.19 +                 <archive>
    1.20 +                     <manifest>
    1.21 +                         <addClasspath>true</addClasspath>
    1.22 +                         <classpathPrefix>lib/</classpathPrefix>
    1.23 +                     </manifest>
    1.24 +                 </archive>
    1.25 +             </configuration>
    1.26 +         </plugin>
    1.27 +         <plugin>
    1.28              <artifactId>maven-assembly-plugin</artifactId>
    1.29                  <version>2.4</version>
    1.30                  <executions>
    1.31 @@ -74,5 +86,13 @@
    1.32        <artifactId>javaquery.api</artifactId>
    1.33        <version>0.3-SNAPSHOT</version>
    1.34      </dependency>
    1.35 +    <dependency>
    1.36 +      <groupId>org.apidesign.bck2brwsr</groupId>
    1.37 +      <artifactId>vm4brwsr</artifactId>
    1.38 +      <classifier>js</classifier>
    1.39 +      <type>zip</type>
    1.40 +      <version>0.3-SNAPSHOT</version>
    1.41 +      <scope>runtime</scope>
    1.42 +    </dependency>
    1.43    </dependencies>
    1.44  </project>
     2.1 --- a/javaquery/demo-calculator/src/main/assembly/bck2brwsr.xml	Tue Feb 05 15:32:16 2013 +0100
     2.2 +++ b/javaquery/demo-calculator/src/main/assembly/bck2brwsr.xml	Tue Feb 05 15:32:41 2013 +0100
     2.3 @@ -33,6 +33,15 @@
     2.4          <scope>runtime</scope>
     2.5          <outputDirectory>lib</outputDirectory>
     2.6      </dependencySet>
     2.7 +    <dependencySet>
     2.8 +        <useProjectArtifact>false</useProjectArtifact>
     2.9 +        <scope>runtime</scope>
    2.10 +        <includes>
    2.11 +            <include>*:js</include>
    2.12 +        </includes>
    2.13 +        <unpack>true</unpack>
    2.14 +        <outputDirectory>/</outputDirectory>
    2.15 +    </dependencySet>
    2.16    </dependencySets> 
    2.17    <files>
    2.18      <file>
    2.19 @@ -44,11 +53,6 @@
    2.20        <outputDirectory>/</outputDirectory>
    2.21        <destName>index.xhtml</destName>
    2.22      </file>
    2.23 -    <file>
    2.24 -      <source>${project.build.directory}/classes/org/apidesign/bck2brwsr/demo/calc/staticcompilation/bootjava.js</source>
    2.25 -      <outputDirectory>/</outputDirectory>
    2.26 -      <destName>bck2brwsr.js</destName>
    2.27 -    </file>
    2.28    </files>
    2.29  
    2.30  </assembly>
    2.31 \ No newline at end of file
     3.1 --- a/javaquery/demo-calculator/src/main/resources/org/apidesign/bck2brwsr/demo/calc/staticcompilation/Calculator.xhtml	Tue Feb 05 15:32:16 2013 +0100
     3.2 +++ b/javaquery/demo-calculator/src/main/resources/org/apidesign/bck2brwsr/demo/calc/staticcompilation/Calculator.xhtml	Tue Feb 05 15:32:41 2013 +0100
     3.3 @@ -78,5 +78,10 @@
     3.4          </table>
     3.5          <div data-bind="text: displayPreview"></div>
     3.6          <script src="bck2brwsr.js"/>
     3.7 +        <script>
     3.8 +            var classpath = [ 'demo.static.calculator-0.3-SNAPSHOT.jar' ];
     3.9 +            var vm = bck2brwsr(classpath);
    3.10 +            vm.loadClass('org.apidesign.bck2brwsr.demo.calc.staticcompilation.Calc');
    3.11 +        </script>
    3.12      </body>
    3.13  </html>