OSDN Git Service

Maven wiring to build natives jars.
authorMichael Bayne <mdb@samskivert.com>
Fri, 3 May 2013 14:14:02 +0000 (07:14 -0700)
committerMichael Bayne <mdb@samskivert.com>
Fri, 10 May 2013 20:08:39 +0000 (13:08 -0700)
This currently downloads the jars from the build server. It may be possible to
have Maven actually do the native builds, but that seems like perhaps more
trouble than it's worth.

platform/armeabi-v7a.xml [new file with mode: 0644]
platform/armeabi.xml [new file with mode: 0644]
platform/desktop.xml [new file with mode: 0644]
platform/pom.xml [new file with mode: 0644]
pom.xml

diff --git a/platform/armeabi-v7a.xml b/platform/armeabi-v7a.xml
new file mode 100644 (file)
index 0000000..8aa4e1d
--- /dev/null
@@ -0,0 +1,18 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>natives-armeabi-v7a</id>
+  <formats>
+    <format>jar</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/armeabi-v7a</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>**</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/platform/armeabi.xml b/platform/armeabi.xml
new file mode 100644 (file)
index 0000000..e80f697
--- /dev/null
@@ -0,0 +1,18 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>natives-armeabi</id>
+  <formats>
+    <format>jar</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/armeabi</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>**</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/platform/desktop.xml b/platform/desktop.xml
new file mode 100644 (file)
index 0000000..3d9223a
--- /dev/null
@@ -0,0 +1,18 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>natives-desktop</id>
+  <formats>
+    <format>jar</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/desktop</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>**</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/platform/pom.xml b/platform/pom.xml
new file mode 100644 (file)
index 0000000..19dbb26
--- /dev/null
@@ -0,0 +1,107 @@
+<?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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.badlogic.gdx</groupId>
+    <artifactId>gdx-parent</artifactId>
+    <version>0.9.9-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>gdx-platform</artifactId>
+  <packaging>jar</packaging>
+  <name>libGDX Native Libraries</name>
+
+  <properties>
+    <base.url>http://libgdx.badlogicgames.com/nightlies/dist</base.url>
+  </properties>
+
+  <dependencies>
+  </dependencies>
+
+  <build>
+    <sourceDirectory>src</sourceDirectory>
+
+    <plugins>
+      <plugin>
+        <groupId>com.googlecode.maven-download-plugin</groupId>
+        <artifactId>maven-download-plugin</artifactId>
+        <version>1.0.0</version>
+        <executions>
+          <execution>
+            <id>desktop</id>
+            <phase>process-resources</phase>
+            <goals><goal>wget</goal></goals>
+            <configuration>
+              <cacheDirectory>${project.build.directory}/download-cache</cacheDirectory>
+              <url>${base.url}/gdx-natives.jar</url>
+              <unpack>true</unpack>
+              <outputDirectory>${project.build.directory}/desktop</outputDirectory>
+            </configuration>
+          </execution>
+
+          <execution>
+            <id>armeabi-gl20</id>
+            <phase>process-resources</phase>
+            <goals><goal>wget</goal></goals>
+            <configuration>
+              <cacheDirectory>${project.build.directory}/download-cache</cacheDirectory>
+              <url>${base.url}/armeabi/libandroidgl20.so</url>
+              <outputDirectory>${project.build.directory}/armeabi</outputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>armeabi-gdx</id>
+            <phase>process-resources</phase>
+            <goals><goal>wget</goal></goals>
+            <configuration>
+              <cacheDirectory>${project.build.directory}/download-cache</cacheDirectory>
+              <url>${base.url}/armeabi/libgdx.so</url>
+              <outputDirectory>${project.build.directory}/armeabi</outputDirectory>
+            </configuration>
+          </execution>
+
+          <execution>
+            <id>armeabi-v7a-gl20</id>
+            <phase>process-resources</phase>
+            <goals><goal>wget</goal></goals>
+            <configuration>
+              <cacheDirectory>${project.build.directory}/download-cache</cacheDirectory>
+              <url>${base.url}/armeabi-v7a/libandroidgl20.so</url>
+              <outputDirectory>${project.build.directory}/armeabi-v7a</outputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>armeabi-v7a-gdx</id>
+            <phase>process-resources</phase>
+            <goals><goal>wget</goal></goals>
+            <configuration>
+              <cacheDirectory>${project.build.directory}/download-cache</cacheDirectory>
+              <url>${base.url}/armeabi-v7a/libgdx.so</url>
+              <outputDirectory>${project.build.directory}/armeabi-v7a</outputDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.4</version>
+        <configuration>
+          <descriptors>
+            <descriptor>desktop.xml</descriptor>
+            <descriptor>armeabi.xml</descriptor>
+            <descriptor>armeabi-v7a.xml</descriptor>
+          </descriptors>
+        </configuration>
+        <executions>
+          <execution>
+            <id>make-assembly</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/pom.xml b/pom.xml
index c83e9ec..e76e98e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -56,6 +56,7 @@
     <module>backends/gdx-backend-lwjgl</module>
     <module>backends/gdx-backends-gwt</module>
     <module>extensions/gdx-tools</module>
+    <module>platform</module>
   </modules>
 
   <build>