TOOLS: Adding pom.xml for C++ build tools. Patch contributed by philip.liard
authorjia.shao.peng <jia.shao.peng@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 5 Apr 2011 09:26:11 +0000 (09:26 +0000)
committerjia.shao.peng <jia.shao.peng@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 5 Apr 2011 09:26:11 +0000 (09:26 +0000)
git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@155 ee073f10-1060-11df-b6a4-87a95322a99c

tools/java/cpp-build/pom.xml [new file with mode: 0644]

diff --git a/tools/java/cpp-build/pom.xml b/tools/java/cpp-build/pom.xml
new file mode 100644 (file)
index 0000000..efb08c0
--- /dev/null
@@ -0,0 +1,137 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>tools</artifactId>
+    <groupId>com.google.i18n.phonenumbers</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>com.google.i18n.phonenumbers.tools</groupId>
+  <artifactId>cpp-build</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Libphonenumber C++ build tools</name>
+  <description>
+    C++ build tools that download dependencies under base/ from the Chromium source repository, and
+    generate the C++ metadata code needed to build the libphonenumber library.
+  </description>
+
+  <build>
+    <sourceDirectory>src</sourceDirectory>
+    <plugins>
+      <plugin>
+        <version>2.3.2</version>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <!-- Create a directory called 'generated'. -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>create-generated-directory</id>
+            <phase>generate-sources</phase>
+            <configuration>
+              <tasks>
+                <mkdir dir="generated"/>
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- Add generated/ to the source directories. -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.5</version>
+        <executions>
+          <execution>
+            <id>add-source</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>generated/</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- Invoke Protocol Buffers compiler to generate PhoneMetadata.java. -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.2</version>
+        <executions>
+          <execution>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <executable>protoc</executable>
+          <arguments>
+            <argument>--java_out=generated</argument>
+            <argument>../../../resources/phonemetadata.proto</argument>
+            <argument>--proto_path=../../../resources</argument>
+          </arguments>
+        </configuration>
+      </plugin>
+      <!-- Build a JAR with its dependencies (protocol buffers and common library). This JAR
+           contains the C++ build tools invoked by CMake during the libphonenumber C++ build. -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.2.1</version>
+        <configuration>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+          <archive>
+            <manifest>
+              <addClasspath>true</addClasspath>
+              <mainClass>com.google.i18n.phonenumbers.tools.EntryPoint</mainClass>
+            </manifest>
+          </archive>
+        </configuration>
+        <executions>
+          <execution>
+            <id>make-assembly</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.google.i18n.phonenumbers.tools</groupId>
+      <artifactId>common</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>2.4.0a</version>
+    </dependency>
+  </dependencies>
+
+</project>