<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <groupId>com.sun.phobos</groupId>
        <artifactId>phobos-modules</artifactId>
        <version>0.6.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sun.phobos</groupId>
    <artifactId>phobos-rhino</artifactId>
    <packaging>bundle</packaging>
    <version>0.6.0</version>
    <name>phobos-rhino</name>
    <url>https://phobos.dev.java.net</url>
    <build>
        <plugins>
            <plugin>
                <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
                <artifactId>maven-antrun-extended-plugin</artifactId>
                <version>1.30</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <unzip src="zip/rhino1_6R7.zip" dest="${project.build.directory}/generated-sources/tmp">
                                       <patternset>
                                           <include name="rhino1_6R7/src/**/*.java" />
                                       </patternset>
                                </unzip>
                                <patch patchfile="src/main/patch/kit.patch" dir="${project.build.directory}/generated-sources/tmp/" strip="0" />                                    
                                <unzip src="zip/rhino1_6R7.zip" dest="${project.build.directory}/generated-sources/tmp">
                                      <patternset>
                                          <include name="rhino1_6R7/xmlimplsrc/**/*.java" />
                                      </patternset>
                                </unzip>
                                <move todir="${project.build.directory}/generated-sources/main/java">
                                    <fileset dir="${project.build.directory}/generated-sources/tmp/rhino1_6R7/src">
                                        <include name="**/*.java" />
                                    </fileset>
                                    <fileset dir="${project.build.directory}/generated-sources/tmp/rhino1_6R7/xmlimplsrc">
                                        <include name="**/*.java" />
                                    </fileset>
                                  </move>
                                  <unzip src="zip/rhino1_6R7.zip" dest="${project.build.directory}/generated-sources/tmp-resources">
                                         <patternset>
                                             <include name="rhino1_6R7/src/**/*.properties" />
                                         </patternset>
                                  </unzip>
                                  <!-- hack around Maven: copy resources directly to the classes dir -->
                                  <move todir="${project.build.directory}/classes">
                                        <fileset dir="${project.build.directory}/generated-sources/tmp-resources/rhino1_6R7/src">
                                            <include name="**/*.properties" />
                                        </fileset>
                                  </move>
                            </tasks>
                            <sourceRoot>${project.build.directory}/generated-sources/main/java/</sourceRoot>
                        </configuration>
                  </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.0.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>org.mozilla.javascript.*, org.mozilla.classfile.*</Export-Package>
                        <Import-Package>org.w3c.dom</Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>