blob: 9fbd39dd35402f153193afdc570411a6d3c5408d [file] [log] [blame]
workspace(
name = "kotlin_example",
managed_directories = {"@npm": ["node_modules"]},
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "c9c5d60d6234d65b06f86abd5edc60cadd1699f739ee49d33a099d2d67eb1ae8",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.0/rules_nodejs-4.4.0.tar.gz"],
)
load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", "rules_nodejs_dependencies")
rules_nodejs_dependencies()
# Install external npm dependencies
load("@build_bazel_rules_nodejs//:index.bzl", "npm_install")
npm_install(
# Name this npm so that Bazel Label references look like @npm//package
name = "npm",
package_json = "//:package.json",
package_lock_json = "//:package-lock.json",
)
# Install external Kotlin/Java dependencies
http_archive(
name = "rules_jvm_external",
sha256 = "f04b1466a00a2845106801e0c5cec96841f49ea4e7d1df88dc8e4bf31523df74",
strip_prefix = "rules_jvm_external-2.7",
url = "https://github.com/bazelbuild/rules_jvm_external/archive/2.7.zip",
)
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
name = "maven",
artifacts = [
"org.jetbrains.kotlinx:kotlinx-html-js:0.7.3",
"org.jetbrains.kotlin:kotlin-stdlib-js:1.4.31",
],
fetch_sources = True, # Fetch source jars. Defaults to False.
maven_install_json = "@kotlin_example//:maven_install.json",
repositories = [
# "http://dl.bintray.com/kotlin/kotlinx.html/",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
load("@maven//:defs.bzl", "pinned_maven_install")
pinned_maven_install()
# To test local edits, add this to .bazelrc.user:
# build --override_repository=io_bazel_rules_kotlin=/my/path/to/rules_kotlin
rules_kotlin_version = "40efd46789a06f06655e867dcaec2a84815461df"
http_archive(
name = "io_bazel_rules_kotlin",
#sha256 = "fea280c0c3fbb40712c5e7994c36c1a7ab0be5c8d26c90d47ac55860c5d43b2d",
strip_prefix = "rules_kotlin-%s" % rules_kotlin_version,
type = "zip",
urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % rules_kotlin_version],
)
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
kotlin_repositories()
kt_register_toolchains()