blob: 1a36c4bb63785159f8b350d35dcde3e6020c77a6 [file] [log] [blame]
workspace(name = "kotlin_example")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "f690430f4d4cc403b5c90d0f0b21842183b56b732fff96cfe6555fe73189906a",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.1/rules_nodejs-5.0.1.tar.gz"],
)
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
build_bazel_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()