'. '

Bck2BrwsrLibraries

From APIDesign

Revision as of 18:30, 26 March 2016 by JaroslavTulach (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

If your Bck2Brwsr application uses some popular library you may decide to pre-compile it, rather than spend time compiling it everytime. If you are building your library and control its pom.xml, you can just include:

<plugin>
  <groupId>org.apidesign.bck2brwsr</groupId>
  <artifactId>bck2brwsr-maven-plugin</artifactId>
  <version>${bck2brwsr.version}</version>
  <executions>
    <execution>
      <goals>
        <goal>library</goal>
      </goals>
    </execution>
  </executions>
</plugin>

in your pom.xml and additional artifact with classifier bck2brwsr will be generated for you. In other pom.xml where, you compile your final application, you just reference this new artifact and pre-compiled JavaScript file with Bck2Brwsr library will be used:

<dependency>
  <groupId>your.library.group</groupId>
  <artifactId>your.library.name</artifactId>
  <classifier>bck2brwsr</classifier>
  <scope>provided</scope>
  <type>jar</type>
<dependency>

Of course, sometimes people don't control their library's pom.xml and want to do additional modifications to it (like adding OSGi headers). Even with such libraries one can use ahead-of-time compilation. Just use aotDeps element and pre-compile your dependencies too:

<plugin>
  <groupId>org.apidesign.bck2brwsr</groupId>
  <artifactId>bck2brwsr-maven-plugin</artifactId>
  <version>${bck2brwsr.version}</version>
  <executions>
    <execution>
      <goals>
        <goal>library</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <ignoreBootClassPath>false</ignoreBootClassPath>
    <aotDeps>
       <!-- compiles whole group HTML/Java libraries from NetBeans --> 
       <aotDep>org.netbeans.html:*</aotDep>
    </aotDeps>
    <!-- does not compile the main project artifact -->
    <minified>false</minified>
    <debug>false</debug>
  </configuration>
</plugin>

With support like that you can significantly speed up compilation of your Bck2Brwsr projects.

Personal tools