Commits

Patrick Mézard committed e9e358e Merge

Merge with r410

Comments (0)

Files changed (6)

 This project uses some third-party code:
   - src/phonenumbers/utf/ sources come from lib9 which is also used in Go.
 
+
+Building the library on GNU/Linux
+---------------------------------
 Requirements:
   - CMake build system
     http://www.cmake.org
   $ cmake ..
   $ make
 
-Supported build parameters:
+
+Building the library on Windows (Visual Studio)
+-----------------------------------------------
+The library was tested with Visual Studio 2010.
+
+You will need to manually fetch and install the following dependencies:
+  - CMake (tested with v2.8.6):
+    http://cmake.org/cmake/resources/software.html
+    * Download and install the Win32 installer.
+
+  - Boost (tested with v1.44) from BoostPro:
+    http://www.boostpro.com/download/
+    * Select all the variants and Boost DateTime and Boost Thread during the
+      installation process.
+
+  - GTest (tested with v1.6.0):
+    http://code.google.com/p/googletest/downloads/list
+    * Open msvc/gtest-md.sln with Visual Studio and build the whole solution.
+
+  - ICU (MSVC binaries, tested with v4.8.1):
+    http://site.icu-project.org/download/48#ICU4C-Download
+    * Simply extract the archive.
+
+  - Protocol Buffers:
+    http://code.google.com/p/protobuf/downloads/list
+    * Open vsprojects/protobuf.sln with Visual Studio and build the whole
+      solution.
+
+Then run cmake-gui and specify the path to the libphonenumber's cpp directory
+and its build directory which must be created (e.g. cpp/build).
+
+When clicking on "Configure", specify the appropriate Visual Studio version
+(tested with 2010).
+
+Then CMake will need your help to locate the dependencies. You will have to set
+the following variables (this example assumes that you extracted the
+dependencies to C:/).
+
+GTEST_INCLUDE_DIR         C:/gtest-1.6.0/include
+GTEST_LIB                 C:/gtest-1.6.0/msvc/gtest-md/Release/gtest.lib
+
+ICU_I18N_INCLUDE_DIR      C:/icu/include
+ICU_I18N_LIB              C:/icu/lib/icuin.lib
+
+ICU_UC_INCLUDE_DIR        C:/icu/include
+ICU_UC_LIB                C:/icu/lib/icuuc.lib
+
+PROTOBUF_INCLUDE_DIR      C:/protobuf-2.4.1/src
+PROTOBUF_LIB              C:/protobuf-2.4.1/vsprojects/Release/libprotobuf.lib
+PROTOC_BIN                C:/protobuf-2.4.1/vsprojects/Release/protoc.exe
+
+Then you can click on "Configure" again. CMake should have located all the
+dependencies.
+Then click on "Generate" to generate the appropriate Visual Studio project.
+Then open cpp/build/libphonenumber.sln with Visual Studio and build the INSTALL
+target.
+
+As a result the library's headers and binaries should have been installed to
+C:/Program Files/libphonenumber/.
+Note that this path can be set by overriding the CMAKE_INSTALL_PREFIX variable
+with cmake-gui.
+
+Supported build parameters
+--------------------------
   Build parameters can be specified invoking CMake with '-DKEY=VALUE' or using a
   CMake user interface (ccmake or cmake-gui).
 

cpp/test/phonenumbers/unicodestring_test.cc

 
 using std::ostream;
 
+namespace i18n {
+namespace phonenumbers {
+
 // Used by GTest to print the expected and actual results in case of failure.
-ostream& operator<<(ostream& out, const i18n::phonenumbers::UnicodeString& s) {
+ostream& operator<<(ostream& out, const UnicodeString& s) {
   string utf8;
   s.toUTF8String(utf8);
   out << utf8;
   return out;
 }
 
-namespace i18n {
-namespace phonenumbers {
-
 TEST(UnicodeString, ToUTF8StringWithEmptyString) {
   UnicodeString s;
   string utf8;
+How to install the Appengine SDK to the Maven local repository?
+Note that this needs to be done only once.
+  $ mvn gae:unpack
+  Note that you don't need to manually download any SDK.
+
+How to generate the WAR?
+  $ mvn package
+  $ mvn war:war
+  Note that this must be done before running the webapp locally and before
+  deploying it to Appengine.
+
+How to run the webapp locally?
+  $ mvn gae:run
+
+How to deploy the webapp to Appengine?
+  $ mvn gae:update

java/demo/pom.xml

+<?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>libphonenumber-parent</artifactId>
+    <groupId>com.googlecode.libphonenumber</groupId>
+    <version>4.4-SNAPSHOT</version>
+  </parent>
+  <groupId>com.googlecode.libphonenumber</groupId>
+  <artifactId>demo</artifactId>
+  <version>4.4-SNAPSHOT</version>
+
+  <properties>
+    <gae.version>1.5.4</gae.version>
+  </properties>
+
+  <repositories>
+    <repository>
+      <id>mvnrepository</id>
+      <url>http://mvnrepository.com/artifact/</url>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+
+  <dependencies>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.3.2</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-fileupload</groupId>
+      <artifactId>commons-fileupload</artifactId>
+      <version>1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>com.googlecode.libphonenumber</groupId>
+      <artifactId>libphonenumber</artifactId>
+      <version>4.4-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>com.googlecode.libphonenumber</groupId>
+      <artifactId>geocoder</artifactId>
+      <version>1.8-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <sourceDirectory>src</sourceDirectory>
+    <testSourceDirectory>test</testSourceDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>net.kindleit</groupId>
+        <artifactId>maven-gae-plugin</artifactId>
+        <version>0.9.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.1.1</version>
+        <configuration>
+          <warSourceDirectory>war</warSourceDirectory>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.1.10</version>
+        <configuration>
+          <webAppSourceDirectory>webapp</webAppSourceDirectory>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <webAppConfig>
+            <contextPath>/</contextPath>
+          </webAppConfig>
+          <connectors>
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+              <port>8080</port>
+              <maxIdleTime>60000</maxIdleTime>
+            </connector>
+          </connectors>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
   <modules>
     <module>libphonenumber</module>
     <module>geocoder</module>
+    <module>demo</module>
   </modules>
 
   <build>

tools/java/data/README

   Note that you don't need to manually download any SDK.
 
 How to generate the WAR?
-Note that this must be done before running the webapp locally and before
-deploying it to Appengine.
+  $ mvn package
   $ mvn war:war
+  Note that this must be done before running the webapp locally and before
+  deploying it to Appengine.
 
 How to run the webapp locally?
   $ mvn gae:run