• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        <version>3.11.0</version>
29        <configuration>
30          <source>1.7</source>
31	  <target>1.7</target>
32	  <encoding>UTF-8</encoding>
33        </configuration>
34      </plugin>
35      <!-- Create a directory called 'generated'. -->
36      <plugin>
37        <groupId>org.apache.maven.plugins</groupId>
38        <artifactId>maven-antrun-plugin</artifactId>
39        <version>1.3</version>
40        <executions>
41          <execution>
42            <id>create-generated-directory</id>
43            <phase>generate-sources</phase>
44            <configuration>
45              <tasks>
46                <mkdir dir="generated"/>
47              </tasks>
48            </configuration>
49            <goals>
50              <goal>run</goal>
51            </goals>
52          </execution>
53        </executions>
54      </plugin>
55      <plugin>
56        <groupId>org.codehaus.mojo</groupId>
57        <artifactId>build-helper-maven-plugin</artifactId>
58        <version>3.4.0</version>
59        <executions>
60          <execution>
61            <id>add-source</id>
62            <phase>generate-sources</phase>
63            <goals>
64              <goal>add-source</goal>
65            </goals>
66            <configuration>
67              <sources>
68                <!-- Make BuildMetadataFromXml.java available to the source directories. -->
69                <source>../common/src/</source>
70                <!-- Make Phonemetadata.java available to the source directories.
71                     BuildMetadataFromXml.java has to work with both
72                     tools/java/cpp-build/generated/com/google/i18n/phonenumbers/Phonemetadata.java
73                     and java/libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java.
74                     TODO: This Phonemetadata.java is generated via a protoc dependency that is not
75                     hermetic and may get out of sync with the other one. Make this file hermetic or
76                     find another way to enable Travis CI on this build. -->
77                <source>generated/</source>
78              </sources>
79            </configuration>
80          </execution>
81        </executions>
82      </plugin>
83      <!-- Invoke Protocol Buffers compiler to generate Phonemetadata.java. -->
84      <plugin>
85        <groupId>org.codehaus.mojo</groupId>
86        <artifactId>exec-maven-plugin</artifactId>
87        <version>3.1.0</version>
88        <executions>
89          <execution>
90            <phase>generate-sources</phase>
91            <goals>
92              <goal>exec</goal>
93            </goals>
94          </execution>
95        </executions>
96        <configuration>
97          <executable>protoc</executable>
98          <arguments>
99            <argument>--java_out=generated</argument>
100            <argument>../../../resources/phonemetadata.proto</argument>
101            <argument>--proto_path=../../../resources</argument>
102          </arguments>
103        </configuration>
104      </plugin>
105      <plugin>
106        <groupId>org.apache.maven.plugins</groupId>
107        <artifactId>maven-jar-plugin</artifactId>
108        <version>3.3.0</version>
109        <configuration>
110          <archive>
111            <manifest>
112              <addClasspath>true</addClasspath>
113              <mainClass>com.google.i18n.phonenumbers.EntryPoint</mainClass>
114            </manifest>
115          </archive>
116        </configuration>
117      </plugin>
118      <!-- Build a JAR with its dependencies (protocol buffers and common library). This JAR
119           contains the C++ build tools invoked by CMake during the libphonenumber C++ build. -->
120      <plugin>
121        <groupId>org.apache.maven.plugins</groupId>
122        <artifactId>maven-assembly-plugin</artifactId>
123        <configuration>
124          <descriptorRefs>
125            <descriptorRef>jar-with-dependencies</descriptorRef>
126          </descriptorRefs>
127          <archive>
128            <manifest>
129              <addClasspath>true</addClasspath>
130              <mainClass>com.google.i18n.phonenumbers.EntryPoint</mainClass>
131            </manifest>
132          </archive>
133        </configuration>
134        <executions>
135          <execution>
136            <id>make-assembly</id>
137            <phase>package</phase>
138            <goals>
139              <goal>single</goal>
140            </goals>
141          </execution>
142        </executions>
143      </plugin>
144    </plugins>
145  </build>
146
147  <dependencies>
148    <dependency>
149      <groupId>junit</groupId>
150      <artifactId>junit</artifactId>
151      <version>4.13.2</version>
152      <scope>test</scope>
153    </dependency>
154    <dependency>
155      <groupId>com.google.protobuf</groupId>
156      <artifactId>protobuf-java</artifactId>
157      <version>3.24.0</version>
158    </dependency>
159  </dependencies>
160
161</project>
162