# Copyright (c) 2020-2023 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("${chip_root}/build/chip/java/config.gni")
import("${chip_root}/build/chip/java/rules.gni")
import("${chip_root}/build/chip/tests.gni")

if (!matter_enable_java_compilation) {
  import("${build_root}/config/android_abi.gni")
}

shared_library("jni") {
  output_name = "libCHIPController"

  if (current_os == "mac") {
    output_extension = "dylib"
  }

  # Temporary while we have circular dependencies between codegen.py and zap
  # generated files
  check_includes = false

  sources = [
    "AndroidCallbacks-JNI.cpp",
    "AndroidCallbacks.cpp",
    "AndroidCallbacks.h",
    "AndroidClusterExceptions.cpp",
    "AndroidClusterExceptions.h",
    "AndroidCommissioningWindowOpener.cpp",
    "AndroidCommissioningWindowOpener.h",
    "AndroidControllerExceptions.cpp",
    "AndroidControllerExceptions.h",
    "AndroidCurrentFabricRemover.cpp",
    "AndroidCurrentFabricRemover.h",
    "AndroidDeviceControllerWrapper.cpp",
    "AndroidDeviceControllerWrapper.h",
    "AndroidOperationalCredentialsIssuer.cpp",
    "AndroidOperationalCredentialsIssuer.h",
    "AttestationTrustStoreBridge.cpp",
    "AttestationTrustStoreBridge.h",
    "BaseCHIPCluster-JNI.cpp",
    "CHIPAttributeTLVValueDecoder.h",
    "CHIPDefaultCallbacks.cpp",
    "CHIPDefaultCallbacks.h",
    "CHIPDeviceController-JNI.cpp",
    "DeviceAttestationDelegateBridge.cpp",
    "DeviceAttestationDelegateBridge.h",
    "zap-generated/CHIPAttributeTLVValueDecoder.cpp",
    "zap-generated/CHIPClustersWrite-JNI.cpp",
    "zap-generated/CHIPEventTLVValueDecoder.cpp",
    "zap-generated/CHIPInvokeCallbacks.cpp",
    "zap-generated/CHIPInvokeCallbacks.h",
    "zap-generated/CHIPReadCallbacks.cpp",
  ]

  deps = [
    "${chip_root}/src/controller/data_model",
    "${chip_root}/src/controller/data_model:java-jni-sources",
    "${chip_root}/src/credentials:default_attestation_verifier",
    "${chip_root}/src/inet",
    "${chip_root}/src/lib",
    "${chip_root}/src/lib/support/jsontlv",
    "${chip_root}/src/platform",
  ]

  if (matter_enable_java_compilation) {
    defines = [ "JAVA_MATTER_CONTROLLER_TEST" ]

    sources += [
      "${chip_root}/src/controller/ExamplePersistentStorage.cpp",
      "${chip_root}/src/controller/ExamplePersistentStorage.h",
    ]

    include_dirs = java_matter_controller_dependent_paths
    deps += [ "${chip_root}/third_party/inipp" ]

    if (current_os == "mac") {
      deps += [ "${chip_root}/src/platform/Darwin" ]
    } else {
      deps += [ "${chip_root}/src/platform/Linux" ]
    }

    cflags = [ "-Wno-unknown-pragmas" ]

    output_dir = "${root_out_dir}/lib/jni"
  } else {
    deps += [ "${chip_root}/src/platform/android" ]

    output_dir = "${root_out_dir}/lib/jni/${android_abi}"
  }

  if (current_os == "mac") {
    ldflags = [ "-Wl,-dead_strip" ]
  } else {
    ldflags = [ "-Wl,--gc-sections" ]
  }

  public_configs = [ "${chip_root}/src:includes" ]
}

if (chip_link_tests) {
  shared_library("jni_for_test") {
    sources = [ "AndroidCallbacks-ForTestJNI.cpp" ]
    output_name = "libCHIPForTestController"

    public_configs = [ "${chip_root}/src:includes" ]

    deps = [
      ":jni",
      "${chip_root}/src/messaging/tests:helpers",
    ]

    if (matter_enable_java_compilation) {
      defines = [ "JAVA_MATTER_CONTROLLER_TEST" ]
      include_dirs = java_matter_controller_dependent_paths
      if (current_os == "mac") {
        deps += [ "${chip_root}/src/platform/Darwin" ]
      } else {
        deps += [ "${chip_root}/src/platform/Linux" ]
      }

      cflags = [ "-Wno-unknown-pragmas" ]

      output_dir = "${root_out_dir}/lib/jni"
    } else {
      deps += [ "${chip_root}/src/platform/android" ]

      output_dir = "${root_out_dir}/lib/jni/${android_abi}"
    }

    ldflags = [ "-Wl,--gc-sections" ]
  }
}

kotlin_library("tlv") {
  output_name = "libCHIPTlv.jar"

  sources = [
    "src/chip/tlv/Element.kt",
    "src/chip/tlv/TlvReader.kt",
    "src/chip/tlv/TlvWriter.kt",
    "src/chip/tlv/tags.kt",
    "src/chip/tlv/types.kt",
    "src/chip/tlv/utils.kt",
    "src/chip/tlv/values.kt",
  ]

  kotlinc_flags = [ "-Xlint:deprecation" ]
}

kotlin_library("tlv_reader_test") {
  output_name = "TlvReaderTest.jar"

  deps = [
    ":tlv",
    "${chip_root}/third_party/java_deps:junit-4",
    "${chip_root}/third_party/java_deps:truth",
  ]

  sources = [ "tests/chip/tlv/TlvReaderTest.kt" ]

  kotlinc_flags = [ "-Xlint:deprecation" ]
}

kotlin_library("tlv_writer_test") {
  output_name = "TlvWriterTest.jar"

  deps = [
    ":tlv",
    "${chip_root}/third_party/java_deps:junit-4",
    "${chip_root}/third_party/java_deps:truth",
  ]

  sources = [ "tests/chip/tlv/TlvWriterTest.kt" ]

  kotlinc_flags = [ "-Xlint:deprecation" ]
}

kotlin_library("tlv_read_write_test") {
  output_name = "TlvReadWriteTest.jar"

  deps = [
    ":tlv",
    "${chip_root}/third_party/java_deps:junit-4",
    "${chip_root}/third_party/java_deps:kotlin-test",
    "${chip_root}/third_party/java_deps:truth",
  ]

  sources = [ "tests/chip/tlv/TlvReadWriteTest.kt" ]

  kotlinc_flags = [ "-Xlint:deprecation" ]
}

kotlin_library("jsontlv") {
  output_name = "libCHIPJson.jar"

  deps = [
    ":tlv",
    "${chip_root}/third_party/java_deps:gson",
    "${chip_root}/third_party/java_deps:protobuf-java",
  ]

  sources = [
    "src/chip/jsontlv/JsonToTlv.kt",
    "src/chip/jsontlv/TlvToJson.kt",
    "src/chip/jsontlv/types.kt",
  ]

  kotlinc_flags = [ "-Xlint:deprecation" ]
}

kotlin_library("json_to_tlv_to_json_test") {
  output_name = "JsonToTlvToJsonTest.jar"

  deps = [
    ":jsontlv",
    "${chip_root}/third_party/java_deps:gson",
    "${chip_root}/third_party/java_deps:junit-4",
    "${chip_root}/third_party/java_deps:kotlin-test",
    "${chip_root}/third_party/java_deps:truth",
  ]

  sources = [ "tests/chip/jsontlv/JsonToTlvToJsonTest.kt" ]

  kotlinc_flags = [ "-Xlint:deprecation" ]
}

kotlin_library("onboarding_payload") {
  output_name = "OnboardingPayload.jar"

  deps = [ ":tlv" ]

  sources = [
    "src/chip/onboardingpayload/Base38.kt",
    "src/chip/onboardingpayload/CommissioningFlow.kt",
    "src/chip/onboardingpayload/DiscoveryCapability.kt",
    "src/chip/onboardingpayload/ManualOnboardingPayloadGenerator.kt",
    "src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt",
    "src/chip/onboardingpayload/OnboardingPayload.kt",
    "src/chip/onboardingpayload/OnboardingPayloadParser.kt",
    "src/chip/onboardingpayload/OptionalQRCodeInfo.kt",
    "src/chip/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt",
    "src/chip/onboardingpayload/QRCodeOnboardingPayloadGenerator.kt",
    "src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt",
    "src/chip/onboardingpayload/VendorId.kt",
    "src/chip/onboardingpayload/Verhoeff.kt",
    "src/chip/onboardingpayload/Verhoeff10.kt",
  ]
}

kotlin_library("onboardingpayload_manual_code_test") {
  output_name = "OnboardingPayloadManualCodeTest.jar"

  deps = [
    ":onboarding_payload",
    "${chip_root}/third_party/java_deps:junit-4",
    "${chip_root}/third_party/java_deps:truth",
  ]

  sources = [ "tests/chip/onboardingpayload/ManualCodeTest.kt" ]

  kotlinc_flags = [ "-Xlint:deprecation" ]
}

group("unit_tests") {
  deps = [
    ":json_to_tlv_to_json_test",
    ":onboardingpayload_manual_code_test",
    ":tlv_read_write_test",
    ":tlv_reader_test",
    ":tlv_writer_test",
  ]
}

android_library("java") {
  output_name = "CHIPController.jar"

  deps = [
    ":tlv",
    "${chip_root}/third_party/java_deps:annotation",
  ]

  data_deps = [ ":jni" ]

  sources = [
    "generated/java/chip/devicecontroller/ClusterIDMapping.java",
    "generated/java/chip/devicecontroller/ClusterReadMapping.java",
    "generated/java/chip/devicecontroller/ClusterWriteMapping.java",
    "src/chip/clusterinfo/ClusterCommandCallback.java",
    "src/chip/clusterinfo/ClusterInfo.java",
    "src/chip/clusterinfo/CommandParameterInfo.java",
    "src/chip/clusterinfo/CommandResponseInfo.java",
    "src/chip/clusterinfo/DelegatedClusterCallback.java",
    "src/chip/clusterinfo/InteractionInfo.java",
    "src/chip/devicecontroller/AttestationInfo.java",
    "src/chip/devicecontroller/AttestationTrustStoreDelegate.java",
    "src/chip/devicecontroller/CSRInfo.java",
    "src/chip/devicecontroller/ChipClusterException.java",
    "src/chip/devicecontroller/ChipCommandType.java",
    "src/chip/devicecontroller/ChipDeviceController.java",
    "src/chip/devicecontroller/ChipDeviceControllerException.java",
    "src/chip/devicecontroller/ControllerParams.java",
    "src/chip/devicecontroller/DeviceAttestationDelegate.java",
    "src/chip/devicecontroller/DiscoveredDevice.java",
    "src/chip/devicecontroller/GetConnectedDeviceCallbackJni.java",
    "src/chip/devicecontroller/InvokeCallback.java",
    "src/chip/devicecontroller/InvokeCallbackJni.java",
    "src/chip/devicecontroller/KeypairDelegate.java",
    "src/chip/devicecontroller/NetworkCredentials.java",
    "src/chip/devicecontroller/NetworkLocation.java",
    "src/chip/devicecontroller/OpenCommissioningCallback.java",
    "src/chip/devicecontroller/OperationalKeyConfig.java",
    "src/chip/devicecontroller/PaseVerifierParams.java",
    "src/chip/devicecontroller/ReportCallback.java",
    "src/chip/devicecontroller/ReportCallbackJni.java",
    "src/chip/devicecontroller/ReportEventCallback.java",
    "src/chip/devicecontroller/ReportEventCallbackJni.java",
    "src/chip/devicecontroller/ResubscriptionAttemptCallback.java",
    "src/chip/devicecontroller/SubscriptionEstablishedCallback.java",
    "src/chip/devicecontroller/UnpairDeviceCallback.java",
    "src/chip/devicecontroller/WriteAttributesCallback.java",
    "src/chip/devicecontroller/WriteAttributesCallbackJni.java",
    "src/chip/devicecontroller/model/AttributeState.java",
    "src/chip/devicecontroller/model/AttributeWriteRequest.java",
    "src/chip/devicecontroller/model/ChipAttributePath.java",
    "src/chip/devicecontroller/model/ChipEventPath.java",
    "src/chip/devicecontroller/model/ChipPathId.java",
    "src/chip/devicecontroller/model/ClusterState.java",
    "src/chip/devicecontroller/model/EndpointState.java",
    "src/chip/devicecontroller/model/EventState.java",
    "src/chip/devicecontroller/model/InvokeElement.java",
    "src/chip/devicecontroller/model/NodeState.java",
    "zap-generated/chip/devicecontroller/ChipClusters.java",
    "zap-generated/chip/devicecontroller/ChipEventStructs.java",
    "zap-generated/chip/devicecontroller/ChipIdLookup.java",
    "zap-generated/chip/devicecontroller/ChipStructs.java",
    "zap-generated/chip/devicecontroller/ClusterInfoMapping.java",
  ]

  if (matter_enable_java_compilation) {
    deps += [
      "${chip_root}/third_party/java_deps:json",
      "${chip_root}/third_party/java_deps/stub_src",
    ]
  } else {
    deps += [ ":android" ]

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

  javac_flags = [
    "-Xlint:deprecation",
    "-parameters",  # Store infomation about method parameters
  ]

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

if (chip_link_tests) {
  android_library("java_for_test") {
    output_name = "CHIPControllerForTest.jar"

    deps = [ "${chip_root}/third_party/java_deps:annotation" ]

    data_deps = [
      ":jni",
      ":jni_for_test",
    ]

    sources = [
      "src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java",
    ]

    if (matter_enable_java_compilation) {
      deps += [
        "${chip_root}/third_party/java_deps:json",
        "${chip_root}/third_party/java_deps/stub_src",
      ]
    } else {
      deps += [ ":android" ]

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

    javac_flags = [ "-Xlint:deprecation" ]

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

  android_library("tests") {
    output_name = "CHIPControllerTests.jar"

    deps = [
      ":java_for_test",
      "${chip_root}/src/messaging/tests/java",
      "${chip_root}/third_party/java_deps:annotation",
    ]

    data_deps = [
      ":jni",
      ":jni_for_test",
      "${chip_root}/src/messaging/tests/java:jni",
    ]

    sources =
        [ "tests/chip/devicecontroller/GetConnectedDeviceCallbackJniTest.java" ]

    if (matter_enable_java_compilation) {
      deps += [
        "${chip_root}/third_party/java_deps:json",
        "${chip_root}/third_party/java_deps/stub_src",
      ]
    } else {
      deps += [ ":android" ]

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

    javac_flags = [ "-Xlint:deprecation" ]

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

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