mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
1872c668a5
Change requested by Manoj. CHANGELOG_BEGIN CHANGELOG_END
80 lines
3.8 KiB
Python
80 lines
3.8 KiB
Python
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
def sdk_tarball(name, version):
|
|
native.genrule(
|
|
name = name,
|
|
srcs = [
|
|
":sdk-config.yaml.tmpl",
|
|
":install.sh",
|
|
":install.bat",
|
|
"//ledger/sandbox:src/main/resources/logback.xml",
|
|
"//navigator/backend:src/main/resources/logback.xml",
|
|
"//extractor:src/main/resources/logback.xml",
|
|
"//ledger-service/http-json:release/json-api-logback.xml",
|
|
"//language-support/java/codegen:src/main/resources/logback.xml",
|
|
"//triggers/runner:src/main/resources/logback.xml",
|
|
"//daml-script/runner:src/main/resources/logback.xml",
|
|
"//:NOTICES",
|
|
"//daml-assistant:daml-dist",
|
|
"//compiler/damlc:damlc-dist",
|
|
"//compiler/daml-extension:vsix",
|
|
"//daml-assistant/daml-helper:daml-helper-dist",
|
|
"//language-support/ts/codegen:daml2ts-dist",
|
|
"//templates:templates-tarball.tar.gz",
|
|
"//triggers/daml:daml-trigger-dars",
|
|
"//daml-script/daml:daml-script-dars",
|
|
"//daml-assistant/daml-sdk:sdk_deploy.jar",
|
|
],
|
|
outs = ["{}.tar.gz".format(name)],
|
|
cmd = """
|
|
# damlc
|
|
VERSION={version}
|
|
OUT=sdk-$$VERSION
|
|
mkdir -p $$OUT
|
|
|
|
cp $(location //:NOTICES) $$OUT/NOTICES
|
|
|
|
cp $(location :install.sh) $$OUT/install.sh
|
|
cp $(location :install.bat) $$OUT/install.bat
|
|
|
|
cp $(location :sdk-config.yaml.tmpl) $$OUT/sdk-config.yaml
|
|
sed -i "s/__VERSION__/$$VERSION/" $$OUT/sdk-config.yaml
|
|
|
|
mkdir -p $$OUT/daml
|
|
tar xf $(location //daml-assistant:daml-dist) --strip-components=1 -C $$OUT/daml
|
|
|
|
mkdir -p $$OUT/damlc
|
|
tar xf $(location //compiler/damlc:damlc-dist) --strip-components=1 -C $$OUT/damlc
|
|
|
|
mkdir -p $$OUT/daml-libs
|
|
cp -t $$OUT/daml-libs $(locations //triggers/daml:daml-trigger-dars)
|
|
cp -t $$OUT/daml-libs $(locations //daml-script/daml:daml-script-dars)
|
|
|
|
mkdir -p $$OUT/daml-helper
|
|
tar xf $(location //daml-assistant/daml-helper:daml-helper-dist) --strip-components=1 -C $$OUT/daml-helper
|
|
|
|
mkdir -p $$OUT/daml2ts
|
|
tar xf $(location //language-support/ts/codegen:daml2ts-dist) --strip-components=1 -C $$OUT/daml2ts
|
|
|
|
mkdir -p $$OUT/studio
|
|
cp $(location //compiler/daml-extension:vsix) $$OUT/studio/daml-bundled.vsix
|
|
|
|
mkdir -p $$OUT/templates
|
|
tar xf $(location //templates:templates-tarball.tar.gz) --strip-components=1 -C $$OUT/templates
|
|
|
|
mkdir -p $$OUT/daml-sdk
|
|
cp $(location //daml-assistant/daml-sdk:sdk_deploy.jar) $$OUT/daml-sdk/daml-sdk.jar
|
|
cp -L $(location //ledger-service/http-json:release/json-api-logback.xml) $$OUT/daml-sdk/
|
|
cp -L $(location //ledger/sandbox:src/main/resources/logback.xml) $$OUT/daml-sdk/sandbox-logback.xml
|
|
cp -L $(location //navigator/backend:src/main/resources/logback.xml) $$OUT/daml-sdk/navigator-logback.xml
|
|
cp -L $(location //extractor:src/main/resources/logback.xml) $$OUT/daml-sdk/extractor-logback.xml
|
|
cp -L $(location //language-support/java/codegen:src/main/resources/logback.xml) $$OUT/daml-sdk/codegen-logback.xml
|
|
cp -L $(location //triggers/runner:src/main/resources/logback.xml) $$OUT/daml-sdk/trigger-logback.xml
|
|
cp -L $(location //daml-script/runner:src/main/resources/logback.xml) $$OUT/daml-sdk/script-logback.xml
|
|
|
|
tar c --format=ustar --sort=name --owner=root:0 --group=root:0 --mtime=0 $$OUT | gzip -n > $@
|
|
""".format(version = version),
|
|
visibility = ["//visibility:public"],
|
|
)
|