Skip to content

Commit

Permalink
Move controller data to zzz_generated (#9280)
Browse files Browse the repository at this point in the history
* Move src_controller/data_model generated files to zzz_generated

* Another chipclusters update for lighting app. This seems unstable somehow

* more lighting updates ... again

* Ran another regen

* Rename again, to make relative paths clearer

* Rename back for consistency, make build paths work (in theory)

* Propagate the controller config for includes - controller includes require the zzz_generated includes

* Restyle fixes

* update regen script and regen all

* Regen all ... again

* update include paths for darwin build (relative zap generated include is still odd in util)
  • Loading branch information
andy31415 authored and pull[bot] committed Sep 9, 2021
1 parent 7d6b5d4 commit 2434956
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 16 deletions.
10 changes: 6 additions & 4 deletions scripts/tools/zap_regen_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ def getGlobalTemplatesTargets():

targets.append([str(filepath), '-o', output_dir])

targets.extend([[str(filepath)]
for filepath in Path('./src/darwin').rglob('*.zap')])
targets.extend([[str(filepath)] for filepath in Path(
'./src/controller/data_model').rglob('*.zap')])
targets.extend([
[
'./src/controller/data_model/controller-clusters.zap',
'-o',
os.path.join('zzz_generated/controller-clusters/zap-generated')]])

return targets


Expand Down
9 changes: 9 additions & 0 deletions src/controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

import("//build_overrides/chip.gni")

config("config") {
# TODO: this should be a dependency on src/controller/data_model however this is circular:
# zzz_generated/controller-clusters depend on src/controller
# src/controller neeeds zzz_generated/controller-cluster for includes
include_dirs = [ "${chip_root}/zzz_generated/" ]
}

static_library("controller") {
output_name = "libChipController"

Expand Down Expand Up @@ -48,5 +55,7 @@ static_library("controller") {
"${chip_root}/src/transport",
]

public_configs = [ ":config" ]

defines = []
}
2 changes: 1 addition & 1 deletion src/controller/CHIPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <controller/CHIPDevice.h>

#include <controller/data_model/zap-generated/CHIPClusters.h>
#include <controller-clusters/zap-generated/CHIPClusters.h>

#if CONFIG_DEVICE_LAYER
#include <platform/CHIPDeviceLayer.h>
Expand Down
2 changes: 1 addition & 1 deletion src/controller/CHIPDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <app/InteractionModelEngine.h>
#include <app/util/CHIPDeviceCallbacksMgr.h>
#include <app/util/basic-types.h>
#include <controller/data_model/zap-generated/CHIPClientCallbacks.h>
#include <controller-clusters/zap-generated/CHIPClientCallbacks.h>
#include <core/CHIPCallback.h>
#include <core/CHIPCore.h>
#include <credentials/CHIPOperationalCredentials.h>
Expand Down
2 changes: 1 addition & 1 deletion src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <controller/CHIPDeviceController.h>

#include <app-common/zap-generated/enums.h>
#include <controller/data_model/zap-generated/CHIPClusters.h>
#include <controller-clusters/zap-generated/CHIPClusters.h>

#if CONFIG_DEVICE_LAYER
#include <platform/CHIPDeviceLayer.h>
Expand Down
2 changes: 1 addition & 1 deletion src/controller/CHIPDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
#pragma once

#include <app/InteractionModelDelegate.h>
#include <controller-clusters/zap-generated/CHIPClientCallbacks.h>
#include <controller/AbstractMdnsDiscoveryController.h>
#include <controller/CHIPDevice.h>
#include <controller/OperationalCredentialsDelegate.h>
#include <controller/data_model/zap-generated/CHIPClientCallbacks.h>
#include <core/CHIPCore.h>
#include <core/CHIPPersistentStorageDelegate.h>
#include <core/CHIPTLV.h>
Expand Down
3 changes: 2 additions & 1 deletion src/controller/data_model/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import("${chip_root}/src/app/chip_data_model.gni")
chip_data_model("data_model") {
zap_file = "controller-clusters.zap"

zap_pregenerated_dir = "zap-generated"
zap_pregenerated_dir =
"${chip_root}/zzz_generated/controller-clusters/zap-generated"

use_default_client_callbacks = true
allow_circular_includes_from = [ "${chip_root}/src/controller" ]
Expand Down
16 changes: 9 additions & 7 deletions src/darwin/Framework/CHIP.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
1E857305265519720050A4D9 /* CHIPClientCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CHIPClientCallbacks.cpp; path = "../../../controller/data_model/zap-generated/CHIPClientCallbacks.cpp"; sourceTree = "<group>"; };
1E857307265519AE0050A4D9 /* callback-stub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "callback-stub.cpp"; path = "../../../controller/data_model/zap-generated/callback-stub.cpp"; sourceTree = "<group>"; };
1E857309265519AE0050A4D9 /* CHIPClusters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CHIPClusters.cpp; path = "../../../controller/data_model/zap-generated/CHIPClusters.cpp"; sourceTree = "<group>"; };
1E85730A265519AE0050A4D9 /* attribute-size.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-size.cpp"; path = "../../../controller/data_model/zap-generated/attribute-size.cpp"; sourceTree = "<group>"; };
1E85730B265519AE0050A4D9 /* IMClusterCommandHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IMClusterCommandHandler.cpp; path = "../../../controller/data_model/zap-generated/IMClusterCommandHandler.cpp"; sourceTree = "<group>"; };
1E857305265519720050A4D9 /* CHIPClientCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CHIPClientCallbacks.cpp; path = "../../../../zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp"; sourceTree = "<group>"; };
1E857307265519AE0050A4D9 /* callback-stub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "callback-stub.cpp"; path = "../../../../zzz_generated/controller-clusters/zap-generated/callback-stub.cpp"; sourceTree = "<group>"; };
1E857309265519AE0050A4D9 /* CHIPClusters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CHIPClusters.cpp; path = "../../../../zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp"; sourceTree = "<group>"; };
1E85730A265519AE0050A4D9 /* attribute-size.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-size.cpp"; path = "../../../../zzz_generated/controller-clusters/zap-generated/attribute-size.cpp"; sourceTree = "<group>"; };
1E85730B265519AE0050A4D9 /* IMClusterCommandHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IMClusterCommandHandler.cpp; path = "../../../../zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp"; sourceTree = "<group>"; };
1E85731226551A490050A4D9 /* binding-table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "binding-table.cpp"; path = "../../../app/util/binding-table.cpp"; sourceTree = "<group>"; };
1E85731326551A490050A4D9 /* process-global-message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "process-global-message.cpp"; path = "../../../app/util/process-global-message.cpp"; sourceTree = "<group>"; };
1E85731426551A490050A4D9 /* attribute-list-byte-span.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-list-byte-span.cpp"; path = "../../../app/util/attribute-list-byte-span.cpp"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -625,8 +625,9 @@
"$(CHIP_ROOT)/src/app/util",
"$(CHIP_ROOT)/third_party/nlio/repo/include",
"$(TEMP_DIR)/out/gen/include",
"$(CHIP_ROOT)/src/controller/data_model",
"$(CHIP_ROOT)/zzz_generated/",
"$(CHIP_ROOT)/zzz_generated/app-common",
"$(CHIP_ROOT)/zzz_generated/controller-clusters",
);
INFOPLIST_FILE = CHIP/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -768,8 +769,9 @@
"$(CHIP_ROOT)/src/app/util",
"$(CHIP_ROOT)/third_party/nlio/repo/include",
"$(TEMP_DIR)/out/gen/include",
"$(CHIP_ROOT)/src/controller/data_model",
"$(CHIP_ROOT)/zzz_generated/",
"$(CHIP_ROOT)/zzz_generated/app-common",
"$(CHIP_ROOT)/zzz_generated/controller-clusters",
);
INFOPLIST_FILE = CHIP/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down

0 comments on commit 2434956

Please sign in to comment.