abe3cac2e3c46de505693b6bf692b3c195fd4745
[platform/upstream/libphonenumber.git] / tools / java / cpp-build / pom.xml
1 <?xml version="1.0"?>
2 <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"
3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4   <modelVersion>4.0.0</modelVersion>
5
6   <parent>
7     <artifactId>tools</artifactId>
8     <groupId>com.google.i18n.phonenumbers</groupId>
9     <version>1.0-SNAPSHOT</version>
10   </parent>
11
12   <groupId>com.google.i18n.phonenumbers.tools</groupId>
13   <artifactId>cpp-build</artifactId>
14   <version>1.0-SNAPSHOT</version>
15   <name>Libphonenumber C++ build tools</name>
16   <description>
17     C++ build tools that download dependencies under base/ from the Chromium source repository, and
18     generate the C++ metadata code needed to build the libphonenumber library.
19   </description>
20
21   <build>
22     <sourceDirectory>src</sourceDirectory>
23     <testSourceDirectory>test</testSourceDirectory>
24     <plugins>
25       <plugin>
26         <groupId>org.apache.maven.plugins</groupId>
27         <artifactId>maven-compiler-plugin</artifactId>
28         <configuration>
29           <source>1.5</source>
30           <target>1.5</target>
31         </configuration>
32       </plugin>
33       <!-- Create a directory called 'generated'. -->
34       <plugin>
35         <groupId>org.apache.maven.plugins</groupId>
36         <artifactId>maven-antrun-plugin</artifactId>
37         <executions>
38           <execution>
39             <id>create-generated-directory</id>
40             <phase>generate-sources</phase>
41             <configuration>
42               <tasks>
43                 <mkdir dir="generated"/>
44               </tasks>
45             </configuration>
46             <goals>
47               <goal>run</goal>
48             </goals>
49           </execution>
50         </executions>
51       </plugin>
52       <!-- Add generated/ to the source directories. -->
53       <plugin>
54         <groupId>org.codehaus.mojo</groupId>
55         <artifactId>build-helper-maven-plugin</artifactId>
56         <executions>
57           <execution>
58             <id>add-source</id>
59             <phase>generate-sources</phase>
60             <goals>
61               <goal>add-source</goal>
62             </goals>
63             <configuration>
64               <sources>
65                 <source>generated/</source>
66                 <!-- Also add ../common/src/ which contains BuildMetadataFromXml.java -->
67                 <source>../common/src/</source>
68               </sources>
69             </configuration>
70           </execution>
71         </executions>
72       </plugin>
73       <!-- Invoke Protocol Buffers compiler to generate Phonemetadata.java. -->
74       <plugin>
75         <groupId>org.codehaus.mojo</groupId>
76         <artifactId>exec-maven-plugin</artifactId>
77         <executions>
78           <execution>
79             <phase>generate-sources</phase>
80             <goals>
81               <goal>exec</goal>
82             </goals>
83           </execution>
84         </executions>
85         <configuration>
86           <executable>protoc</executable>
87           <arguments>
88             <argument>--java_out=generated</argument>
89             <argument>../../../resources/phonemetadata.proto</argument>
90             <argument>--proto_path=../../../resources</argument>
91           </arguments>
92         </configuration>
93       </plugin>
94       <plugin>
95         <groupId>org.apache.maven.plugins</groupId>
96         <artifactId>maven-jar-plugin</artifactId>
97         <configuration>
98           <archive>
99             <manifest>
100               <addClasspath>true</addClasspath>
101               <mainClass>com.google.i18n.phonenumbers.EntryPoint</mainClass>
102             </manifest>
103           </archive>
104         </configuration>
105       </plugin>
106       <!-- Build a JAR with its dependencies (protocol buffers and common library). This JAR
107            contains the C++ build tools invoked by CMake during the libphonenumber C++ build. -->
108       <plugin>
109         <groupId>org.apache.maven.plugins</groupId>
110         <artifactId>maven-assembly-plugin</artifactId>
111         <configuration>
112           <descriptorRefs>
113             <descriptorRef>jar-with-dependencies</descriptorRef>
114           </descriptorRefs>
115           <archive>
116             <manifest>
117               <addClasspath>true</addClasspath>
118               <mainClass>com.google.i18n.phonenumbers.EntryPoint</mainClass>
119             </manifest>
120           </archive>
121         </configuration>
122         <executions>
123           <execution>
124             <id>make-assembly</id>
125             <phase>package</phase>
126             <goals>
127               <goal>single</goal>
128             </goals>
129           </execution>
130         </executions>
131       </plugin>
132     </plugins>
133   </build>
134
135   <dependencies>
136     <dependency>
137       <groupId>junit</groupId>
138       <artifactId>junit</artifactId>
139       <version>4.8.1</version>
140       <scope>test</scope>
141     </dependency>
142     <dependency>
143       <groupId>com.google.protobuf</groupId>
144       <artifactId>protobuf-java</artifactId>
145       <version>2.4.0a</version>
146     </dependency>
147   </dependencies>
148
149 </project>