relocate/rename PersistentStorage to ExamplePersistentStorage (#23689)
Java matter controller app test needs the example persistent storage, relocate the PersistentStorage from examples/chip-tool to src/controller, and put it nearby ExampleOperationalCredential
diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn
index f7340a3..a4e87b7 100644
--- a/examples/chip-tool/BUILD.gn
+++ b/examples/chip-tool/BUILD.gn
@@ -66,6 +66,8 @@
# TODO - enable CommissionedListCommand once DNS Cache is implemented
# "commands/pairing/CommissionedListCommand.cpp",
# "commands/pairing/CommissionedListCommand.h",
+ "${chip_root}/src/controller/ExamplePersistentStorage.cpp",
+ "${chip_root}/src/controller/ExamplePersistentStorage.h",
"commands/pairing/CloseSessionCommand.cpp",
"commands/pairing/CloseSessionCommand.h",
"commands/pairing/OpenCommissioningWindowCommand.cpp",
@@ -75,7 +77,6 @@
"commands/payload/SetupPayloadParseCommand.cpp",
"commands/payload/SetupPayloadVerhoeff.cpp",
"commands/storage/StorageManagementCommand.cpp",
- "config/PersistentStorage.cpp",
]
deps = []
diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h
index 3a20da0..8c9cd7b 100644
--- a/examples/chip-tool/commands/clusters/ModelCommand.h
+++ b/examples/chip-tool/commands/clusters/ModelCommand.h
@@ -19,7 +19,7 @@
#pragma once
#ifdef CONFIG_USE_LOCAL_STORAGE
-#include "../../config/PersistentStorage.h"
+#include <controller/ExamplePersistentStorage.h>
#endif // CONFIG_USE_LOCAL_STORAGE
#include "../common/CHIPCommand.h"
diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h
index 009cfbd..1b5b369 100644
--- a/examples/chip-tool/commands/common/CHIPCommand.h
+++ b/examples/chip-tool/commands/common/CHIPCommand.h
@@ -19,7 +19,7 @@
#pragma once
#ifdef CONFIG_USE_LOCAL_STORAGE
-#include "../../config/PersistentStorage.h"
+#include <controller/ExamplePersistentStorage.h>
#endif // CONFIG_USE_LOCAL_STORAGE
#include "Command.h"
diff --git a/examples/chip-tool/commands/common/Commands.h b/examples/chip-tool/commands/common/Commands.h
index a39c984..57475b1 100644
--- a/examples/chip-tool/commands/common/Commands.h
+++ b/examples/chip-tool/commands/common/Commands.h
@@ -19,7 +19,7 @@
#pragma once
#ifdef CONFIG_USE_LOCAL_STORAGE
-#include "../../config/PersistentStorage.h"
+#include <controller/ExamplePersistentStorage.h>
#endif // CONFIG_USE_LOCAL_STORAGE
#include "Command.h"
diff --git a/examples/chip-tool/commands/discover/DiscoverCommand.h b/examples/chip-tool/commands/discover/DiscoverCommand.h
index fb0dc6b..dadafc0 100644
--- a/examples/chip-tool/commands/discover/DiscoverCommand.h
+++ b/examples/chip-tool/commands/discover/DiscoverCommand.h
@@ -18,8 +18,8 @@
#pragma once
-#include "../../config/PersistentStorage.h"
#include "../common/CHIPCommand.h"
+#include <controller/ExamplePersistentStorage.h>
class DiscoverCommand : public CHIPCommand
{
diff --git a/examples/chip-tool/commands/pairing/CommissionedListCommand.h b/examples/chip-tool/commands/pairing/CommissionedListCommand.h
index 6d04f93..ca63c55 100644
--- a/examples/chip-tool/commands/pairing/CommissionedListCommand.h
+++ b/examples/chip-tool/commands/pairing/CommissionedListCommand.h
@@ -18,8 +18,8 @@
#pragma once
-#include "../../config/PersistentStorage.h"
#include "../common/Command.h"
+#include <controller/ExamplePersistentStorage.h>
class CommissionedListCommand : public Command
{
diff --git a/examples/chip-tool/commands/storage/StorageManagementCommand.cpp b/examples/chip-tool/commands/storage/StorageManagementCommand.cpp
index 767e11c..b16aac9 100644
--- a/examples/chip-tool/commands/storage/StorageManagementCommand.cpp
+++ b/examples/chip-tool/commands/storage/StorageManagementCommand.cpp
@@ -16,7 +16,7 @@
*
*/
-#include "../../config/PersistentStorage.h"
+#include <controller/ExamplePersistentStorage.h>
#include "StorageManagementCommand.h"
diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn
index 179fa86..37572da 100644
--- a/examples/tv-casting-app/tv-casting-common/BUILD.gn
+++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn
@@ -43,6 +43,8 @@
"${chip_root}/examples/chip-tool/commands/common/Commands.cpp",
"${chip_root}/examples/chip-tool/commands/common/Commands.h",
"${chip_root}/examples/chip-tool/commands/common/CredentialIssuerCommands.h",
+ "${chip_root}/src/controller/ExamplePersistentStorage.cpp",
+ "${chip_root}/src/controller/ExamplePersistentStorage.h",
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp",
"commands/clusters/ModelCommand.cpp",
@@ -80,6 +82,7 @@
deps = [
"${chip_root}/src/app/tests/suites/commands/interaction_model",
+ "${chip_root}/third_party/inipp",
"${chip_root}/third_party/jsoncpp",
]
diff --git a/scripts/tools/check_includes_config.py b/scripts/tools/check_includes_config.py
index 9cc5f51..511c8d8 100644
--- a/scripts/tools/check_includes_config.py
+++ b/scripts/tools/check_includes_config.py
@@ -152,4 +152,6 @@
# Not really for embedded consumers; uses std::queue to keep track
# of a list of discovered things.
'src/controller/SetUpCodePairer.h': {'queue'},
+
+ 'src/controller/ExamplePersistentStorage.cpp': {'fstream'}
}
diff --git a/examples/chip-tool/config/PersistentStorage.cpp b/src/controller/ExamplePersistentStorage.cpp
similarity index 98%
rename from examples/chip-tool/config/PersistentStorage.cpp
rename to src/controller/ExamplePersistentStorage.cpp
index 62cf6ef..e4b8188 100644
--- a/examples/chip-tool/config/PersistentStorage.cpp
+++ b/src/controller/ExamplePersistentStorage.cpp
@@ -15,7 +15,7 @@
* limitations under the License.
*
*/
-#include "PersistentStorage.h"
+#include "ExamplePersistentStorage.h"
#include <lib/core/CHIPEncoding.h>
#include <lib/support/IniEscaping.h>
diff --git a/examples/chip-tool/config/PersistentStorage.h b/src/controller/ExamplePersistentStorage.h
similarity index 100%
rename from examples/chip-tool/config/PersistentStorage.h
rename to src/controller/ExamplePersistentStorage.h
diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn
index 3a2d404..d7c68af 100644
--- a/src/controller/java/BUILD.gn
+++ b/src/controller/java/BUILD.gn
@@ -49,7 +49,12 @@
"zap-generated/CHIPReadCallbacks.cpp",
"zap-generated/CHIPReadCallbacks.h",
]
-
+ if (build_java_matter_controller) {
+ sources += [
+ "${chip_root}/src/controller/ExamplePersistentStorage.cpp",
+ "${chip_root}/src/controller/ExamplePersistentStorage.h",
+ ]
+ }
deps = [
"${chip_root}/src/controller/data_model",
"${chip_root}/src/controller/data_model:java-jni-sources",