2020-03-27 03:26:10 +03:00
|
|
|
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2019-05-03 11:17:15 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2020-04-17 19:42:24 +03:00
|
|
|
exports_files(glob(["create-daml-app-test-resources/*"]))
|
2020-04-11 22:53:44 +03:00
|
|
|
|
2019-05-03 11:17:15 +03:00
|
|
|
genrule(
|
|
|
|
name = "templates-tarball",
|
|
|
|
srcs = glob([
|
2019-07-16 16:59:08 +03:00
|
|
|
"default-gitignore",
|
2019-09-11 22:09:53 +03:00
|
|
|
"default-dlint-yaml",
|
2019-05-03 11:17:15 +03:00
|
|
|
"skeleton/**",
|
2020-04-02 03:30:07 +03:00
|
|
|
"create-daml-app/**",
|
2019-05-03 11:17:15 +03:00
|
|
|
"quickstart-java/**",
|
2019-05-08 09:57:15 +03:00
|
|
|
"quickstart-scala/**",
|
|
|
|
]) + [
|
|
|
|
"//docs:quickstart-java.tar.gz",
|
2019-06-18 12:56:06 +03:00
|
|
|
"//docs:daml-intro-templates",
|
2020-03-30 15:35:22 +03:00
|
|
|
"//docs:daml-patterns",
|
2019-10-15 17:50:43 +03:00
|
|
|
"//docs:copy-trigger-template",
|
2019-11-19 20:19:57 +03:00
|
|
|
"//docs:script-example-template",
|
2019-05-08 09:57:15 +03:00
|
|
|
"//language-support/scala/examples:quickstart-scala-dir",
|
|
|
|
],
|
2019-05-03 11:17:15 +03:00
|
|
|
outs = ["templates-tarball.tar.gz"],
|
|
|
|
cmd = """
|
|
|
|
SRC=templates
|
|
|
|
OUT=templates-tarball
|
|
|
|
|
2019-07-16 16:59:08 +03:00
|
|
|
# templates in templates dir
|
2020-04-02 03:30:07 +03:00
|
|
|
for d in skeleton create-daml-app quickstart-scala quickstart-java; do
|
2019-07-16 16:59:08 +03:00
|
|
|
mkdir -p $$OUT/$$d
|
|
|
|
cp -rL $$SRC/$$d/* $$OUT/$$d/
|
2020-04-02 03:30:07 +03:00
|
|
|
# use default .gitignore and .dlint.yaml if they don't exist in the template
|
|
|
|
cp -n $$SRC/default-gitignore $$OUT/$$d/.gitignore
|
|
|
|
cp -n $$SRC/default-dlint-yaml $$OUT/$$d/.dlint.yaml
|
2020-04-08 10:40:50 +03:00
|
|
|
# We avoid introducing infix syntax in the GSG so we disable
|
|
|
|
# the lint there.
|
|
|
|
if [ "$$d" = "create-daml-app" ]; then
|
|
|
|
cat >> $$OUT/$$d/.dlint.yaml <<EOF
|
|
|
|
|
|
|
|
# This rule is enabled by default but we avoid
|
|
|
|
# infix syntax here to keep things simple.
|
|
|
|
- ignore: {name: Use infix }
|
|
|
|
EOF
|
|
|
|
fi
|
2019-07-16 16:59:08 +03:00
|
|
|
done
|
2019-05-03 11:17:15 +03:00
|
|
|
|
2019-07-16 16:59:08 +03:00
|
|
|
## special cases we should work to remove
|
2019-06-17 17:40:08 +03:00
|
|
|
|
2019-05-03 11:17:15 +03:00
|
|
|
# quickstart-java template
|
|
|
|
tar xf $(location //docs:quickstart-java.tar.gz) --strip-components=1 -C $$OUT/quickstart-java
|
|
|
|
|
2019-05-08 09:57:15 +03:00
|
|
|
# quickstart-scala template
|
|
|
|
cp -r $(location //language-support/scala/examples:quickstart-scala-dir)/* $$OUT/quickstart-scala/
|
|
|
|
|
2019-06-18 12:56:06 +03:00
|
|
|
# daml intro templates
|
|
|
|
tar xf $(location //docs:daml-intro-templates) -C $$OUT
|
|
|
|
|
2019-10-15 17:50:43 +03:00
|
|
|
mkdir -p $$OUT/copy-trigger
|
|
|
|
tar xf $(location //docs:copy-trigger-template) -C $$OUT/copy-trigger
|
|
|
|
|
2019-11-19 20:19:57 +03:00
|
|
|
mkdir -p $$OUT/script-example
|
|
|
|
tar xf $(location //docs:script-example-template) -C $$OUT/script-example
|
|
|
|
|
2020-03-30 15:35:22 +03:00
|
|
|
mkdir -p $$OUT/daml-patterns
|
|
|
|
tar xf $(location //docs:daml-patterns) --strip-components=1 -C $$OUT/daml-patterns
|
|
|
|
|
2020-03-31 11:09:52 +03:00
|
|
|
tar c templates-tarball \
|
|
|
|
--owner=0 --group=0 --numeric-owner --mtime=2000-01-01\ 00:00Z --sort=name \
|
|
|
|
| gzip -n >$(location :templates-tarball.tar.gz)
|
2019-05-03 11:17:15 +03:00
|
|
|
""",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|