ko-bck2brwsr now provides precompiled versions of org.netbeans.html libraries. emul.zip is precompiled as well.
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 06 Dec 2014 08:02:33 +0100
changeset 17420e949cf1b073
parent 1741 c097ff7c46b8
child 1743 43ff517daa6e
ko-bck2brwsr now provides precompiled versions of org.netbeans.html libraries. emul.zip is precompiled as well.
ko/bck2brwsr/pom.xml
rt/emul/zip/pom.xml
rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java
     1.1 --- a/ko/bck2brwsr/pom.xml	Sat Dec 06 07:16:51 2014 +0100
     1.2 +++ b/ko/bck2brwsr/pom.xml	Sat Dec 06 08:02:33 2014 +0100
     1.3 @@ -29,6 +29,25 @@
     1.4                    <skip>false</skip>
     1.5                </configuration>
     1.6            </plugin>
     1.7 +          <plugin>
     1.8 +              <groupId>org.apidesign.bck2brwsr</groupId>
     1.9 +              <artifactId>bck2brwsr-maven-plugin</artifactId>
    1.10 +              <version>${project.version}</version>
    1.11 +              <executions>
    1.12 +                  <execution>
    1.13 +                      <goals>
    1.14 +                          <goal>library</goal>
    1.15 +                      </goals>
    1.16 +                  </execution>
    1.17 +              </executions>
    1.18 +              <configuration>
    1.19 +                  <aotDeps>
    1.20 +                      <aotDep>org.netbeans.html:*</aotDep>
    1.21 +                  </aotDeps>
    1.22 +                  <minified>false</minified>
    1.23 +                  <debug>false</debug>
    1.24 +              </configuration>
    1.25 +          </plugin>
    1.26        </plugins>
    1.27    </build>
    1.28    <dependencies>
    1.29 @@ -121,5 +140,15 @@
    1.30        <artifactId>ko4j</artifactId>
    1.31        <version>${net.java.html.version}</version>
    1.32      </dependency>
    1.33 +    <dependency>
    1.34 +      <groupId>org.netbeans.html</groupId>
    1.35 +      <artifactId>net.java.html.geo</artifactId>
    1.36 +      <version>${net.java.html.version}</version>
    1.37 +    </dependency>
    1.38 +    <dependency>
    1.39 +      <groupId>org.netbeans.html</groupId>
    1.40 +      <artifactId>net.java.html.sound</artifactId>
    1.41 +      <version>${net.java.html.version}</version>
    1.42 +    </dependency>
    1.43    </dependencies>
    1.44  </project>
     2.1 --- a/rt/emul/zip/pom.xml	Sat Dec 06 07:16:51 2014 +0100
     2.2 +++ b/rt/emul/zip/pom.xml	Sat Dec 06 08:02:33 2014 +0100
     2.3 @@ -32,7 +32,19 @@
     2.4                   <skip>false</skip>
     2.5                   <subpackages>java.util.zip</subpackages>
     2.6                 </configuration>
     2.7 -             </plugin>
     2.8 +            </plugin>
     2.9 +            <plugin>
    2.10 +                <groupId>org.apidesign.bck2brwsr</groupId>
    2.11 +                <artifactId>bck2brwsr-maven-plugin</artifactId>
    2.12 +                <version>${project.version}</version>
    2.13 +                <executions>
    2.14 +                    <execution>
    2.15 +                        <goals>
    2.16 +                            <goal>library</goal>
    2.17 +                        </goals>
    2.18 +                    </execution>
    2.19 +                </executions>
    2.20 +            </plugin>
    2.21          </plugins>
    2.22      </build>
    2.23      <dependencies>
    2.24 @@ -51,7 +63,7 @@
    2.25              <groupId>org.apidesign.bck2brwsr</groupId>
    2.26              <artifactId>emul.mini</artifactId>
    2.27              <version>${project.version}</version>
    2.28 -            <scope>compile</scope>
    2.29 +            <scope>provided</scope>
    2.30              <type>jar</type>
    2.31          </dependency>
    2.32          <dependency>
     3.1 --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java	Sat Dec 06 07:16:51 2014 +0100
     3.2 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java	Sat Dec 06 08:02:33 2014 +0100
     3.3 @@ -90,7 +90,7 @@
     3.4  
     3.5          try {
     3.6              Manifest m = new Manifest();
     3.7 -            {
     3.8 +            if (!"false".equals(minified)) {
     3.9                  Attributes attr = new Attributes();
    3.10                  attr.putValue("Bck2BrwsrArtifactId", prj.getArtifactId());
    3.11                  attr.putValue("Bck2BrwsrGroupId", prj.getGroupId());
    3.12 @@ -98,7 +98,7 @@
    3.13                  attr.putValue("Bck2BrwsrMinified", "true");
    3.14                  m.getEntries().put(minified, attr);
    3.15              }
    3.16 -            {
    3.17 +            if (!"false".equals(debug)) {
    3.18                  Attributes attr = new Attributes();
    3.19                  attr.putValue("Bck2BrwsrArtifactId", prj.getArtifactId());
    3.20                  attr.putValue("Bck2BrwsrGroupId", prj.getGroupId());
    3.21 @@ -123,38 +123,32 @@
    3.22                      }
    3.23                      {
    3.24                          Attributes attr = new Attributes();
    3.25 -                        attr.putValue("Bck2BrwsrArtifactId", prj.getArtifactId());
    3.26 -                        attr.putValue("Bck2BrwsrGroupId", prj.getGroupId());
    3.27 -                        attr.putValue("Bck2BrwsrVersion", prj.getVersion());
    3.28 +                        attr.putValue("Bck2BrwsrArtifactId", a.getArtifactId());
    3.29 +                        attr.putValue("Bck2BrwsrGroupId", a.getGroupId());
    3.30 +                        attr.putValue("Bck2BrwsrVersion", a.getVersion());
    3.31                          attr.putValue("Bck2BrwsrDebug", "true");
    3.32                          m.getEntries().put(artifactName(a, false), attr);
    3.33                      }
    3.34 -                        }
    3.35 +                }
    3.36              }
    3.37              
    3.38              FileOutputStream fos = new FileOutputStream(this.aotJar);
    3.39              JarOutputStream os = new JarOutputStream(fos, m);
    3.40  
    3.41 -            Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, mainJar, loader);
    3.42 -            if (exports != null) {
    3.43 -                for (String e : exports) {
    3.44 -                    c = c.addExported(e.replace('.', '/'));
    3.45 -                }
    3.46 -            }
    3.47 -            {
    3.48 +            if (!"false".equals(debug)) {
    3.49                  os.putNextEntry(new JarEntry(debug));
    3.50                  Writer w = new OutputStreamWriter(os);
    3.51 -                c.
    3.52 +                configureMain(loader).
    3.53                      obfuscation(ObfuscationLevel.NONE).
    3.54                      generate(w);
    3.55                  w.flush();
    3.56                  os.closeEntry();
    3.57              }
    3.58 -            {
    3.59 +            if (!"false".equals(minified)) {
    3.60                  os.putNextEntry(new JarEntry(minified));
    3.61              
    3.62                  Writer w = new OutputStreamWriter(os);
    3.63 -                c.
    3.64 +                configureMain(loader).
    3.65                      obfuscation(ObfuscationLevel.FULL).
    3.66                      generate(w);
    3.67                  w.flush();
    3.68 @@ -166,6 +160,13 @@
    3.69                      if (!matches(aotDeps, a)) {
    3.70                          continue;
    3.71                      }
    3.72 +                    getLog().info("Generating bck2brwsr for " + a.getFile());
    3.73 +                    Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, a.getFile(), loader);
    3.74 +                    if (exports != null) {
    3.75 +                        for (String e : exports) {
    3.76 +                            c = c.addExported(e.replace('.', '/'));
    3.77 +                        }
    3.78 +                    }
    3.79                      {
    3.80                          os.putNextEntry(new JarEntry(artifactName(a, true)));
    3.81                          Writer w = new OutputStreamWriter(os);
    3.82 @@ -195,6 +196,16 @@
    3.83          }
    3.84      }
    3.85  
    3.86 +    private Bck2Brwsr configureMain(URLClassLoader loader) throws IOException {
    3.87 +        Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, mainJar, loader);
    3.88 +        if (exports != null) {
    3.89 +            for (String e : exports) {
    3.90 +                c = c.addExported(e.replace('.', '/'));
    3.91 +            }
    3.92 +        }
    3.93 +        return c;
    3.94 +    }
    3.95 +
    3.96      private static String artifactName(Artifact a, boolean debug) {
    3.97          return a.getGroupId() + "-" + a.getArtifactId() + (debug ? "-debug.js" : "-min.js");
    3.98      }