You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2023/02/06 16:16:56 UTC

[mynewt-core] 01/02: sys/stats: Add easy full/stub selector

This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit df9cb44975bca785ecb13ef0216781b30012907c
Author: Michal Gorecki <mi...@codecoup.pl>
AuthorDate: Thu Dec 22 10:55:24 2022 +0100

    sys/stats: Add easy full/stub selector
    
    Application could use sys/stats/full or sys/stats/stub.
    Now it's possible to specify in syscfg STATS_IMPLEMENTATION
    to select one of the packages. This way stats variant can be
    easily changed in target with one syscfg value.
---
 sys/stats/pkg.yml    | 31 +++++++++++++++++++++++++++++++
 sys/stats/syscfg.yml | 27 +++++++++++++++++++++++++++
 2 files changed, 58 insertions(+)

diff --git a/sys/stats/pkg.yml b/sys/stats/pkg.yml
new file mode 100644
index 000000000..cf741d404
--- /dev/null
+++ b/sys/stats/pkg.yml
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+pkg.name: sys/stats
+pkg.description: API common to both the full and stub log implementations.
+pkg.author: "Apache Mynewt <de...@mynewt.apache.org>"
+pkg.homepage: "https://mynewt.apache.org/"
+pkg.keywords:
+    - statistics
+
+pkg.deps.'STATS_IMPLEMENTATION=="full"':
+    - sys/stats/full
+
+pkg.deps.'STATS_IMPLEMENTATION=="stub"':
+    - sys/stats/stub
diff --git a/sys/stats/syscfg.yml b/sys/stats/syscfg.yml
new file mode 100644
index 000000000..c45ca9ffe
--- /dev/null
+++ b/sys/stats/syscfg.yml
@@ -0,0 +1,27 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+syscfg.defs:
+    STATS_IMPLEMENTATION:
+        description: >
+            Selects stats implementation package full of stub.
+        value: full
+        choices:
+            - full
+            - stub