Permalink
Browse files

Don't use ALL_PREBUILT

Bug: 6294985
With ALL_PREBUILT it just installs the data files to all devices.
We switch to a config.mk, which will be included by module definition of
VoiceDialer.apk and set up the necessary dependency.
TODO: modulize the config files and have VoiceDialer.apk depend on them.

Change-Id: I25ecb9888960806acda808ef8f5e88fe9bcb48bb
  • Loading branch information...
wangying1015 committed Jun 14, 2012
1 parent 2018726 commit 3b86e1f2371f3bfb4b798d5c7671bf8ed79f5caf
Showing with 34 additions and 13 deletions.
  1. +11 −12 config/en.us/Android.mk
  2. +21 −0 config/en.us/config.mk
  3. +2 −1 srec_jni/Android.mk
View
@@ -1,6 +1,6 @@
LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
+########################################
copy_from := \
baseline11k.par \
@@ -23,7 +23,8 @@ copy_to := $(addprefix $(TARGET_OUT)/usr/srec/config/en.us/,$(copy_from))
$(copy_to) : $(TARGET_OUT)/usr/srec/config/en.us/% : $(LOCAL_PATH)/% | $(ACP)
$(transform-prebuilt-to-target)
-ALL_PREBUILT += $(copy_to)
+# ALL_PREBUILT is deprecated. Moved to config.mk
+# ALL_PREBUILT += $(copy_to)
# define paths to some grammar tools
@@ -45,9 +46,10 @@ srec_grammars : \
$(G2G_INSTALL_PATH)/ipaq_commands.g2g \
$(G2G_INSTALL_PATH)/lookup.g2g \
-ALL_PREBUILT += $(G2G_INSTALL_PATH)/VoiceDialer.g2g \
- $(G2G_INSTALL_PATH)/boolean.g2g \
- $(G2G_INSTALL_PATH)/phone_type_choice.g2g
+# ALL_PREBUILT is deprecated. Moved to config.mk
+# ALL_PREBUILT += $(G2G_INSTALL_PATH)/VoiceDialer.g2g \
+# $(G2G_INSTALL_PATH)/boolean.g2g \
+# $(G2G_INSTALL_PATH)/phone_type_choice.g2g
#---------------------------------------------------------------------------------
# Explicit rules.
@@ -72,7 +74,6 @@ $(G2G_INSTALL_PATH)/%.g2g: $(LOCAL_PATH)/grammars/%.grxml $(GRXML) $(MAKE_G2G) $
$(MAKE_G2G) -base $(G2G_INSTALL_PATH)/$*,addWords=0 -out $@
(cd $(G2G_INSTALL_PATH); rm -f $*.Grev2.det.txt $*.map $*.omap $*.P.txt $*.params $*.PCLG.txt $*.script)
-
#-----------------------------------------------------------------
# this rule generates cmu6plus.ok.zip, which is built manually and checked in.
# the grxml compiler expects this (and other) data files to be here.
@@ -97,14 +98,12 @@ cmu6plus.ok.zip: $(CMU2NUANCE) $(DICT_DIR)/c0.6 $(DICT_DIR)/numbers.ok $(DICT_DI
echo -e "\n+++ advzip not installed; fell back to zip\n cmu6plus.ok.zip (`du -h cmu6plus.ok.zip | cut -f 1`) could be ~10% smaller with advzip\n"))
-
#-----------------------------------------------------------------
# build cmu2nuance dictionary conversion program, to prevent bitrot
#-----------------------------------------------------------------
-
-LOCAL_SRC_FILES:= dictionary/cmu2nuance.cpp
-
-LOCAL_MODULE:= cmu2nuance
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := dictionary/cmu2nuance.cpp
+LOCAL_MODULE := cmu2nuance
+LOCAL_MODULE_TAGS := optional
include $(BUILD_HOST_EXECUTABLE)
-
View
@@ -0,0 +1,21 @@
+# Config files to be installed.
+SREC_CONFIG_TARGET_FILES := \
+ $(addprefix $(TARGET_OUT)/usr/srec/config/en.us/, \
+ baseline11k.par \
+ baseline8k.par \
+ baseline.par \
+ dictionary/basic.ok \
+ dictionary/enroll.ok \
+ dictionary/cmu6plus.ok.zip \
+ g2p/en-US-ttp.data \
+ models/generic.swiarb \
+ models/generic11.lda \
+ models/generic11_f.swimdl \
+ models/generic11_m.swimdl \
+ models/generic8.lda \
+ models/generic8_f.swimdl \
+ models/generic8_m.swimdl) \
+ $(addprefix $(TARGET_OUT)/usr/srec/config/en.us/grammars/, \
+ VoiceDialer.g2g \
+ boolean.g2g \
+ phone_type_choice.g2g)
View
@@ -71,5 +71,6 @@ LOCAL_LDLIBS += -lpthread
LOCAL_MODULE := libsrec_jni
-include $(BUILD_SHARED_LIBRARY)
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_SHARED_LIBRARY)

0 comments on commit 3b86e1f

Please sign in to comment.