Reorganize project structure to make it easy to build.

Change-Id: Icbb98629b98d5ddda00faa8316835c94ecc32331
diff --git a/Android.mk b/Android.mk
index a81186a..7003246 100644
--- a/Android.mk
+++ b/Android.mk
@@ -17,16 +17,9 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := protobuf
+LOCAL_SRC_FILES := $(call all-java-files-under, java/src)
 
-LOCAL_SRC_FILES := java/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java \
-	java/src/com/google/i18n/phonenumbers/NumberParseException.java \
-	java/src/com/google/i18n/phonenumbers/Phonemetadata.java \
-	java/src/com/google/i18n/phonenumbers/Phonenumber.java \
-	java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java \
-	java/src/com/google/i18n/phonenumbers/RegexCache.java
-
-LOCAL_JAVA_RESOURCE_DIRS := java/resources/com/google/i18n/phonenumbers/src/generated_files
+LOCAL_JAVA_RESOURCE_DIRS := java/src
 
 LOCAL_MODULE := libphonenumber
 
diff --git a/README.android b/README.android
index f77b408..14f4628 100644
--- a/README.android
+++ b/README.android
@@ -1,4 +1,4 @@
 URL: http://code.google.com/p/libphonenumber/
-Version: r31
+Version: r34
 License: Apache 2
 Description: Google Phone Number Library.
diff --git a/java/build.xml b/java/build.xml
index 9fd344d..27c2910 100644
--- a/java/build.xml
+++ b/java/build.xml
@@ -26,6 +26,7 @@
     <mkdir dir="${classes.dir}"/>
     <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
     <javac srcdir="${test.dir}" destdir="${classes.dir}" classpathref="classpath"/>
+    <javac srcdir="${resources.dir}" destdir="${classes.dir}" classpathref="classpath"/>
   </target>
 
   <target name="jar" depends="compile">
@@ -35,7 +36,7 @@
         <include name="**/*.class"/>
         <exclude name="**/*Test*"/>
       </fileset>
-      <fileset dir="${resources.dir}">
+      <fileset dir="${src.dir}">
         <include name="**/PhoneNumberMetadataProto"/>
       </fileset>
     </jar>
@@ -48,8 +49,10 @@
         <include name="**/*.class"/>
         <exclude name="**/*Test*"/>
       </fileset>
-      <fileset dir="${resources.dir}">
+      <fileset dir="${src.dir}">
         <include name="**/PhoneNumberMetadataProto"/>
+      </fileset>
+      <fileset dir="${test.dir}">
         <include name="**/PhoneNumberMetadataProtoForTesting"/>
       </fileset>
     </jar>
diff --git a/java/src/com/google/i18n/phonenumbers/BuildMetadataProtoFromXml.java b/java/resources/com/google/i18n/phonenumbers/BuildMetadataProtoFromXml.java
similarity index 100%
rename from java/src/com/google/i18n/phonenumbers/BuildMetadataProtoFromXml.java
rename to java/resources/com/google/i18n/phonenumbers/BuildMetadataProtoFromXml.java
diff --git a/java/src/com/google/i18n/phonenumbers/phonemetadata.proto b/java/resources/com/google/i18n/phonenumbers/proto/phonemetadata.proto
similarity index 100%
rename from java/src/com/google/i18n/phonenumbers/phonemetadata.proto
rename to java/resources/com/google/i18n/phonenumbers/proto/phonemetadata.proto
diff --git a/java/src/com/google/i18n/phonenumbers/phonenumber.proto b/java/resources/com/google/i18n/phonenumbers/proto/phonenumber.proto
similarity index 100%
rename from java/src/com/google/i18n/phonenumbers/phonenumber.proto
rename to java/resources/com/google/i18n/phonenumbers/proto/phonenumber.proto
diff --git a/java/resources/com/google/i18n/phonenumbers/src/generated_files/PhoneNumberMetadataProto b/java/src/com/google/i18n/phonenumbers/PhoneNumberMetadataProto
similarity index 100%
rename from java/resources/com/google/i18n/phonenumbers/src/generated_files/PhoneNumberMetadataProto
rename to java/src/com/google/i18n/phonenumbers/PhoneNumberMetadataProto
Binary files differ
diff --git a/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java b/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java
index 12a8b46..ce0ab66 100644
--- a/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java
+++ b/java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java
@@ -50,7 +50,7 @@
   private static final int MIN_LENGTH_FOR_NSN = 3;
   private static final int MAX_LENGTH_FOR_NSN = 15;
   private static final String META_DATA_FILE =
-      "/com/google/i18n/phonenumbers/src/generated_files/PhoneNumberMetadataProto";
+      "/com/google/i18n/phonenumbers/PhoneNumberMetadataProto";
   private static final Logger LOGGER = Logger.getLogger(PhoneNumberUtil.class.getName());
 
   // A mapping from a country code to a region code which denotes the country/region
diff --git a/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java b/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java
index 7be5f5b..087e52e 100644
--- a/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java
+++ b/java/test/com/google/i18n/phonenumbers/AsYouTypeFormatterTest.java
@@ -32,7 +32,7 @@
 public class AsYouTypeFormatterTest extends TestCase {
   private PhoneNumberUtil phoneUtil;
   private static final String TEST_META_DATA_FILE =
-      "/com/google/i18n/phonenumbers/test/generated_files/PhoneNumberMetadataProtoForTesting";
+      "/com/google/i18n/phonenumbers/PhoneNumberMetadataProtoForTesting";
 
   public AsYouTypeFormatterTest() {
     PhoneNumberUtil.resetInstance();
diff --git a/java/resources/com/google/i18n/phonenumbers/test/generated_files/PhoneNumberMetadataProtoForTesting b/java/test/com/google/i18n/phonenumbers/PhoneNumberMetadataProtoForTesting
similarity index 100%
rename from java/resources/com/google/i18n/phonenumbers/test/generated_files/PhoneNumberMetadataProtoForTesting
rename to java/test/com/google/i18n/phonenumbers/PhoneNumberMetadataProtoForTesting
Binary files differ
diff --git a/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java b/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java
index a8206fe..9499fbe 100644
--- a/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java
+++ b/java/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java
@@ -41,7 +41,7 @@
 public class PhoneNumberUtilTest extends TestCase {
   private PhoneNumberUtil phoneUtil;
   private static final String TEST_META_DATA_FILE =
-      "/com/google/i18n/phonenumbers/test/generated_files/PhoneNumberMetadataProtoForTesting";
+      "/com/google/i18n/phonenumbers/PhoneNumberMetadataProtoForTesting";
 
   public PhoneNumberUtilTest() {
     PhoneNumberUtil.resetInstance();