Files
mozc/.gitattributes
Yohei Yukawa b0a604f110 Use 'android_binary' rule to build 'libmozc.so'
This is a follow up to my previous commit [1], which aimed to build
'libmozc.so' for relevant architectures.

Although in the above commit I believe I followed exactly the same step
explained in the Bazel document [2], it seems that artifact files are
not ready to run on the actual Android devices.  Perhaps it might be
because the above approach is for those who want to build native
libraries for Android without building an APK, which is somewhat
not-a-major use case and may not be well maintained.  This is why I
ended up building a temporary fat APK only to extract native libraries
from it.

Basically what this commit does are:

 1. Build a fat APK, which depends on 'mozcjni' cc_library target.
 2. Extract native libraries from the APK and zip it as native_libs.zip

The temporary APK used here is completely empty and used only for
building purpose.

The 'package' meta target is updated to point to the native library
build target, which is 'android/jni:native_libs'.

 bazel build --config oss_android package
 ls bazel-bin/android/jni/native_libs.zip

'.bazelrc' is also updated because Android build starts using the
following options instead.

 * --android_crosstool_top=@androidndk//:toolchain
 * --fat_apk_cpu=armeabi-v7a,arm64-v8a,x86,x86_64

Dockerfile is also updated because now Android build requires not only
Android NDK but also Android SDK.

This commit only affects Android build target.  Other build target
should continue to success without installing Android SDK/NDK.

Closes #840.

 [1]: 5a6e457b72
 [2]: https://bazel.build/docs/android-ndk#cclibrary-android
 [3]: https://bazel.build/docs/android-ndk

PiperOrigin-RevId: 578420951
2023-11-01 07:13:42 +00:00

48 lines
907 B
Plaintext

# Mozc project expects all the checked out text files to have LF line ending
# not only on mac/Linux but also on Windows.
# See https://stackoverflow.com/a/42135910
* text=auto eol=lf
# Known text files
*.bazel text
*.bzl text
*.c text
*.cc text
*.def text
*.el text
*.gyp text diff=python
*.gypi text diff=python
*.h text
*.kcm text
*.m text diff=objc
*.mm text diff=objcpp
*.manifest text
*.md text
*.proto text
*.py text
*.rc text
*.sh text
*.svg text
*.textproto text
*.tsv text
*.txt text
*.TXT text
*.wxi text
*.wxs text
*.xml text
# Known binary files
*.a binary
*.deflate binary
*.png binary
*.jpg binary
*.bmp binary
*.ico binary
*.tiff binary
# Workaround for GitHub graph timeouts
# Treat large dictionary data files as binary.
# https://github.com/google/mozc/issues/789
src/data/dictionary_oss/connection_single_column.txt binary
src/data/test/dictionary/connection_single_column.txt binary