Skip to content

Commit

Permalink
Merge branch 'master' into update-skylib-to-1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bencodes authored Jul 12, 2024
2 parents 1d2d54e + b076b4a commit b5c35d3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
validate_config: 1
bazel: 7.1.1
bazel: 880c17c67a9b4e17e9753a5c6e2a759bff5a2cfe
buildifier:
version: 7.1.1
# no lint warnings for the moment. They are basically a smoke alarm in hell.
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module(
repo_name = "rules_kotlin",
)

bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "7.2.0")
bazel_dep(name = "rules_python", version = "0.23.1")
Expand Down
2 changes: 1 addition & 1 deletion MODULE.release.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module(
repo_name = "rules_kotlin",
)

bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "7.2.0")
bazel_dep(name = "rules_python", version = "0.23.1")
Expand Down
1 change: 1 addition & 0 deletions kotlin/internal/jvm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ bzl_library(
deps = [
"//third_party:bzl",
"@bazel_skylib//rules:common_settings",
"@rules_java//java:rules",
],
)
16 changes: 11 additions & 5 deletions kotlin/internal/jvm/compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@
# 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(
"@bazel_tools//tools/jdk:toolchain_utils.bzl",
"find_java_runtime_toolchain",
"find_java_toolchain",
)
load(
"@rules_java//java:defs.bzl",
"JavaInfo",
"java_common",
)
load(
"//kotlin/internal:defs.bzl",
_JAVA_RUNTIME_TOOLCHAIN_TYPE = "JAVA_RUNTIME_TOOLCHAIN_TYPE",
_JAVA_TOOLCHAIN_TYPE = "JAVA_TOOLCHAIN_TYPE",
_KtCompilerPluginInfo = "KtCompilerPluginInfo",
_KtJvmInfo = "KtJvmInfo",
_KtPluginConfiguration = "KtPluginConfiguration",
Expand Down Expand Up @@ -54,6 +51,15 @@ load(
)

# UTILITY ##############################################################################################################
def find_java_toolchain(ctx, target):
if _JAVA_TOOLCHAIN_TYPE in ctx.toolchains:
return ctx.toolchains[_JAVA_TOOLCHAIN_TYPE].java
return target[java_common.JavaToolchainInfo]

def find_java_runtime_toolchain(ctx, target):
if _JAVA_RUNTIME_TOOLCHAIN_TYPE in ctx.toolchains:
return ctx.toolchains[_JAVA_RUNTIME_TOOLCHAIN_TYPE].java_runtime
return target[java_common.JavaRuntimeInfo]

def _java_info(target):
return target[JavaInfo] if JavaInfo in target else None
Expand Down

0 comments on commit b5c35d3

Please sign in to comment.