diff --git a/examples/tv-casting-app/android/.gn b/examples/tv-casting-app/android/.gn new file mode 100644 index 00000000000000..5cd171abcda9ff --- /dev/null +++ b/examples/tv-casting-app/android/.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2020-2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + import("//args.gni") +} diff --git a/examples/tv-casting-app/android/App/.gitignore b/examples/tv-casting-app/android/App/.gitignore new file mode 100644 index 00000000000000..d59e52c6fd3f22 --- /dev/null +++ b/examples/tv-casting-app/android/App/.gitignore @@ -0,0 +1,20 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties + +# Shared libs & JAR libs (those libs are copied into source tree for easy Android build). +*.so +*.jar +*.map diff --git a/examples/tv-casting-app/android/App/.idea/.gitignore b/examples/tv-casting-app/android/App/.idea/.gitignore new file mode 100644 index 00000000000000..26d33521af10bc --- /dev/null +++ b/examples/tv-casting-app/android/App/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/examples/tv-casting-app/android/App/.idea/.name b/examples/tv-casting-app/android/App/.idea/.name new file mode 100644 index 00000000000000..999e58f66a2f14 --- /dev/null +++ b/examples/tv-casting-app/android/App/.idea/.name @@ -0,0 +1 @@ +CHIPTVCastingApp \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/.idea/compiler.xml b/examples/tv-casting-app/android/App/.idea/compiler.xml new file mode 100644 index 00000000000000..fb7f4a8a465d42 --- /dev/null +++ b/examples/tv-casting-app/android/App/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/.idea/gradle.xml b/examples/tv-casting-app/android/App/.idea/gradle.xml new file mode 100644 index 00000000000000..526b4c25c6813e --- /dev/null +++ b/examples/tv-casting-app/android/App/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/.idea/jarRepositories.xml b/examples/tv-casting-app/android/App/.idea/jarRepositories.xml new file mode 100644 index 00000000000000..0380d8d3dee94c --- /dev/null +++ b/examples/tv-casting-app/android/App/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/.idea/misc.xml b/examples/tv-casting-app/android/App/.idea/misc.xml new file mode 100644 index 00000000000000..2a4d5b521db9a0 --- /dev/null +++ b/examples/tv-casting-app/android/App/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/.idea/vcs.xml b/examples/tv-casting-app/android/App/.idea/vcs.xml new file mode 100644 index 00000000000000..4fce1d86b49521 --- /dev/null +++ b/examples/tv-casting-app/android/App/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/.gitignore b/examples/tv-casting-app/android/App/app/.gitignore new file mode 100644 index 00000000000000..42afabfd2abebf --- /dev/null +++ b/examples/tv-casting-app/android/App/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/build.gradle b/examples/tv-casting-app/android/App/app/build.gradle new file mode 100644 index 00000000000000..99aabfdba51594 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/build.gradle @@ -0,0 +1,65 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdk 30 + + defaultConfig { + applicationId "com.chip.casting" + minSdk 24 + targetSdk 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + externalNativeBuild { + cmake { + targets "default" + } + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + + debug { + packagingOptions{ + doNotStrip "**/*.so" + } + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + sourceSets { + main { + jniLibs.srcDirs = ['libs/jniLibs'] + + // uncomment this code to debug +// java.srcDirs = [ +// 'src/main/java', +// '../../third_party/connectedhomeip/src/setup_payload/java/src', +// '../../third_party/connectedhomeip/src/platform/android/java', +// '../../third_party/connectedhomeip/src/app/server/java/src/', +// '../../java/src', +// ] + } + } +} + +dependencies { + implementation fileTree(dir: "libs", include: ["*.jar","*.so"]) + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'com.google.android.material:material:1.4.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.1' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + implementation 'com.google.zxing:core:3.3.0' +} \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/libs/README.md b/examples/tv-casting-app/android/App/app/libs/README.md new file mode 100644 index 00000000000000..ca16fbe7e23cf9 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/libs/README.md @@ -0,0 +1,2 @@ +This directory will contain any .jar files required by the TV Casting demo app +for Android. diff --git a/examples/tv-casting-app/android/App/app/libs/jniLibs/README.md b/examples/tv-casting-app/android/App/app/libs/jniLibs/README.md new file mode 100644 index 00000000000000..3a20e5ae7d72c9 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/libs/jniLibs/README.md @@ -0,0 +1,4 @@ +This directory will contain .so files required by TV Casting demo app for +Android. The .so files must be organized into folders by the name of the +corresponding Android architecture for which they are built, eg. arm64-v8a, x86, +x86_64, etc. diff --git a/examples/tv-casting-app/android/App/app/proguard-rules.pro b/examples/tv-casting-app/android/App/app/proguard-rules.pro new file mode 100644 index 00000000000000..481bb434814107 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/androidTest/java/com/chip/casting/ExampleInstrumentedTest.java b/examples/tv-casting-app/android/App/app/src/androidTest/java/com/chip/casting/ExampleInstrumentedTest.java new file mode 100644 index 00000000000000..756d0d96a25391 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/androidTest/java/com/chip/casting/ExampleInstrumentedTest.java @@ -0,0 +1,24 @@ +package com.chip.casting; + +import static org.junit.Assert.*; + +import android.content.Context; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.chip.casting", appContext.getPackageName()); + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml b/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000000000..e379d2a7675095 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/ChipTvCastingApplication.java b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/ChipTvCastingApplication.java new file mode 100644 index 00000000000000..4a3873d84618f1 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/ChipTvCastingApplication.java @@ -0,0 +1,10 @@ +package com.chip.casting; + +import android.app.Application; + +public class ChipTvCastingApplication extends Application { + @Override + public void onCreate() { + super.onCreate(); + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/MainActivity.java b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/MainActivity.java new file mode 100644 index 00000000000000..74928ce65079a6 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/MainActivity.java @@ -0,0 +1,18 @@ +package com.chip.casting; + +import android.os.Bundle; +import android.widget.TextView; +import androidx.appcompat.app.AppCompatActivity; + +public class MainActivity extends AppCompatActivity { + + private TextView mHelloCastingTxt; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + mHelloCastingTxt = findViewById(R.id.helloCastingTxt); + mHelloCastingTxt.setText("Hello, TV Casting app!"); + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/examples/tv-casting-app/android/App/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 00000000000000..2b068d11462a4b --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/res/drawable/ic_launcher_background.xml b/examples/tv-casting-app/android/App/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000000000..07d5da9cbf1419 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml b/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000000000..99d71254d7b2e9 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000000000..eca70cfe52eac1 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000000000..eca70cfe52eac1 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000000000..c209e78ecd3723 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000000000..b2dfe3d1ba5cf3 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000000000..4f0f1d64e58ba6 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000000000..62b611da081676 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000000000..948a3070fe34c6 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000000000..1b9a6956b3acdc Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000000000..28d4b77f9f036a Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000000000..9287f5083623b3 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000000000..aa7d6427e6fa10 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000000000..9126ae37cbc358 Binary files /dev/null and b/examples/tv-casting-app/android/App/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/examples/tv-casting-app/android/App/app/src/main/res/values-night/themes.xml b/examples/tv-casting-app/android/App/app/src/main/res/values-night/themes.xml new file mode 100644 index 00000000000000..34c9d80faaf11b --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/res/values/colors.xml b/examples/tv-casting-app/android/App/app/src/main/res/values/colors.xml new file mode 100644 index 00000000000000..f8c6127d327620 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/res/values/strings.xml b/examples/tv-casting-app/android/App/app/src/main/res/values/strings.xml new file mode 100644 index 00000000000000..48a7fd5890bbf5 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + CHIPTVCastingApp + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/main/res/values/themes.xml b/examples/tv-casting-app/android/App/app/src/main/res/values/themes.xml new file mode 100644 index 00000000000000..35a77a16d6c8c8 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/app/src/test/java/com/chip/casting/ExampleUnitTest.java b/examples/tv-casting-app/android/App/app/src/test/java/com/chip/casting/ExampleUnitTest.java new file mode 100644 index 00000000000000..9c9e4486d25319 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/test/java/com/chip/casting/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.chip.casting; + +import static org.junit.Assert.*; + +import org.junit.Test; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} diff --git a/examples/tv-casting-app/android/App/build.gradle b/examples/tv-casting-app/android/App/build.gradle new file mode 100644 index 00000000000000..79c656c2ab4cc1 --- /dev/null +++ b/examples/tv-casting-app/android/App/build.gradle @@ -0,0 +1,25 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:4.2.2' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + mavenCentral() + jcenter() // Warning: this repository is going to shut down soon + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} \ No newline at end of file diff --git a/examples/tv-casting-app/android/App/gradle.properties b/examples/tv-casting-app/android/App/gradle.properties new file mode 100644 index 00000000000000..d47c2f04446cf6 --- /dev/null +++ b/examples/tv-casting-app/android/App/gradle.properties @@ -0,0 +1,26 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true + +# Build SDK from source code and debug in Android Stduio. Must also set matterBuildSrcDir. +matterSdkSourceBuild=false +# Point to the SDK build dir without quotes (out/android-arm64-chip-test for +# example) to build SDK from source code and debug in Android Studio. +# Set to blank to use the SDK prebuilt by scripts/build/build_examples.py. +matterBuildSrcDir=out/android-arm64-chip-tv-casting-app diff --git a/examples/tv-casting-app/android/App/gradle/wrapper/gradle-wrapper.jar b/examples/tv-casting-app/android/App/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000000..7454180f2ae884 Binary files /dev/null and b/examples/tv-casting-app/android/App/gradle/wrapper/gradle-wrapper.jar differ diff --git a/examples/tv-casting-app/android/App/gradle/wrapper/gradle-wrapper.properties b/examples/tv-casting-app/android/App/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000000..2e6e5897b5285c --- /dev/null +++ b/examples/tv-casting-app/android/App/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/examples/tv-casting-app/android/App/gradlew b/examples/tv-casting-app/android/App/gradlew new file mode 100755 index 00000000000000..180cdce0308183 --- /dev/null +++ b/examples/tv-casting-app/android/App/gradlew @@ -0,0 +1,184 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' >/dev/null; then + PRG="$link" + else + PRG=$(dirname "$PRG")"/$link" + fi +done +SAVED="$PWD" +cd "$(dirname "$PRG")" >/dev/null +APP_HOME="$(pwd -P)" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=$(basename "$0") + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn() { + echo "$*" +} + +die() { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$(uname)" in + CYGWIN*) + cygwin=true + ;; + Darwin*) + darwin=true + ;; + MINGW*) + msys=true + ;; + NONSTOP*) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ]; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then + MAX_FD_LIMIT=$(ulimit -H -n) + if [ $? -eq 0 ]; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n "$MAX_FD" + if [ $? -ne 0 ]; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if "$darwin"; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ]; then + APP_HOME=$(cygpath --path --mixed "$APP_HOME") + CLASSPATH=$(cygpath --path --mixed "$CLASSPATH") + + JAVACMD=$(cygpath --unix "$JAVACMD") + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null) + SEP="" + for dir in "$ROOTDIRSRAW"; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ]; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@"; do + CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -) + CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option + + if [ "$CHECK" -ne 0 ] && [ "$CHECK2" -eq 0 ]; then ### Added a condition + eval "$(echo args"$i")=$(cygpath --path --ignore --mixed "$arg")" + else + eval "$(echo args"$i")=\"$arg\"" + fi + i=$(expr "$i" + 1) + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save() { + for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/examples/tv-casting-app/android/App/gradlew.bat b/examples/tv-casting-app/android/App/gradlew.bat new file mode 100644 index 00000000000000..ac1b06f93825db --- /dev/null +++ b/examples/tv-casting-app/android/App/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/examples/tv-casting-app/android/App/settings.gradle b/examples/tv-casting-app/android/App/settings.gradle new file mode 100644 index 00000000000000..ebe1b42e960eed --- /dev/null +++ b/examples/tv-casting-app/android/App/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = "CHIPTVCastingApp" +include ':app' diff --git a/examples/tv-casting-app/android/BUILD.gn b/examples/tv-casting-app/android/BUILD.gn new file mode 100644 index 00000000000000..5cfaccc7577b48 --- /dev/null +++ b/examples/tv-casting-app/android/BUILD.gn @@ -0,0 +1,74 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +import("${build_root}/config/android_abi.gni") +import("${chip_root}/build/chip/java/rules.gni") +import("${chip_root}/build/chip/tools.gni") + +shared_library("jni") { + output_name = "libTvCastingApp" + + sources = [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h" ] + + deps = [ + "${chip_root}/examples/tv-casting-app/tv-casting-common", + "${chip_root}/src/app/server/java:jni", + "${chip_root}/src/lib", + "${chip_root}/third_party/inipp", + ] + + cflags = [ "-Wconversion" ] + + output_dir = "${root_out_dir}/lib/jni/${android_abi}" + + ldflags = [ "-Wl,--gc-sections" ] +} + +android_library("java") { + output_name = "TvCastingApp.jar" + + deps = [ + ":android", + "${chip_root}/third_party/android_deps:annotation", + ] + + data_deps = [ + ":jni", + "${chip_root}/build/chip/java:shared_cpplib", + ] + + sources = [ "java/src/com/chip/casting/TvCastingApp.java" ] + + javac_flags = [ "-Xlint:deprecation" ] + + # TODO: add classpath support (we likely need to add something like + # ..../platforms/android-21/android.jar to access BLE items) +} + +java_prebuilt("android") { + jar_path = "${android_sdk_root}/platforms/android-21/android.jar" +} + +group("default") { + deps = [ + ":android", + ":java", + ":jni", + "${chip_root}/src/app/server/java", + "${chip_root}/src/platform/android:java", + ] +} diff --git a/examples/tv-casting-app/android/args.gni b/examples/tv-casting-app/android/args.gni new file mode 100644 index 00000000000000..802f54f8b49484 --- /dev/null +++ b/examples/tv-casting-app/android/args.gni @@ -0,0 +1,31 @@ +# Copyright (c) 2020-2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] + +chip_build_libshell = true + +chip_enable_additional_data_advertising = true + +chip_enable_rotating_device_id = true diff --git a/examples/tv-casting-app/android/build_overrides b/examples/tv-casting-app/android/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/tv-casting-app/android/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/tv-casting-app/android/java/src/com/chip/casting/TvCastingApp.java b/examples/tv-casting-app/android/java/src/com/chip/casting/TvCastingApp.java new file mode 100644 index 00000000000000..c66868db6cf7e5 --- /dev/null +++ b/examples/tv-casting-app/android/java/src/com/chip/casting/TvCastingApp.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.chip.casting; + +public class TvCastingApp { + public TvCastingApp() {} + + static { + System.loadLibrary("TvCastingApp"); + } +} diff --git a/examples/tv-casting-app/android/third_party/connectedhomeip b/examples/tv-casting-app/android/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/tv-casting-app/android/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index e7d87bd84cfca4..cd0a458716b297 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -299,6 +299,8 @@ def AndroidTargets(): yield target.Extend('androidstudio-x64-chip-tool', board=AndroidBoard.AndroidStudio_X64, app=AndroidApp.CHIP_TOOL) yield target.Extend('arm64-chip-tvserver', board=AndroidBoard.ARM64, app=AndroidApp.CHIP_TVServer) yield target.Extend('arm-chip-tvserver', board=AndroidBoard.ARM, app=AndroidApp.CHIP_TVServer) + yield target.Extend('arm64-chip-tv-casting-app', board=AndroidBoard.ARM64, app=AndroidApp.CHIP_TV_CASTING_APP) + yield target.Extend('arm-chip-tv-casting-app', board=AndroidBoard.ARM, app=AndroidApp.CHIP_TV_CASTING_APP) def MbedTargets(): diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index 8619ebaf9a5eab..2e2dbd29dcc027 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -66,6 +66,7 @@ class AndroidApp(Enum): CHIP_TOOL = auto() CHIP_TEST = auto() CHIP_TVServer = auto() + CHIP_TV_CASTING_APP = auto() def AppName(self): if self == AndroidApp.CHIP_TOOL: @@ -74,6 +75,8 @@ def AppName(self): return "CHIPTest" elif self == AndroidApp.CHIP_TVServer: return "CHIPTVServer" + elif self == AndroidApp.CHIP_TV_CASTING_APP: + return "CHIPTVCastingApp" else: raise Exception('Unknown app type: %r' % self) @@ -81,11 +84,15 @@ def AppGnArgs(self): gn_args = {} if self == AndroidApp.CHIP_TVServer: gn_args['chip_config_network_layer_ble'] = False + elif self == AndroidApp.CHIP_TV_CASTING_APP: + gn_args['chip_config_network_layer_ble'] = False return gn_args def ExampleName(self): if self == AndroidApp.CHIP_TVServer: return "tv-app" + elif self == AndroidApp.CHIP_TV_CASTING_APP: + return "tv-casting-app" else: return None @@ -175,17 +182,27 @@ def copyToExampleAndroid(self): self._Execute(['mkdir', '-p', jnilibs_dir], title='Prepare Native libs ' + self.identifier) - for libName in ['libSetupPayloadParser.so', 'libc++_shared.so', 'libTvApp.so']: + if self.app.ExampleName() == 'tv-casting-app': + libs = ['libc++_shared.so'] + else: + libs = ['libSetupPayloadParser.so', + 'libc++_shared.so', 'libTvApp.so'] + for libName in libs: self._Execute(['cp', os.path.join(self.output_dir, 'lib', 'jni', self.board.AbiName( ), libName), os.path.join(jnilibs_dir, libName)]) - jars = { - 'SetupPayloadParser.jar': 'third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar', - 'AndroidPlatform.jar': 'third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar', - 'CHIPAppServer.jar': 'third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar', - 'TvApp.jar': 'TvApp.jar', - } - + if self.app.ExampleName() == 'tv-casting-app': + jars = { + 'AndroidPlatform.jar': 'third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar', + 'TvCastingApp.jar': 'TvCastingApp.jar', + } + else: + jars = { + 'SetupPayloadParser.jar': 'third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar', + 'AndroidPlatform.jar': 'third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar', + 'CHIPAppServer.jar': 'third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar', + 'TvApp.jar': 'TvApp.jar', + } for jarName in jars.keys(): self._Execute(['cp', os.path.join( self.output_dir, 'lib', jars[jarName]), os.path.join(libs_dir, jarName)]) diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index 49e67f381a020d..7bf22e155ce2d9 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -6,9 +6,11 @@ android-androidstudio-arm64-chip-tool android-androidstudio-x64-chip-tool android-androidstudio-x86-chip-tool android-arm-chip-tool +android-arm-chip-tv-casting-app android-arm-chip-tvserver android-arm64-chip-test android-arm64-chip-tool +android-arm64-chip-tv-casting-app android-arm64-chip-tvserver android-x64-chip-tool android-x86-chip-tool diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 349750e4921865..6f8c58e9606d95 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -76,6 +76,18 @@ python3 build/chip/java/tests/generate_jars_for_test.py # Setting up Android deps through Gradle python3 third_party/android_deps/set_up_android_deps.py +# Generating android-arm-chip-tv-casting-app +gn gen --check --fail-on-unused-args {out}/android-arm-chip-tv-casting-app '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-casting-app/android/ + +# Accepting NDK licenses @ tools +bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' + +# Generating JARs for Java build rules test +python3 build/chip/java/tests/generate_jars_for_test.py + +# Setting up Android deps through Gradle +python3 third_party/android_deps/set_up_android_deps.py + # Generating android-arm-chip-tvserver gn gen --check --fail-on-unused-args {out}/android-arm-chip-tvserver '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-app/android/ @@ -112,6 +124,18 @@ python3 build/chip/java/tests/generate_jars_for_test.py # Setting up Android deps through Gradle python3 third_party/android_deps/set_up_android_deps.py +# Generating android-arm64-chip-tv-casting-app +gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tv-casting-app '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-casting-app/android/ + +# Accepting NDK licenses @ tools +bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' + +# Generating JARs for Java build rules test +python3 build/chip/java/tests/generate_jars_for_test.py + +# Setting up Android deps through Gradle +python3 third_party/android_deps/set_up_android_deps.py + # Generating android-arm64-chip-tvserver gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tvserver '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-app/android/ @@ -668,6 +692,21 @@ cp {out}/android-arm-chip-tool/lib/src/platform/android/AndroidPlatform.jar {roo # Building APP android-arm-chip-tool {root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PmatterBuildSrcDir={out}/android-arm-chip-tool -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-chip-tool assembleDebug +# Building JNI android-arm-chip-tv-casting-app +ninja -C {out}/android-arm-chip-tv-casting-app + +# Prepare Native libs android-arm-chip-tv-casting-app +mkdir -p {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/armeabi-v7a + +cp {out}/android-arm-chip-tv-casting-app/lib/jni/armeabi-v7a/libc++_shared.so {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/armeabi-v7a/libc++_shared.so + +cp {out}/android-arm-chip-tv-casting-app/lib/third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar {root}/examples/tv-casting-app/android/App/app/libs/AndroidPlatform.jar + +cp {out}/android-arm-chip-tv-casting-app/lib/TvCastingApp.jar {root}/examples/tv-casting-app/android/App/app/libs/TvCastingApp.jar + +# Building Example android-arm-chip-tv-casting-app +{root}/examples/tv-casting-app/android/App/gradlew -p {root}/examples/tv-casting-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-chip-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-chip-tv-casting-app assembleDebug + # Building JNI android-arm-chip-tvserver ninja -C {out}/android-arm-chip-tvserver @@ -733,6 +772,21 @@ cp {out}/android-arm64-chip-tool/lib/src/platform/android/AndroidPlatform.jar {r # Building APP android-arm64-chip-tool {root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PmatterBuildSrcDir={out}/android-arm64-chip-tool -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-chip-tool assembleDebug +# Building JNI android-arm64-chip-tv-casting-app +ninja -C {out}/android-arm64-chip-tv-casting-app + +# Prepare Native libs android-arm64-chip-tv-casting-app +mkdir -p {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/arm64-v8a + +cp {out}/android-arm64-chip-tv-casting-app/lib/jni/arm64-v8a/libc++_shared.so {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/arm64-v8a/libc++_shared.so + +cp {out}/android-arm64-chip-tv-casting-app/lib/third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar {root}/examples/tv-casting-app/android/App/app/libs/AndroidPlatform.jar + +cp {out}/android-arm64-chip-tv-casting-app/lib/TvCastingApp.jar {root}/examples/tv-casting-app/android/App/app/libs/TvCastingApp.jar + +# Building Example android-arm64-chip-tv-casting-app +{root}/examples/tv-casting-app/android/App/gradlew -p {root}/examples/tv-casting-app/android/App/ -PmatterBuildSrcDir={out}/android-arm64-chip-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-chip-tv-casting-app assembleDebug + # Building JNI android-arm64-chip-tvserver ninja -C {out}/android-arm64-chip-tvserver diff --git a/scripts/build/testdata/glob_star_targets_except_host.txt b/scripts/build/testdata/glob_star_targets_except_host.txt index e95ba534e53536..7bdd1b1254f221 100644 --- a/scripts/build/testdata/glob_star_targets_except_host.txt +++ b/scripts/build/testdata/glob_star_targets_except_host.txt @@ -6,9 +6,11 @@ android-androidstudio-arm64-chip-tool android-androidstudio-x64-chip-tool android-androidstudio-x86-chip-tool android-arm-chip-tool +android-arm-chip-tv-casting-app android-arm-chip-tvserver android-arm64-chip-test android-arm64-chip-tool +android-arm64-chip-tv-casting-app android-arm64-chip-tvserver android-x64-chip-tool android-x86-chip-tool