Advertisement
Guest User

Untitled

a guest
Jan 1st, 2015
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. luk@luk-pc:/mnt/android/cm-12$ cat build.sh
  2. . build/envsetup.sh
  3. export USE_CCACHE=1
  4. export PRODUCT_PREBUILT_WEBVIEWCHROMIUM=yes
  5.  
  6. #rm -rf out/target/product/baffinlite/obj/KERNEL_OBJ/source/tools/gator/daemon
  7.  
  8. mkdir -p "out/target/product/$1/system/app/webview/lib/arm"
  9. mkdir -p "out/target/product/$1/system/lib"
  10.  
  11. `cp -R prebuilts/chromium/$1/app/* out/target/product/$1/system/app/`
  12. `cp -R prebuilts/chromium/$1/lib/* out/target/product/$1/system/lib/`
  13. `cp -R prebuilts/chromium/$1/app/webview/lib/arm/libwebviewchromium.so out/target/product/$1/system/app/webview/lib/arm/libwebviewchromium.so`
  14.  
  15. time brunch "$1"
  16.  
  17. ============
  18.  
  19. luk@luk-pc:/mnt/android/cm-12$ cat chromium_prebuilt.sh
  20. #!/bin/sh
  21.  
  22. # Copyright (C) 2014 The OmniROM Project
  23. #
  24. # Licensed under the Apache License, Version 2.0 (the "License");
  25. # you may not use this file except in compliance with the License.
  26. # You may obtain a copy of the License at
  27. #
  28. # http://www.apache.org/licenses/LICENSE-2.0
  29. #
  30. # Unless required by applicable law or agreed to in writing, software
  31. # distributed under the License is distributed on an "AS IS" BASIS,
  32. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  33. # See the License for the specific language governing permissions and
  34. # limitations under the License.
  35.  
  36. # This works, but there has to be a better way of reliably getting the root build directory...
  37. if [ $# -eq 1 ]; then
  38. TOP=$1
  39. DEVICE=`echo $TARGET_PRODUCT | sed 's/cm_//g'`
  40. elif [ -n "$(gettop)" ]; then
  41. TOP=$(gettop)
  42. DEVICE=$(get_build_var TARGET_DEVICE)
  43. else
  44. echo "Please run envsetup.sh and lunch before running this script,"
  45. echo "or provide the build root directory as the first parameter."
  46. return 1
  47. fi
  48.  
  49. TARGET_DIR=$OUT
  50. PREBUILT_DIR=$TOP/prebuilts/chromium/$DEVICE
  51.  
  52. if [ -d $PREBUILT_DIR ]; then
  53. rm -rf $PREBUILT_DIR
  54. fi
  55.  
  56. mkdir -p $PREBUILT_DIR
  57. mkdir -p $PREBUILT_DIR/app
  58. mkdir -p $PREBUILT_DIR/lib
  59.  
  60. if [ -d $TARGET_DIR ]; then
  61. echo "Copying files..."
  62. cp -r $TARGET_DIR/system/app/webview $PREBUILT_DIR/app
  63. cp $TARGET_DIR/system/lib/libwebviewchromium.so $PREBUILT_DIR/lib/libwebviewchromium.so
  64. cp $TARGET_DIR/system/lib/libwebviewchromium_plat_support.so $PREBUILT_DIR/lib/libwebviewchromium_plat_support.so
  65. cp $TARGET_DIR/system/lib/libwebviewchromium_loader.so $PREBUILT_DIR/lib/libwebviewchromium_loader.so
  66. else
  67. echo "Please ensure that you have ran a full build prior to running this script!"
  68. return 1;
  69. fi
  70.  
  71. echo "Generating Makefiles..."
  72.  
  73. HASH=$(git --git-dir=$TOP/external/chromium_org/.git --work-tree=$TOP/external/chromium_org rev-parse --verify HEAD)
  74. echo $HASH > $PREBUILT_DIR/hash.txt
  75.  
  76. (cat << EOF) | sed s/__DEVICE__/$DEVICE/g > $PREBUILT_DIR/chromium_prebuilt.mk
  77. # Copyright (C) 2014 The OmniROM Project
  78. #
  79. # Licensed under the Apache License, Version 2.0 (the "License");
  80. # you may not use this file except in compliance with the License.
  81. # You may obtain a copy of the License at
  82. #
  83. # http://www.apache.org/licenses/LICENSE-2.0
  84. #
  85. # Unless required by applicable law or agreed to in writing, software
  86. # distributed under the License is distributed on an "AS IS" BASIS,
  87. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  88. # See the License for the specific language governing permissions and
  89. # limitations under the License.
  90.  
  91. LOCAL_PATH := prebuilts/chromium/__DEVICE__/
  92.  
  93. PRODUCT_COPY_FILES += \\
  94. \$(LOCAL_PATH)/app/webview/webview.apk:system/app/webview/webview.apk \\
  95. \$(LOCAL_PATH)/lib/libwebviewchromium.so:system/lib/libwebviewchromium.so \\
  96. \$(LOCAL_PATH)/lib/libwebviewchromium_plat_support.so:system/lib/libwebviewchromium_plat_support.so \\
  97. \$(LOCAL_PATH)/lib/libwebviewchromium_loader.so:system/lib/libwebviewchromium_loader.so
  98.  
  99. \$(shell mkdir -p out/target/product/__DEVICE__/system/app/webview/lib/arm/)
  100. \$(shell cp -r \$(LOCAL_PATH)/app/webview/lib/arm/libwebviewchromium.so out/target/product/__DEVICE__/system/app/webview/lib/arm/libwebviewchromium.so)
  101.  
  102. EOF
  103.  
  104. echo "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement