# 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" ]

  # add simplified casting API files here
  sources += [
    "App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp",
    "App/app/src/main/jni/cpp/core/CastingApp-JNI.h",
    "App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp",
    "App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.h",
    "App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp",
    "App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.h",
    "App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp",
    "App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.h",
    "App/app/src/main/jni/cpp/support/Converters-JNI.cpp",
    "App/app/src/main/jni/cpp/support/Converters-JNI.h",
    "App/app/src/main/jni/cpp/support/JNIDACProvider.cpp",
    "App/app/src/main/jni/cpp/support/JNIDACProvider.h",
    "App/app/src/main/jni/cpp/support/MatterCallback-JNI.h",
    "App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.cpp",
    "App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.h",
  ]

  deps = [
    "${chip_root}/examples/tv-casting-app/tv-casting-common",
    "${chip_root}/src/app/data-model:heap",
    "${chip_root}/src/app/server/java:jni",
    "${chip_root}/src/controller/java:android_chip_im_jni",
    "${chip_root}/src/lib",
    "${chip_root}/src/platform/logging:default",
    "${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}/src/app/server/java",
    "${chip_root}/src/controller/java:android_chip_im",
    "${chip_root}/src/platform/android:java",
    "${chip_root}/third_party/android_deps:annotation",
  ]

  data_deps = [
    ":jni",
    "${chip_root}/build/chip/java:shared_cpplib",
  ]

  sources = [
    "App/app/src/compat/jni/com/chip/casting/AppParameters.java",
    "App/app/src/compat/jni/com/chip/casting/CommissioningCallbacks.java",
    "App/app/src/compat/jni/com/chip/casting/ContentApp.java",
    "App/app/src/compat/jni/com/chip/casting/ContentLauncherTypes.java",
    "App/app/src/compat/jni/com/chip/casting/DACProvider.java",
    "App/app/src/compat/jni/com/chip/casting/DiscoveredNodeData.java",
    "App/app/src/compat/jni/com/chip/casting/FailureCallback.java",
    "App/app/src/compat/jni/com/chip/casting/MatterCallbackHandler.java",
    "App/app/src/compat/jni/com/chip/casting/MatterError.java",
    "App/app/src/compat/jni/com/chip/casting/MediaPlaybackTypes.java",
    "App/app/src/compat/jni/com/chip/casting/SubscriptionEstablishedCallback.java",
    "App/app/src/compat/jni/com/chip/casting/SuccessCallback.java",
    "App/app/src/compat/jni/com/chip/casting/TargetNavigatorTypes.java",
    "App/app/src/compat/jni/com/chip/casting/TvCastingApp.java",
    "App/app/src/compat/jni/com/chip/casting/VideoPlayer.java",
  ]

  # add simplified casting API files here
  sources += [
    "App/app/src/main/jni/com/matter/casting/core/CastingApp.java",
    "App/app/src/main/jni/com/matter/casting/core/CastingAppState.java",
    "App/app/src/main/jni/com/matter/casting/core/CastingPlayer.java",
    "App/app/src/main/jni/com/matter/casting/core/CastingPlayerDiscovery.java",
    "App/app/src/main/jni/com/matter/casting/core/Endpoint.java",
    "App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayer.java",
    "App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayerDiscovery.java",
    "App/app/src/main/jni/com/matter/casting/support/AppParameters.java",
    "App/app/src/main/jni/com/matter/casting/support/CommissionableData.java",
    "App/app/src/main/jni/com/matter/casting/support/CommissionerDeclaration.java",
    "App/app/src/main/jni/com/matter/casting/support/ConnectionCallbacks.java",
    "App/app/src/main/jni/com/matter/casting/support/DACProvider.java",
    "App/app/src/main/jni/com/matter/casting/support/DataProvider.java",
    "App/app/src/main/jni/com/matter/casting/support/DeviceTypeStruct.java",
    "App/app/src/main/jni/com/matter/casting/support/EndpointFilter.java",
    "App/app/src/main/jni/com/matter/casting/support/IdentificationDeclarationOptions.java",
    "App/app/src/main/jni/com/matter/casting/support/MatterCallback.java",
    "App/app/src/main/jni/com/matter/casting/support/MatterError.java",
    "App/app/src/main/jni/com/matter/casting/support/TargetAppInfo.java",
  ]

  javac_flags = [ "-Xlint:deprecation" ]

  # TODO: add classpath support (we likely need to add something like
  #  ..../platforms/android-26/android.jar to access BLE items)
}

java_prebuilt("android") {
  jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
}

group("default") {
  deps = [
    ":android",
    ":java",
    ":jni",
    "${chip_root}/src/app/server/java",
    "${chip_root}/src/controller/java:android_chip_im",
    "${chip_root}/src/platform/android:java",
  ]
}
