forked from bazelbuild/rules_typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.bzl
131 lines (112 loc) · 5.5 KB
/
package.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# 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.
"""Package file which defines build_bazel_rules_typescript version in skylark
check_rules_typescript_version can be used in downstream WORKSPACES to check
against a minimum dependent build_bazel_rules_typescript version.
"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# This version is synced with the version in package.json.
# It will be automatically synced via the npm "version" script
# that is run when running `npm version` during the release
# process. See `Releasing` section in README.md.
VERSION = "0.22.1"
def rules_typescript_dependencies():
"""
Fetch our transitive dependencies.
If the user wants to get a different version of these, they can just fetch it
from their WORKSPACE before calling this function, or not call this function at all.
"""
# TypeScript compiler runs on node.js runtime
_maybe(
http_archive,
name = "build_bazel_rules_nodejs",
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.4.zip"],
strip_prefix = "rules_nodejs-0.16.4",
)
# ts_web_test depends on the web testing rules to provision browsers.
_maybe(
http_archive,
name = "io_bazel_rules_webtesting",
urls = ["https://github.com/bazelbuild/rules_webtesting/archive/111d792b9a5b17f87b6e177e274dbbee46094791.zip"],
strip_prefix = "rules_webtesting-111d792b9a5b17f87b6e177e274dbbee46094791",
sha256 = "a13af63e928c34eff428d47d31bafeec4e38ee9b6940e70bf2c9cd47184c5c16",
)
# ts_devserver depends on the Go rules.
# See https://github.com/bazelbuild/rules_go#setup for the latest version.
_maybe(
http_archive,
name = "io_bazel_rules_go",
# We need https://github.com/bazelbuild/rules_go/commit/109c520465fcb418f2c4be967f3744d959ad66d3 which
# is not part of any 0.16.x release yet. This commit provides runfile resolve support for Windows.
urls = ["https://github.com/bazelbuild/rules_go/archive/12a52e9845a5b06a28ffda06d7f2b07ff2320b97.zip"],
strip_prefix = "rules_go-12a52e9845a5b06a28ffda06d7f2b07ff2320b97",
sha256 = "5c0a059afe51c744c90ae2b33ac70b9b4f4c514715737e2ec0b5fd297400c10d",
)
# go_repository is defined in bazel_gazelle
_maybe(
http_archive,
name = "bazel_gazelle",
urls = ["https://github.com/bazelbuild/bazel-gazelle/archive/c0880f7f9d7048b45be5d36115ec2bf444e723c4.zip"], # 2018-12-05
strip_prefix = "bazel-gazelle-c0880f7f9d7048b45be5d36115ec2bf444e723c4",
sha256 = "d9980ae0c91d90aaf9131170adfec4e87464d53e58ce2eb01b350a53e93a87c7",
)
# ts_auto_deps depends on com_github_bazelbuild_buildtools
_maybe(
http_archive,
name = "com_github_bazelbuild_buildtools",
url = "https://github.com/bazelbuild/buildtools/archive/0.19.2.1.zip",
strip_prefix = "buildtools-0.19.2.1",
sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79",
)
###############################################
# Repeat the dependencies of rules_nodejs here!
# We can't load() from rules_nodejs yet, because we've only just fetched it.
# But we also don't want to make users load and call the rules_nodejs_dependencies
# function because we can do that for them, mostly hiding the transitive dependency.
_maybe(
http_archive,
name = "bazel_skylib",
url = "https://github.com/bazelbuild/bazel-skylib/archive/d7c5518fa061ae18a20d00b14082705d3d2d885d.zip",
strip_prefix = "bazel-skylib-d7c5518fa061ae18a20d00b14082705d3d2d885d",
)
def rules_typescript_dev_dependencies():
"""
Fetch dependencies needed for local development, but not needed by users.
These are in this file to keep version information in one place, and make the WORKSPACE
shorter.
"""
# For running skylint
_maybe(
http_archive,
name = "io_bazel",
urls = ["https://github.com/bazelbuild/bazel/releases/download/0.17.1/bazel-0.17.1-dist.zip"],
)
#############################################
# Dependencies for generating documentation #
#############################################
http_archive(
name = "io_bazel_rules_sass",
urls = ["https://github.com/bazelbuild/rules_sass/archive/8ccf4f1c351928b55d5dddf3672e3667f6978d60.zip"], # 2018-11-23
strip_prefix = "rules_sass-8ccf4f1c351928b55d5dddf3672e3667f6978d60",
sha256 = "894d7928df8da85e263d743c8434d4c10ab0a3f0708fed0d53394e688e3faf70",
)
http_archive(
name = "io_bazel_skydoc",
url = "https://github.com/bazelbuild/skydoc/archive/9bbdf62c03b5c3fed231604f78d3976f47753d79.zip", # 2018-11-20
strip_prefix = "skydoc-9bbdf62c03b5c3fed231604f78d3976f47753d79",
sha256 = "07ae937026cb56000fb268d4986b220e868c1bdfe6aac27ecada4b4b3dae246f",
)
def _maybe(repo_rule, name, **kwargs):
if name not in native.existing_rules():
repo_rule(name = name, **kwargs)