-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matter/Chip libraries in Maven #211
Comments
Hi Jon, Thanks for your interest and engagement with the sample! We're not planning to update We don’t want to incorporate the build process into the sample offering because supporting potential SDK build issues in different user environments is out of scope for this project. Here is one possible strategy to build new library versions in case it's helpful to you; you might incorporate a similar script into your project’s build process. Note the below was executed with Edit these to suit your environment # Input
chipvers=<Desired SDK hash>
destdir=<The /libs directory of your library in you android app project> Find a build container git clone https://github.com/project-chip/connectedhomeip.git
cd connectedhomeip
git checkout $chipvers
buildimage=$(cat .github/workflows/full-android.yaml | grep chip-build-android | head -n 1 | awk '{print $2}')
echo "Using $buildimage"
# Run the build container
docker run -it --rm \
--mount source=$(pwd),target=/workspace,type=bind \
--workdir="/workspace" \
$buildimage /bin/bash Within the container: # Execute build
chown -R $(whoami) /workspace
git submodule update -f --init --recursive
source ./scripts/bootstrap.sh
./scripts/build/build_examples.py \
--target android-arm-chip-tool \
--target android-arm64-chip-tool \
--target android-x86-chip-tool \
--target android-x64-chip-tool \
build
# Strip for size
ndkpath="$ANDROID_HOME/.."
ndktgt=$(ls -la $ndkpath | awk '{print $NF}' | sort -r | grep ndk | head -n 1)
ndkfq="$ndkpath/$ndktgt/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip"
builddir="/workspace/examples/android/CHIPTool/app/libs/"
echo "Using ndk at $ndkfq to strip .so"
find $builddir -name "*.so" | xargs $ndkfq Exit the container and copy libs to project tree srcdir="connectedhomeip/examples/android/CHIPTool/app/libs/"
cp -R $srcdir $destdir Then in your android lib’s Gradle config, you can simply reference the blobs like this sourceSets {
main {
jniLibs.srcDirs = ['libs/jniLibs']
}
} The topic of an official release exceeds the scope of this sample app project, but we will work to ensure your feedback is noted where relevant. |
https://central.sonatype.com/artifact/com.google.matter/matter-android-demo-sdk/versions
Is there a script to make this? I would find it more useful to have multiple versions of the artifact: Matter 1.0, Matter 1.1, Matter 1.2 and Matter Head. Can you see if the Google Matter developers will put up official build releases in Maven?
The text was updated successfully, but these errors were encountered: