-
Notifications
You must be signed in to change notification settings - Fork 228
Decouple Kotlin compiler from Kotlin rules #899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
comius
wants to merge
8
commits into
bazelbuild:master
Choose a base branch
from
comius:decouple-kotlin-compiler
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3fd6139
Move all Kotlin rules from @com_github_jetbrains_kotlin to //kotlin/c…
comius 7b8c481
Buildifier pass
comius dc6b63f
Fix examples
comius 9dac565
Remove template substitutions in compiler repository
comius 86c01d7
Remove unused load
comius b88be39
Change visibility of compiler to public
comius ce06429
Fix js deps
comius 1091cfc
Add deprecation warnings for direct access to the jetbrain repository.
restingbull File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2020 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# 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(":compiler.bzl", "kt_configure_compiler") | ||
load("//src/main/starlark/release:packager.bzl", "release_archive") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# Configures the compiler | ||
kt_configure_compiler() | ||
|
||
release_archive( | ||
name = "pkg", | ||
srcs = glob(["*.bzl"]), | ||
src_map = { | ||
"BUILD.release.bazel": "BUILD.bazel", | ||
}, | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2020 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# 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(":compiler.bzl", "kt_configure_compiler") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# Configures the compiler | ||
kt_configure_compiler() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Copyright 2022 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# 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("//kotlin:jvm.bzl", "kt_jvm_import") | ||
load("//kotlin:js.bzl", "kt_js_import") | ||
load("@rules_java//java:defs.bzl", "java_import") | ||
load("//kotlin/internal:defs.bzl", _KT_COMPILER_REPO = "KT_COMPILER_REPO") | ||
|
||
_KT_COMPILER_REPO_PREFIX = "@" + _KT_COMPILER_REPO + "//:" | ||
|
||
def kt_configure_compiler(): | ||
""" | ||
Defines the toolchain_type and default toolchain for kotlin compilation. | ||
|
||
Must be called in kotlin/internal/BUILD.bazel | ||
""" | ||
if native.package_name() != "kotlin/compiler": | ||
fail("kt_configure_compiler must be called in kotlin/compiler not %s" % native.package_name()) | ||
|
||
kt_jvm_import( | ||
name = "annotations", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/annotations-13.0.jar", | ||
neverlink = 1, | ||
) | ||
|
||
kt_jvm_import( | ||
name = "jvm-abi-gen", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/jvm-abi-gen.jar", | ||
) | ||
|
||
# Kotlin dependencies that are internal to this repo and are meant to be loaded manually into a classloader. | ||
[ | ||
kt_jvm_import( | ||
name = "kotlin-%s" % art, | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/kotlin-%s.jar" % art, | ||
neverlink = 1, | ||
) | ||
for art in [ | ||
"annotation-processing", | ||
"annotation-processing-runtime", | ||
"compiler", | ||
] | ||
] | ||
|
||
kt_jvm_import( | ||
name = "kotlinx-serialization-compiler-plugin", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/kotlinx-serialization-compiler-plugin.jar", | ||
) | ||
|
||
kt_jvm_import( | ||
name = "allopen-compiler-plugin", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/allopen-compiler-plugin.jar", | ||
) | ||
|
||
kt_jvm_import( | ||
name = "noarg-compiler-plugin", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/noarg-compiler-plugin.jar", | ||
) | ||
|
||
kt_jvm_import( | ||
name = "sam-with-receiver-compiler-plugin", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/sam-with-receiver-compiler-plugin.jar", | ||
) | ||
|
||
kt_jvm_import( | ||
name = "parcelize-compiler-plugin", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/parcelize-compiler.jar", | ||
) | ||
|
||
kt_jvm_import( | ||
name = "parcelize-runtime", | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/parcelize-runtime.jar", | ||
) | ||
|
||
# Kotlin dependencies that are internal to this repo and may be linked. | ||
[ | ||
java_import( | ||
name = "kotlin-%s" % art, | ||
jars = [_KT_COMPILER_REPO_PREFIX + "lib/kotlin-%s.jar" % art], | ||
) | ||
for art in [ | ||
"preloader", | ||
] | ||
] | ||
|
||
# The Kotlin standard libraries. These should be setup in a Toolchain. | ||
[ | ||
kt_jvm_import( | ||
name = "kotlin-%s" % art, | ||
jar = _KT_COMPILER_REPO_PREFIX + "lib/kotlin-%s.jar" % art, | ||
srcjar = _KT_COMPILER_REPO_PREFIX + "lib/kotlin-%s-sources.jar" % art, | ||
visibility = ["//visibility:public"], | ||
) | ||
for art in [ | ||
"stdlib", | ||
"stdlib-jdk7", | ||
"stdlib-jdk8", | ||
"reflect", | ||
"test", | ||
"script-runtime", | ||
] | ||
] | ||
|
||
# The Kotlin JS standard libraries. These should be setup in a Toolchain. | ||
[ | ||
kt_js_import( | ||
name = "kotlin-%s" % art, | ||
jars = [_KT_COMPILER_REPO_PREFIX + "lib/kotlin-%s.jar" % art], | ||
srcjar = _KT_COMPILER_REPO_PREFIX + "lib/kotlin-%s-sources.jar" % art, | ||
visibility = ["//visibility:public"], | ||
) | ||
for art in [ | ||
"test-js", | ||
"stdlib-js", | ||
] | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.