1# Copyright 2022 Google LLC. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the License); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15workspace(name = "rules_kotlin") 16 17load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 18 19http_archive( 20 name = "rules_jvm_external", 21 strip_prefix = "rules_jvm_external-5.2", 22 sha256 = "3824ac95d9edf8465c7a42b7fcb88a5c6b85d2bac0e98b941ba13f235216f313", 23 url = "https://github.com/bazelbuild/rules_jvm_external/archive/5.2.zip", 24) 25load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") 26rules_jvm_external_deps() 27load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") 28rules_jvm_external_setup() 29load("@rules_jvm_external//:defs.bzl", "maven_install") 30 31http_archive( 32 name = "bazel_skylib", 33 sha256 = "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728", 34 urls = [ 35 "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz", 36 ], 37) 38load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") 39bazel_skylib_workspace() 40 41http_archive( 42 name = "bazel_platforms", 43 sha256 = "379113459b0feaf6bfbb584a91874c065078aa673222846ac765f86661c27407", 44 urls = [ 45 "https://github.com/bazelbuild/platforms/releases/download/0.0.5/platforms-0.0.5.tar.gz", 46 ], 47) 48 49http_archive( 50 name = "rules_license", 51 sha256 = "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360", 52 urls = [ 53 "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", 54 ], 55) 56load("@rules_license//:deps.bzl", "rules_license_dependencies") 57rules_license_dependencies() 58 59http_archive( 60 name = "rules_java", 61 urls = [ 62 "https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/5.5.0/rules_java-5.5.0.tar.gz", 63 "https://github.com/bazelbuild/rules_java/releases/download/5.5.0/rules_java-5.5.0.tar.gz", 64 ], 65 sha256 = "bcfabfb407cb0c8820141310faa102f7fb92cc806b0f0e26a625196101b0b57e", 66) 67load("@rules_java//java:repositories.bzl", "java_tools_repos") 68java_tools_repos() 69 70http_archive( 71 name = "dagger", 72 strip_prefix = "dagger-dagger-2.44.2", 73 build_file = "@//bazel:dagger.BUILD", 74 sha256 = "cbff42063bfce78a08871d5a329476eb38c96af9cf20d21f8b412fee76296181", 75 urls = ["https://github.com/google/dagger/archive/dagger-2.44.2.zip"], 76) 77load("@dagger//:workspace_defs.bzl", "DAGGER_ARTIFACTS", "DAGGER_REPOSITORIES") 78 79load("@//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "KT_VERSION") 80http_archive( 81 name = "kotlinc", 82 build_file = "@//bazel:kotlinc.BUILD", 83 sha256 = "7d74863deecf8e0f28ea54c3735feab003d0eac67e8d3a791254b16889c20342", 84 strip_prefix = "kotlinc", 85 urls = [ 86 "https://github.com/JetBrains/kotlin/releases/download/v{0}/kotlin-compiler-{0}.zip".format(KT_VERSION[1:].replace("_", ".")), 87 ], 88) 89 90register_toolchains("@//toolchains/kotlin_jvm:all") 91 92maven_install( 93 artifacts = DAGGER_ARTIFACTS + [ 94 "com.google.auto.service:auto-service-annotations:1.0.1", 95 "com.google.auto.service:auto-service:1.0.1", 96 "com.google.auto.value:auto-value:1.9", 97 "com.google.testing.compile:compile-testing:0.19", 98 "com.google.truth:truth:1.1.3", 99 "info.picocli:picocli:4.6.3", 100 "javax.inject:jsr330-api:0.9", 101 "junit:junit:4.13.2", 102 "org.jacoco:org.jacoco.agent:0.8.8", 103 "org.jacoco:org.jacoco.cli:0.8.8", 104 "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.4.2", 105 "org.mockito:mockito-core:4.5.1", 106 ], 107 repositories = DAGGER_REPOSITORIES + [ 108 "https://repository.mulesoft.org/nexus/content/repositories/public", 109 ], 110 override_targets = { 111 "org.jetbrains.kotlin:annotations": "@kotlinc//:annotations", 112 "org.jetbrains.kotlin:kotlin-reflect": "@kotlinc//:kotlin_reflect", 113 "org.jetbrains.kotlin:kotlin-stdlib": "@kotlinc//:kotlin_stdlib", 114 "org.jetbrains.kotlin:kotlin-stdlib-jdk7": "@kotlinc//:kotlin_stdlib_jdk7", 115 "org.jetbrains.kotlin:kotlin-stdlib-jdk8": "@kotlinc//:kotlin_stdlib_jdk8", 116 "org.jetbrains.kotlin:kotlin-test": "@kotlinc//:kotlin_test", 117 }, 118) 119 120