Skip to content

Commit

Permalink
Merge pull request #45 from cgruber/pull_in_upstream
Browse files Browse the repository at this point in the history
Pull in upstream changes from bazelbuild/rules_kotlin
  • Loading branch information
cgruber authored Feb 10, 2020
2 parents fbdd60c + e246de7 commit 500b5f6
Show file tree
Hide file tree
Showing 49 changed files with 56 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

| Date                   | News |
| :----------- | -------- |
| Dec 6, 2019 | Released version [1.3.0-rc4](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0-rc4). |
| Dec 6, 2019 | Bug fixes and tweaks (#255, #257). |
| Dec 6, 2019 | Released version [1.3.0-rc3](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0-rc3). |
| Dec 6, 2019 | Add support for later java versions as target platforms (#236). |
| Dec 5, 2019 | Released version [1.3.0-rc2](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0-rc2). |
Expand Down
3 changes: 3 additions & 0 deletions examples/dagger/src/coffee/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# 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.
load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_plugin")
package(default_visibility = ["//visibility:private"])

load("//kotlin:kotlin.bzl", "kt_jvm_library")

# Generate a srcjar to validate intellij plugin correctly attaches it.
Expand Down
1 change: 1 addition & 0 deletions kotlin/internal/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ KtJvmInfo = provider(
"friend_paths": "The target(s) that this library can see the internals of.",
"srcs": "the source files. [intelij-aspect]",
"outputs": "output jars produced by this rule. [intelij-aspect]",
"language_version": "version of kotlin used. [intellij-aspect]",
},
)

Expand Down
3 changes: 2 additions & 1 deletion kotlin/internal/jvm/android.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ def kt_android_library(name, exports = [], visibility = None, **kwargs):
name = name,
exports = exports + _kt_android_artifact(name, **kwargs),
visibility = visibility,
testonly = kwargs.get("testonly", default = 0),
tags = kwargs.get("tags", default=None),
testonly = kwargs.get("testonly", default=0),
)
1 change: 1 addition & 0 deletions kotlin/internal/jvm/compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def kt_jvm_compile_action(ctx, rule_kind, output_jar):
srcs = ctx.files.srcs,
module_name = module_name,
friend_paths = friend_paths,
language_version = toolchain.api_version,
# intelij aspect needs this.
outputs = struct(
jdeps = ctx.outputs.jdeps,
Expand Down
2 changes: 2 additions & 0 deletions kotlin/internal/jvm/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ def kt_jvm_binary_impl(ctx):

_SPLIT_STRINGS = [
"src/test/java/",
"src/test/kotlin/",
"javatests/",
"kotlin/",
"java/",
"test/",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_js_import", "kt_jvm_import")
load("@rules_java//java:defs.bzl", "java_import")

# Kotlin home filegroup containing everything that is needed.
filegroup(
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# 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.
load("@rules_java//java:defs.bzl", "java_binary")
load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library")
load("//kotlin:kotlin.bzl", "kt_jvm_library")
load("//third_party:jarjar.bzl", "jar_jar")
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/bootstrap.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# 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.
load("@rules_java//java:defs.bzl", "java_import", "java_library")
load("//kotlin:kotlin.bzl", _for_ide = "kt_jvm_library")

_BOOTSTRAP_LIB_ARGS = ["-jvm-target", "1.8"]
Expand Down Expand Up @@ -100,7 +101,7 @@ rm $(@D)/$${NAME}_temp.jar
],
cmd = command,
)
native.java_import(
java_import(
name = name,
jars = [jar_label],
tags = ["no-ide"],
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/io/bazel/kotlin/builder/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# 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.
load("@rules_java//java:defs.bzl", "java_library")
load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library")

kt_bootstrap_library(
Expand Down
1 change: 1 addition & 0 deletions src/main/protobuf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# 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.
load("@rules_java//java:defs.bzl", "java_import")
package(default_visibility = ["//visibility:public"])

proto_library(
Expand Down
1 change: 1 addition & 0 deletions src/test/data/jvm/basic/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
package(default_visibility = ["//visibility:private"])

load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("//kotlin:kotlin.bzl", "kt_jvm_binary", "kt_jvm_library", "kt_jvm_test")

kt_jvm_binary(
Expand Down
1 change: 1 addition & 0 deletions src/test/data/jvm/kapt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
package(default_visibility = ["//visibility:private"])

load("@rules_java//java:defs.bzl", "java_plugin", "java_library")
load("//kotlin:kotlin.bzl", "kt_jvm_library")

java_plugin(
Expand Down
1 change: 1 addition & 0 deletions src/test/kotlin/io/bazel/kotlin/builder/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
package(default_visibility = ["//visibility:private"])

load("@rules_java//java:defs.bzl", "java_library")
load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_test")

_COMMON_DEPS = [
Expand Down
3 changes: 2 additions & 1 deletion src/test/kotlin/io/bazel/kotlin/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# 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.
load("@rules_java//java:defs.bzl", "java_test")
load("//kotlin:kotlin.bzl", "kt_jvm_test")

def _get_class_name(kwargs):
Expand All @@ -30,7 +31,7 @@ def kt_rules_test(name, **kwargs):
if f.endswith(".kt"):
kt_jvm_test(name = name, **kwargs)
return
native.java_test(name = name, **kwargs)
java_test(name = name, **kwargs)

def kt_rules_e2e_test(name, **kwargs):
kwargs.setdefault("size", "small")
Expand Down
1 change: 1 addition & 0 deletions third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
package(default_visibility = ["//visibility:public"])

load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_plugin")
load("//kotlin:kotlin.bzl", "kt_jvm_import")


Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/auto/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/auto/service/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/auto/value/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/code/findbugs/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/code/gson/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/dagger/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/errorprone/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/googlejavaformat/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/guava/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/j2objc/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/google/truth/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/googlecode/java_diff_utils/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/com/squareup/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/javax/annotation/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/javax/enterprise/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/javax/inject/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/junit/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/net/ltgt/gradle/incap/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/apache/ant/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/apache/commons/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/apache/maven/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/checkerframework/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/codehaus/mojo/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/codehaus/plexus/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/eclipse/sisu/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/hamcrest/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/jetbrains/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/jetbrains/kotlin/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/jetbrains/kotlinx/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/ow2/asm/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/org/pantsbuild/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:defs.bzl", "java_library")
licenses(["notice"])

java_library(
Expand Down
1 change: 1 addition & 0 deletions third_party/jvm/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def _jar_artifact_impl(ctx):
srcjar_attr = '\n srcjar = ":%s",' % src_name

build_file_contents = """
load("@rules_java//java:defs.bzl", "java_import")
package(default_visibility = ['//visibility:public'])
java_import(
name = 'jar',
Expand Down

0 comments on commit 500b5f6

Please sign in to comment.