<?xml version="1.0" encoding="UTF-8"?>
<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>
    <artifactId>nativelibs4java-parent</artifactId>
    <groupId>com.nativelibs4java</groupId>
    <version>1.8</version>
    <relativePath>..</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.nativelibs4java</groupId>
  <artifactId>bridj</artifactId>
  <packaging>bundle</packaging>
  <name>BridJ (NativeLibs4Java C/C++ Interop Layer)</name>
  <version>0.6.2</version>
  <url>http://code.google.com/p/bridj/</url>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.7</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Bundle-Name>${project.name}</Bundle-Name>
            <Bundle-Version>${project.version}</Bundle-Version>
            <Bundle-Activator>org.bridj.OSGiBundleActivator</Bundle-Activator>
            <Private-Package>org.bridj.relocated.*</Private-Package>
            <Import-Package>android.app,
							android.content.pm,
							android.os,
							com.android.dx.dex,
							com.android.dx.dex.cf,
							com.android.dx.dex.file,
							dalvik.system, 
							org.objectweb.asm,
							org.osgi.framework</Import-Package>
            <Export-Package>org.bridj,
							org.bridj.ann,
							org.bridj.cpp,
							org.bridj.cpp.com,
							org.bridj.cpp.com.shell,
							org.bridj.demangling,
							org.bridj.dyncall,
							org.bridj.jawt,
							org.bridj.objc,
							org.bridj.util</Export-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.nativelibs4java</groupId>
        <artifactId>maven-velocity-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>c-package</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>c-only</shadedClassifierName>
              <artifactSet>
                <excludes>
                  <exclude>com.google.android.tools:dx</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.nativelibs4java:bridj</artifact>
                  <excludes>
                    <exclude>org/bridj/Android**</exclude>
                    <exclude>org/bridj/cpp/**</exclude>
                    <exclude>org/bridj/objc/**</exclude>
                    <exclude>org/bridj/cs/**</exclude>
                    <exclude>org/bridj/lib/android_*/**</exclude>
                    <exclude>lib/armeabi/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>mac-package</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>macosx-only</shadedClassifierName>
              <artifactSet>
                <excludes>
                  <exclude>com.google.android.tools:dx</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.nativelibs4java:bridj</artifact>
                  <excludes>
                    <exclude>org/bridj/Android**</exclude>
                    <exclude>org/bridj/cpp/com/**</exclude>
                    <exclude>org/bridj/cpp/mfc/**</exclude>
                    <exclude>org/bridj/cs/**</exclude>
                    <exclude>org/bridj/lib/linux_*/**</exclude>
                    <exclude>org/bridj/lib/android_*/**</exclude>
                    <exclude>lib/armeabi/**</exclude>
                    <exclude>org/bridj/lib/sunos_*/**</exclude>
                    <exclude>org/bridj/lib/win*/**</exclude>
                    <exclude>org/bridj/lib/iphoneos_*/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>win-package</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>windows-only</shadedClassifierName>
              <artifactSet>
                <excludes>
                  <exclude>com.google.android.tools:dx</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.nativelibs4java:bridj</artifact>
                  <excludes>
                    <exclude>org/bridj/Android**</exclude>
                    <exclude>org/bridj/objc/**</exclude>
                    <exclude>org/bridj/lib/linux_*/**</exclude>
                    <exclude>org/bridj/lib/android_*/**</exclude>
                    <exclude>lib/armeabi/**</exclude>
                    <exclude>org/bridj/lib/sunos_*/**</exclude>
                    <exclude>org/bridj/lib/iphoneos_*/**</exclude>
                    <exclude>org/bridj/lib/darwin_*/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>unix-package</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>unix-only</shadedClassifierName>
              <artifactSet>
                <excludes>
                  <exclude>com.google.android.tools:dx</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.nativelibs4java:bridj</artifact>
                  <excludes>
                    <exclude>org/bridj/Android**</exclude>
                    <exclude>org/bridj/cpp/com/**</exclude>
                    <exclude>org/bridj/cpp/mfc/**</exclude>
                    <exclude>org/bridj/cs/**</exclude>
                    <exclude>org/bridj/objc/**</exclude>
                    <exclude>org/bridj/lib/win*/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>linux-package</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>linux-only</shadedClassifierName>
              <artifactSet>
                <excludes>
                  <exclude>com.google.android.tools:dx</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.nativelibs4java:bridj</artifact>
                  <excludes>
                    <exclude>org/bridj/Android**</exclude>
                    <exclude>org/bridj/cpp/com/**</exclude>
                    <exclude>org/bridj/cpp/mfc/**</exclude>
                    <exclude>org/bridj/objc/**</exclude>
                    <exclude>org/bridj/cs/**</exclude>
                    <exclude>org/bridj/lib/win*/**</exclude>
                    <exclude>org/bridj/lib/sunos_*/**</exclude>
                    <exclude>org/bridj/lib/iphoneos_*/**</exclude>
                    <exclude>org/bridj/lib/darwin_*/**</exclude>
                    <exclude>org/bridj/lib/android_*/**</exclude>
                    <exclude>lib/armeabi/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>android-package</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>android</shadedClassifierName>
              <artifactSet>
                <includes>
                  <include>com.google.android.tools:dx</include>
                </includes>
                <excludes>
                  <exclude>junit:junit</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.nativelibs4java:bridj</artifact>
                  <excludes>
                    <exclude>org/bridj/cpp/com/**</exclude>
                    <exclude>org/bridj/cpp/mfc/**</exclude>
                    <exclude>org/bridj/cs/**</exclude>
                    <exclude>org/bridj/lib/linux_*/**</exclude>
                    <exclude>org/bridj/lib/sunos_*/**</exclude>
                    <exclude>org/bridj/lib/iphoneos_*/**</exclude>
                    <exclude>org/bridj/lib/darwin_*/**</exclude>
                    <exclude>org/bridj/lib/win*/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>full-package</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <artifactSet>
                <excludes>
                  <exclude>com.google.android.tools:dx</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.nativelibs4java:bridj</artifact>
                  <excludes>
                    <exclude>org/bridj/Android**</exclude>
                    <exclude>org/bridj/lib/android_*/**</exclude>
                    <exclude>org/bridj/lib/iphoneos_*/**</exclude>
                    <exclude>lib/armeabi/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <relocations>
            <relocation>
              <pattern>org.objectweb.asm</pattern>
              <shadedPattern>org.bridj.relocated.org.objectweb.asm</shadedPattern>
              <includes>
                <include>org.objectweb.asm.*</include>
                <include>org.objectweb.asm.signature.*</include>
              </includes>
            </relocation>
          </relocations>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <groups>
                <group>
                  <title>Core Packages</title>
                  <packages>org.bridj:org.bridj.cpp:org.bridj.jawt:org.bridj.ann</packages>
                </group>
                <group>
                  <title>Extension Packages</title>
                  <packages>org.bridj.cs*:org.bridj.objc*:org.bridj.cpp.*</packages>
                </group>
                <group>
                  <title>Demos Packages</title>
                  <packages>org.bridj.demos</packages>
                </group>
                <group>
                  <title>Shouldn't-be-there-really Packages</title>
                  <packages>org.bridj.examples:org.bridj.func:org.bridj.util</packages>
                </group>
              </groups>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>native</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
              <execution>
                <phase>generate-resources</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>${basedir}/BuildNative</executable>
                  <workingDirectory>${basedir}</workingDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <version>4.3.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
      <version>3.4.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javolution</groupId>
      <artifactId>javolution</artifactId>
      <version>5.5.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.android</groupId>
      <artifactId>android</artifactId>
      <version>2.3.3</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
        <exclusion>
          <artifactId>httpclient</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
        <exclusion>
          <artifactId>opengl-api</artifactId>
          <groupId>org.khronos</groupId>
        </exclusion>
        <exclusion>
          <artifactId>xmlParserAPIs</artifactId>
          <groupId>xerces</groupId>
        </exclusion>
        <exclusion>
          <artifactId>xpp3</artifactId>
          <groupId>xpp3</groupId>
        </exclusion>
        <exclusion>
          <artifactId>json</artifactId>
          <groupId>org.json</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.android.tools</groupId>
      <artifactId>dx</artifactId>
      <version>1.7</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <versionSpecificSubPackage>v0_6_2</versionSpecificSubPackage>
  </properties>
</project>

