Skip to content
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

[Tizen] Platform builds for all-clusters and all-clusters-minimal apps #20480

Merged
merged 3 commits into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/examples-tizen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ jobs:
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform tizen
- name: Build example Tizen lighting app
- name: Build Tizen examples
run: scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target-glob 'tizen-*' build"
26 changes: 26 additions & 0 deletions examples/all-clusters-app/tizen/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2020 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 = {
target_os = "tizen"
import("//args.gni")
}
77 changes: 77 additions & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright (c) 2020 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("//build_overrides/tizen.gni")

import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/app/common_flags.gni")

import("${tizen_sdk_build_root}/tizen_sdk.gni")
assert(chip_build_tools)

source_set("chip-all-clusters-common") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
]

deps = [
"${chip_root}/examples/all-clusters-app/all-clusters-common",
"${chip_root}/src/lib/shell:shell_core",
]

include_dirs =
[ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ]
}

executable("chip-all-clusters-app") {
sources = [
"include/CHIPProjectAppConfig.h",
"src/main.cpp",
]

deps = [
":chip-all-clusters-common",
"${chip_root}/examples/platform/tizen:app-main",
"${chip_root}/src/lib",
]

include_dirs = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/zzz_generated/all-clusters-app",
"include",
]

output_dir = root_out_dir
}

tizen_sdk_package("chip-all-clusters-app:tpk") {
deps = [ ":chip-all-clusters-app" ]
manifest = rebase_path("tizen-manifest.xml")
sign_security_profile = "CHIP"
}

group("tizen") {
deps = [ ":chip-all-clusters-app" ]
}

group("tizen:tpk") {
deps = [ ":chip-all-clusters-app:tpk" ]
}

group("default") {
deps = [ ":tizen" ]
}
25 changes: 25 additions & 0 deletions examples/all-clusters-app/tizen/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2020 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 = "<CHIPProjectAppConfig.h>"
chip_project_config_include = "<CHIPProjectAppConfig.h>"
chip_system_project_config_include = "<SystemProjectConfig.h>"

chip_project_config_include_dirs =
[ "${chip_root}/examples/all-clusters-app/tizen/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
1 change: 1 addition & 0 deletions examples/all-clusters-app/tizen/build_overrides
31 changes: 31 additions & 0 deletions examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
*
* Copyright (c) 2020 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.
*/

/**
* @file
* Example project configuration file for CHIP.
*
* This is a place to put application or project-specific overrides
* to the default configuration values for general CHIP features.
*
*/

#pragma once

// include the CHIPProjectConfig from config/standalone
#include <CHIPProjectConfig.h>
52 changes: 52 additions & 0 deletions examples/all-clusters-app/tizen/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
*
* Copyright (c) 2020 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.
*/

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/util/af.h>

#include <TizenServiceAppMain.h>
#include <binding-handler.h>

using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;

// Network commissioning
namespace {
constexpr EndpointId kNetworkCommissioningEndpointMain = 0;
constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;
} // namespace

void ApplicationInit()
{
// Enable secondary endpoint only when we need it.
emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false);
}

int main(int argc, char * argv[])
{
TizenServiceAppMain app;
VerifyOrDie(app.Init(argc, argv) == 0);

VerifyOrDie(InitBindingHandlers() == CHIP_NO_ERROR);

return app.RunMainLoop();
}
17 changes: 17 additions & 0 deletions examples/all-clusters-app/tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="6.0" package="org.tizen.matter.example.allclusters" version="1.0.0">
<profile name="mobile" />
<service-application appid="org.tizen.matter.example.allclusters" exec="chip-all-clusters-app" type="capp" multiple="false" taskmanage="false" nodisplay="true">
<label>Matter All Clusters Example</label>
</service-application>
<privileges>
<privilege>http://tizen.org/privilege/bluetooth</privilege>
<privilege>http://tizen.org/privilege/internet</privilege>
<privilege>http://tizen.org/privilege/network.get</privilege>
</privileges>
<feature name="http://tizen.org/feature/network.bluetooth">true</feature>
<feature name="http://tizen.org/feature/network.bluetooth.le">true</feature>
<feature name="http://tizen.org/feature/network.bluetooth.le.gatt.server">true</feature>
<feature name="http://tizen.org/feature/network.service_discovery.dnssd">true</feature>
<feature name="http://tizen.org/feature/network.wifi">true</feature>
</manifest>
26 changes: 26 additions & 0 deletions examples/all-clusters-minimal-app/tizen/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2020 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 = {
target_os = "tizen"
import("//args.gni")
}
77 changes: 77 additions & 0 deletions examples/all-clusters-minimal-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright (c) 2020 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("//build_overrides/tizen.gni")

import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/app/common_flags.gni")

import("${tizen_sdk_build_root}/tizen_sdk.gni")
assert(chip_build_tools)

source_set("chip-all-clusters-common") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
]

deps = [
"${chip_root}/examples/all-clusters-minimal-app/all-clusters-common",
"${chip_root}/src/lib/shell:shell_core",
]

include_dirs =
[ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ]
}

executable("chip-all-clusters-minimal-app") {
sources = [
"include/CHIPProjectAppConfig.h",
"src/main.cpp",
]

deps = [
":chip-all-clusters-common",
"${chip_root}/examples/platform/tizen:app-main",
"${chip_root}/src/lib",
]

include_dirs = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/zzz_generated/all-clusters-minimal-app",
"include",
]

output_dir = root_out_dir
}

tizen_sdk_package("chip-all-clusters-minimal-app:tpk") {
deps = [ ":chip-all-clusters-minimal-app" ]
manifest = rebase_path("tizen-manifest.xml")
sign_security_profile = "CHIP"
}

group("tizen") {
deps = [ ":chip-all-clusters-minimal-app" ]
}

group("tizen:tpk") {
deps = [ ":chip-all-clusters-minimal-app:tpk" ]
}

group("default") {
deps = [ ":tizen" ]
}
25 changes: 25 additions & 0 deletions examples/all-clusters-minimal-app/tizen/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2020 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 = "<CHIPProjectAppConfig.h>"
chip_project_config_include = "<CHIPProjectAppConfig.h>"
chip_system_project_config_include = "<SystemProjectConfig.h>"

chip_project_config_include_dirs =
[ "${chip_root}/examples/all-clusters-minimal-app/tizen/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
1 change: 1 addition & 0 deletions examples/all-clusters-minimal-app/tizen/build_overrides
Loading