Skip to content

Commit

Permalink
Should not have been committed without review.
Browse files Browse the repository at this point in the history
Revert "Fix js test and format capabilities"

This reverts commit 0c3e186.
  • Loading branch information
restingbull committed Jun 4, 2024
1 parent 0c3e186 commit 24e2aa7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 17 deletions.
14 changes: 3 additions & 11 deletions kotlin/compiler/compiler.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@com_github_jetbrains_kotlin//:artifacts.bzl", "KOTLINC_ARTIFACTS")
load("@rules_java//java:defs.bzl", "java_import")
load("//kotlin:js.bzl", "kt_js_import")
load("//kotlin:jvm.bzl", "kt_jvm_import")
load("//kotlin/internal:defs.bzl", _KT_COMPILER_REPO = "KT_COMPILER_REPO")
load("@com_github_jetbrains_kotlin//:artifacts.bzl", "KOTLINC_ARTIFACTS")

def _import_artifacts(artifacts, rule_kind):
_import_labels(artifacts.plugin, rule_kind)
_import_labels(artifacts.runtime, rule_kind)
_import_labels(artifacts.compile, rule_kind, neverlink = 1)

def _import_labels(labels, rule_kind, **rule_args):
for (label, file) in labels.items():
if not file.endswith(".jar"):
native.filegroup(
name = label,
srcs = [
"@%s//:%s" % (_KT_COMPILER_REPO, label),
],
)
return

for label in labels:
if "-sources" in label:
continue
args = dict(rule_args.items())
Expand Down
4 changes: 4 additions & 0 deletions kotlin/internal/js/js.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ kt_js_import = rule(
cfg = "exec",
),
},
outputs = dict(
js = "%{module_name}.js",
js_map = "%{module_name}.js.map",
),
implementation = _kt_js_import_impl,
provides = [_KtJsInfo],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.preloading.ClassPreloadingUtils
import org.jetbrains.kotlin.preloading.Preloader
import java.io.File
import java.io.PrintStream
import java.lang.ClassLoader
import java.lang.reflect.Method
import java.nio.file.FileSystems
import java.nio.file.Path
Expand Down Expand Up @@ -258,6 +259,6 @@ class KotlinToolchain private constructor(
toolchain: KotlinToolchain,
) : KotlinCliToolInvoker(
toolchain.toolchainWithReflect(),
"org.jetbrains.kotlin.cli.js.K2JsIrCompiler",
"org.jetbrains.kotlin.cli.js.K2JSCompiler",
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# 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.
package(default_visibility = ["//visibility:public"])

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(":artifacts.bzl", "KOTLINC_ARTIFACT_LIST")

package(default_visibility = ["//visibility:public"])

bzl_library(
name = "capabilities",
srcs = glob(["*.bzl"]),
Expand Down
1 change: 0 additions & 1 deletion src/main/starlark/core/repositories/kotlin/artifacts.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ KOTLINC_ARTIFACTS = struct(
plugin = {},
runtime = {
"kotlin-stdlib-js": "lib/kotlin-stdlib-js.jar",
"kotlin-stdlib-js-klib": "lib/kotlin-stdlib-js.klib",
"kotlin-stdlib-js-sources": "lib/kotlin-stdlib-js-sources.jar",
"kotlin-test-js": "lib/kotlin-test-js.jar",
"kotlin-test-js-sources": "lib/kotlin-test-js-sources.jar",
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ kt_rules_test(
name = "KotlinBuilderJsTest",
srcs = ["js/KotlinBuilderJsTest.java"],
data = [
"//kotlin/compiler:kotlin-stdlib-js-klib",
"//kotlin/compiler:kotlin-stdlib-js.js",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class KotlinBuilderJsTest {
private static final KotlinJsTestBuilder builder = new KotlinJsTestBuilder();

private Dep stdLib = Dep.fromLabel("//kotlin/compiler:kotlin-stdlib-js-klib");
private Dep stdLib = Dep.fromLabel("@com_github_jetbrains_kotlin//:lib/kotlin-stdlib-js.jar");

@Test
public void testSimpleJsCompile() {
Expand Down

0 comments on commit 24e2aa7

Please sign in to comment.