summaryrefslogtreecommitdiff
path: root/doc/number-guessing-bot/etc
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2024-07-31 18:01:41 +0200
committerAlberto Sartori <alberto.sartori@huawei.com>2024-07-31 18:12:32 +0200
commitc248c33ac05a44c97c1cee413f13d65bf9c0327d (patch)
treea941c423ccf0edbaa6fd99390d02a469aab54edf /doc/number-guessing-bot/etc
parent71962cee77f28f16611be17a518ffc9e6bbe7860 (diff)
downloadrules-rust-c248c33ac05a44c97c1cee413f13d65bf9c0327d.tar.gz
rules-rust: add tutorials to transition and import Cargo-based projects
Diffstat (limited to 'doc/number-guessing-bot/etc')
-rwxr-xr-xdoc/number-guessing-bot/etc/gen-repos.sh23
-rw-r--r--doc/number-guessing-bot/etc/repos.template.json8
2 files changed, 31 insertions, 0 deletions
diff --git a/doc/number-guessing-bot/etc/gen-repos.sh b/doc/number-guessing-bot/etc/gen-repos.sh
new file mode 100755
index 0000000..6779f35
--- /dev/null
+++ b/doc/number-guessing-bot/etc/gen-repos.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Copyright 2024 Huawei Cloud Computing Technology Co., Ltd.
+#
+# 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.
+
+set -euo pipefail
+
+readonly ROOT=$(readlink -f $(dirname $0)/..)
+
+just-import-git -C ${ROOT}/etc/repos.template.json \
+ --as rules-cc -b master https://github.com/just-buildsystem/rules-cc rules \
+ | \
+ just-import-cargo --to-git --repo-root ${ROOT} ${ROOT}/../number-guessing > ${ROOT}/etc/repos.json
diff --git a/doc/number-guessing-bot/etc/repos.template.json b/doc/number-guessing-bot/etc/repos.template.json
new file mode 100644
index 0000000..017a992
--- /dev/null
+++ b/doc/number-guessing-bot/etc/repos.template.json
@@ -0,0 +1,8 @@
+{ "main": "bot"
+, "repositories":
+ { "bot":
+ { "repository": {"type": "file", "path": "."}
+ , "bindings": {"rules-cc": "rules-cc", "guessing_game": "guessing_game"}
+ }
+ }
+}