ko/kosample/client-web/pom.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 14 Jun 2016 06:11:20 +0200
branchLibraries
changeset 1977 46efebc7e220
parent 1941 621825e167d7
permissions -rw-r--r--
We need to keep Function.Ax classes in the VM
     1 <?xml version="1.0"?>
     2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     4     <modelVersion>4.0.0</modelVersion>
     5 
     6     <parent>
     7         <groupId>org.apidesign.bck2brwsr</groupId>
     8         <artifactId>kosample-pom</artifactId>
     9         <version>1.0-SNAPSHOT</version>
    10     </parent>
    11 
    12     <groupId>org.apidesign.bck2brwsr</groupId>
    13     <artifactId>kosample-web</artifactId>
    14     <version>1.0-SNAPSHOT</version>
    15     <packaging>jar</packaging>
    16 
    17     <name>kosample Client for Web</name>
    18 
    19     <properties>
    20         <netbeans.compile.on.save>none</netbeans.compile.on.save>
    21         <project.mainclass>org.apidesign.bck2brwsr.kosample.BrowserMain</project.mainclass>
    22         <browser.bootstrap>initialize bck2brwsr --&gt;
    23 &lt;script type="text/javascript" src="bck2brwsr.js"&gt;&lt;/script&gt;
    24 &lt;script&gt;
    25     var vm = bck2brwsr('kosample.js');
    26     var c = vm.loadClass('org.apidesign.bck2brwsr.kosample.BrowserMain');
    27     c.invoke('main');
    28 &lt;/script&gt;
    29 &lt;!-- end of initialization </browser.bootstrap>
    30     </properties>
    31     <build>
    32         <plugins>
    33             <plugin>
    34                 <groupId>org.netbeans.html</groupId>
    35                 <artifactId>html4j-maven-plugin</artifactId>
    36                 <version>${net.java.html.version}</version>
    37                 <executions>
    38                     <execution>
    39                         <id>js-classes</id>
    40                         <goals>
    41                             <goal>process-js-annotations</goal>
    42                         </goals>
    43                     </execution>
    44                 </executions>
    45             </plugin>
    46             <plugin>
    47                 <groupId>org.apache.maven.plugins</groupId>
    48                 <artifactId>maven-compiler-plugin</artifactId>
    49                 <version>2.3.2</version>
    50                 <configuration>
    51                     <source>1.7</source>
    52                     <target>1.7</target>
    53                     <compilerArguments>
    54                         <bootclasspath>netbeans.ignore.jdk.bootclasspath</bootclasspath>
    55                     </compilerArguments>
    56                 </configuration>
    57             </plugin>
    58             <plugin>
    59                 <groupId>org.apache.maven.plugins</groupId>
    60                 <artifactId>maven-jar-plugin</artifactId>
    61                 <version>2.4</version>
    62                 <configuration>
    63                     <archive>
    64                         <manifest>
    65                             <mainClass>${project.mainclass}</mainClass>
    66                             <addClasspath>true</addClasspath>
    67                             <classpathPrefix>lib/</classpathPrefix>
    68                             <useUniqueVersions>false</useUniqueVersions>
    69                         </manifest>
    70                     </archive>
    71                 </configuration>
    72             </plugin>
    73             <plugin>
    74                 <groupId>org.apidesign.bck2brwsr</groupId>
    75                 <artifactId>bck2brwsr-maven-plugin</artifactId>
    76                 <version>${bck2brwsr.version}</version>
    77                 <executions>
    78                     <execution>
    79                         <goals>
    80                             <goal>brwsr</goal>
    81                             <goal>aot</goal>
    82                         </goals>
    83                     </execution>
    84                 </executions>
    85                 <configuration>
    86                     <obfuscation>${bck2brwsr.obfuscationlevel}</obfuscation>
    87                     <directory>${project.build.directory}/${project.build.finalName}-bck2brwsr/public_html/</directory>
    88                     <startpage>index.html</startpage>
    89                     <classPathPrefix>lib</classPathPrefix>
    90                     <mainJavaScript>${project.build.directory}/kosample.js</mainJavaScript>
    91                     <exports>
    92                         <export>${project.mainclass}</export>
    93                     </exports>
    94                 </configuration>
    95             </plugin>
    96             <plugin>
    97                 <artifactId>maven-assembly-plugin</artifactId>
    98                 <version>2.4</version>
    99                 <executions>
   100                     <execution>
   101                         <id>distro-assembly</id>
   102                         <phase>package</phase>
   103                         <goals>
   104                             <goal>single</goal>
   105                         </goals>
   106                         <configuration>
   107                             <descriptors>
   108                                 <descriptor>src/main/assembly/bck2brwsr.xml</descriptor>
   109                             </descriptors>
   110                         </configuration>
   111                     </execution>
   112                 </executions>
   113             </plugin>
   114             <plugin>
   115                 <groupId>org.apache.maven.plugins</groupId>
   116                 <artifactId>maven-dependency-plugin</artifactId>
   117                 <version>2.9</version>
   118                 <executions>
   119                     <execution>
   120                         <id>unpack</id>
   121                         <phase>process-resources</phase>
   122                         <goals>
   123                             <goal>unpack-dependencies</goal>
   124                         </goals>
   125                     </execution>
   126                 </executions>
   127                 <configuration>
   128                     <type>zip</type>
   129                     <classifier>webpages</classifier>
   130                     <overWrite>true</overWrite>
   131                     <outputDirectory>target/web/pages</outputDirectory>
   132                     <includes>*/**</includes>
   133                 </configuration>
   134             </plugin>
   135         </plugins>
   136     </build>
   137     <dependencies>
   138         <dependency>
   139             <groupId>org.apidesign.bck2brwsr</groupId>
   140             <artifactId>kosample</artifactId>
   141             <version>${project.version}</version>
   142             <exclusions>
   143                 <exclusion>
   144                     <groupId>org.netbeans.html</groupId>
   145                     <artifactId>net.java.html.boot.fx</artifactId>
   146                 </exclusion>
   147             </exclusions>
   148         </dependency>
   149         <dependency>
   150             <groupId>org.apidesign.bck2brwsr</groupId>
   151             <artifactId>emul</artifactId>
   152             <version>${bck2brwsr.version}</version>
   153             <classifier>rt</classifier>
   154         </dependency>
   155         <dependency>
   156             <groupId>org.netbeans.html</groupId>
   157             <artifactId>net.java.html.boot</artifactId>
   158             <version>${net.java.html.version}</version>
   159             <exclusions>
   160                 <exclusion>
   161                     <artifactId>asm</artifactId>
   162                     <groupId>org.ow2.asm</groupId>
   163                 </exclusion>
   164             </exclusions>
   165         </dependency>
   166         <dependency>
   167             <groupId>org.apidesign.bck2brwsr</groupId>
   168             <artifactId>emul</artifactId>
   169             <version>${bck2brwsr.version}</version>
   170             <classifier>bck2brwsr</classifier>
   171             <scope>provided</scope>
   172         </dependency>
   173         <dependency>
   174             <groupId>org.apidesign.bck2brwsr</groupId>
   175             <artifactId>ko-bck2brwsr</artifactId>
   176             <version>${bck2brwsr.version}</version>
   177             <classifier>bck2brwsr</classifier>
   178             <scope>provided</scope>
   179         </dependency>
   180         <dependency>
   181             <groupId>org.apidesign.bck2brwsr</groupId>
   182             <artifactId>kosample-js</artifactId>
   183             <version>${project.version}</version>
   184             <classifier>bck2brwsr</classifier>
   185             <scope>provided</scope>
   186             <type>jar</type>
   187         </dependency>
   188     </dependencies>
   189     <profiles>
   190         <profile>
   191             <id>teavm</id>
   192             <properties>
   193                 <teavm.version>0.4.0</teavm.version>
   194                 <teavm.debug>false</teavm.debug>
   195                 <browser.bootstrap>initialize TeaVM --&gt;
   196 &lt;script type="text/javascript" src="teavm.js"&gt;&lt;/script&gt;
   197 &lt;script&gt;
   198     main();
   199 &lt;/script&gt;
   200 &lt;!-- end of initialization </browser.bootstrap>
   201             </properties>
   202             <dependencies>
   203                 <!-- needs special compile time dep otherwise TeaVM ignores the JAR -->
   204                 <dependency>
   205                     <groupId>org.netbeans.html</groupId>
   206                     <artifactId>ko4j</artifactId>
   207                     <version>${net.java.html.version}</version>
   208                 </dependency>
   209             </dependencies>
   210             <build>
   211                 <plugins>
   212                     <plugin>
   213                         <groupId>org.teavm</groupId>
   214                         <artifactId>teavm-maven-plugin</artifactId>
   215                         <version>${teavm.version}</version>
   216                         <dependencies>
   217                             <dependency>
   218                                 <groupId>org.teavm</groupId>
   219                                 <artifactId>teavm-classlib</artifactId>
   220                                 <version>${teavm.version}</version>
   221                             </dependency>
   222                             <!-- This module adds html4j support. It mainly includes JavaScriptBuilder support.
   223                             Also there are some little patches to JCL emulation, that are required to pass TCK -->
   224                             <dependency>
   225                                 <groupId>org.teavm</groupId>
   226                                 <artifactId>teavm-html4j</artifactId>
   227                                 <version>${teavm.version}</version>
   228                             </dependency>
   229                         </dependencies>
   230                         <executions>
   231                             <execution>
   232                                 <id>generate-teavm</id>
   233                                 <goals>
   234                                     <goal>compile</goal>
   235                                 </goals>
   236                                 <phase>process-classes</phase>
   237                                 <configuration>
   238                                     <mainClass>${project.mainclass}</mainClass>
   239                                     <debugInformationGenerated>${teavm.debug}</debugInformationGenerated>
   240                                     <sourceMapsGenerated>${teavm.debug}</sourceMapsGenerated>
   241                                     <sourceFilesCopied>${teavm.debug}</sourceFilesCopied>
   242                                     <!-- Whether we want TeaVM to minify (obfuscate) the generated JavaScript -->
   243                                     <minifying>false</minifying>
   244                                     <!-- Don't include main page - we created it by ourselves -->
   245                                     <mainPageIncluded>false</mainPageIncluded>
   246                                     <!-- Merge runtime.js instead of putting as a separate file -->
   247                                     <runtime>MERGED</runtime>
   248                                     <!-- Name of the generated file -->
   249                                     <targetFileName>teavm.js</targetFileName>
   250                                     <targetDirectory>${project.build.directory}/teavm</targetDirectory>
   251                                     <!-- This transformer adds null checks before virtual calls. It is not included
   252                                     by default as we don't always need these null checks
   253                                     <transformers>
   254                                         <param>org.teavm.javascript.NullPointerExceptionTransformer</param>
   255                                     </transformers>
   256                                     -->
   257                                 </configuration>
   258                             </execution>
   259                         </executions>
   260                     </plugin>
   261                     <plugin>
   262                         <artifactId>maven-assembly-plugin</artifactId>
   263                         <version>2.4</version>
   264                         <executions>
   265                             <execution>
   266                                 <id>distro-assembly</id>
   267                                 <phase>package</phase>
   268                                 <goals>
   269                                     <goal>single</goal>
   270                                 </goals>
   271                                 <configuration>
   272                                     <descriptors>
   273                                         <descriptor>src/main/assembly/teavm.xml</descriptor>
   274                                     </descriptors>
   275                                 </configuration>
   276                             </execution>
   277                         </executions>
   278                     </plugin>
   279                     <plugin>
   280                         <groupId>org.apidesign.bck2brwsr</groupId>
   281                         <artifactId>bck2brwsr-maven-plugin</artifactId>
   282                         <version>${bck2brwsr.version}</version>
   283                         <executions>
   284                             <execution>
   285                                 <goals>
   286                                     <goal>brwsr</goal>
   287                                 </goals>
   288                             </execution>
   289                         </executions>
   290                         <configuration>
   291                             <directory>${project.build.directory}/${project.build.finalName}-teavm/public_html/</directory>
   292                             <startpage>index.html</startpage>
   293                         </configuration>
   294                     </plugin>
   295                 </plugins>
   296             </build>
   297         </profile>
   298         <profile>
   299             <id>test-run</id>
   300             <activation>
   301                 <property>
   302                     <name>!skipTests</name>
   303                 </property>
   304             </activation>
   305             <build>
   306                 <plugins>
   307                     <plugin>
   308                         <groupId>org.apidesign.bck2brwsr</groupId>
   309                         <artifactId>bck2brwsr-maven-plugin</artifactId>
   310                         <version>${project.version}</version>
   311                         <executions>
   312                             <execution>
   313                                 <id>show</id>
   314                                 <goals>
   315                                     <goal>show</goal>
   316                                 </goals>
   317                                 <phase>integration-test</phase>
   318                             </execution>
   319                         </executions>
   320                     </plugin>
   321                 </plugins>
   322             </build>
   323         </profile>
   324     </profiles>
   325 </project>