Bck2BrwsrLibraries

From APIDesign

(Difference between revisions)
Jump to: navigation, search

JaroslavTulach (Talk | contribs)
(New page: 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 co...)
Next diff →

Revision as of 05:19, 7 December 2014

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>org.apidesign.bck2brwsr
  <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>
    <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
buy