summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-05-13 14:58:15 -0700
committerDeepanshu Gupta <deepanshu@google.com>2015-05-13 18:15:32 -0700
commiteca056926a5acacbd1fe6b144df2d2952dc4a86e (patch)
tree99e383966d6e06cf9d7b09ffca941a88e83f392c /tools
parentd77b9ed7dcc42efca33b225c4594a30aab9e709c (diff)
downloadframeworks_base-eca056926a5acacbd1fe6b144df2d2952dc4a86e.zip
frameworks_base-eca056926a5acacbd1fe6b144df2d2952dc4a86e.tar.gz
frameworks_base-eca056926a5acacbd1fe6b144df2d2952dc4a86e.tar.bz2
Load ICU data in LayoutLib
Also return the correct version numbers for ICU data. Change-Id: I7de973b5553c73948870b97bdc12a880bb2fdd85
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/.idea/runConfigurations/Create.xml2
-rw-r--r--tools/layoutlib/Android.mk10
-rw-r--r--tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java12
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java1
4 files changed, 19 insertions, 6 deletions
diff --git a/tools/layoutlib/.idea/runConfigurations/Create.xml b/tools/layoutlib/.idea/runConfigurations/Create.xml
index ff173e5..bf8eba1 100644
--- a/tools/layoutlib/.idea/runConfigurations/Create.xml
+++ b/tools/layoutlib/.idea/runConfigurations/Create.xml
@@ -3,7 +3,7 @@
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.android.tools.layoutlib.create.Main" />
<option name="VM_PARAMETERS" value="" />
- <option name="PROGRAM_PARAMETERS" value="out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/javalib.jar" />
+ <option name="PROGRAM_PARAMETERS" value="out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/icu4j-icudata-jarjar_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/icu4j-icutzdata-jarjar_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/javalib.jar" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../../../../" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
diff --git a/tools/layoutlib/Android.mk b/tools/layoutlib/Android.mk
index 9300401..a0bfe62 100644
--- a/tools/layoutlib/Android.mk
+++ b/tools/layoutlib/Android.mk
@@ -37,6 +37,12 @@ built_ext_dep := $(call java-lib-deps,ext)
built_ext_classes := $(call java-lib-files,ext)
built_ext_data := $(call intermediates-dir-for, \
JAVA_LIBRARIES,ext,,COMMON)/javalib.jar
+built_icudata_dep := $(call java-lib-deps,icu4j-icudata-jarjar)
+built_icudata_data := $(call intermediates-dir-for, \
+ JAVA_LIBRARIES,icu4j-icudata-jarjar,,COMMON)/javalib.jar
+built_icutzdata_dep := $(call java-lib-deps,icu4j-icutzdata-jarjar)
+built_icutzdata_data := $(call intermediates-dir-for, \
+ JAVA_LIBRARIES,icu4j-icutzdata-jarjar,,COMMON)/javalib.jar
built_layoutlib_create_jar := $(call intermediates-dir-for, \
JAVA_LIBRARIES,layoutlib_create,HOST)/javalib.jar
@@ -56,6 +62,8 @@ $(LOCAL_BUILT_MODULE): $(built_core_dep) \
$(built_framework_dep) \
$(built_ext_dep) \
$(built_ext_data) \
+ $(built_icudata_dep) \
+ $(built_icutzdata_dep) \
$(built_layoutlib_create_jar)
$(hide) echo "host layoutlib_create: $@"
$(hide) mkdir -p $(dir $@)
@@ -66,6 +74,8 @@ $(LOCAL_BUILT_MODULE): $(built_core_dep) \
$(built_core_classes) \
$(built_framework_classes) \
$(built_ext_classes) \
+ $(built_icudata_data) \
+ $(built_icutzdata_data) \
$(built_ext_data)
$(hide) ls -l $(built_framework_classes)
diff --git a/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java b/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
index a6cbe56..9c58010 100644
--- a/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
+++ b/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
@@ -21,6 +21,7 @@ import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
import android.icu.text.DateTimePatternGenerator;
import android.icu.util.Currency;
import android.icu.util.ULocale;
+import android.icu.util.VersionInfo;
import java.util.Locale;
@@ -54,18 +55,19 @@ public class ICU_Delegate {
}
@LayoutlibDelegate
+ @SuppressWarnings("deprecation")
/*package*/ static String getCldrVersion() {
- return "22.1.1"; // TODO: check what the right value should be.
+ return VersionInfo.ICU_DATA_VERSION.toString();
}
@LayoutlibDelegate
/*package*/ static String getIcuVersion() {
- return "unknown_layoutlib";
+ return VersionInfo.ICU_VERSION.toString();
}
@LayoutlibDelegate
/*package*/ static String getUnicodeVersion() {
- return "5.2";
+ return VersionInfo.UNICODE_7_0.toString();
}
@LayoutlibDelegate
@@ -182,8 +184,8 @@ public class ICU_Delegate {
/*package*/ static boolean initLocaleDataNative(String locale, LocaleData result) {
// Used by Calendar.
- result.firstDayOfWeek = Integer.valueOf(1);
- result.minimalDaysInFirstWeek = Integer.valueOf(1);
+ result.firstDayOfWeek = 1;
+ result.minimalDaysInFirstWeek = 1;
// Used by DateFormatSymbols.
result.amPm = new String[] { "AM", "PM" };
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
index 7ca050b..7872fee 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
@@ -123,6 +123,7 @@ public class Main {
excludeClasses,
new String[] {
"com/android/i18n/phonenumbers/data/*",
+ "android/icu/impl/data/**"
});
aa.analyze();
agen.generate();