Giter Club home page Giter Club logo

Comments (6)

aschleck avatar aschleck commented on June 8, 2024 1

@sgammon not sure what the exact difference is but j2cl works for me with Bazel 6. I don't want to spend the time to minify my project but my guess is maybe something to do with using the Nix JDK instead of the default JDK? https://github.com/aschleck/trailcatalog/blob/main/WORKSPACE.bzlmod#L23 .

In that file you'll see j2cl is pulled from ../j2cl, that's a local clone based on commit 39754f53dc1f4b4fd869e769b5486182c3e43dda with the following patch applied to pull rules_kotlin forward.

diff --git a/build_defs/repository.bzl b/build_defs/repository.bzl
index 12790b1b6..85dc8de3d 100644
--- a/build_defs/repository.bzl
+++ b/build_defs/repository.bzl
@@ -36,11 +36,12 @@ def load_j2cl_repo_deps():
         sha256 = "64ad2728ccdd2044216e4cec7815918b7bb3bb28c95b7e9d951f9d4eccb07625",
     )
 
-    _github_repo(
+    http_archive(
         name = "io_bazel_rules_kotlin",
-        repo = "bazelbuild/rules_kotlin",
-        tag = "legacy-1.3.0-rc3",
-        sha256 = "54678552125753d9fc0a37736d140f1d2e69778d3e52cf454df41a913b964ede",
+        sha256 = "fd92a98bd8a8f0e1cdcb490b93f5acef1f1727ed992571232d33de42395ca9b3",
+        urls = [
+            "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.7.1/rules_kotlin_release.tgz",
+        ],
     )
 
 def _github_repo(name, repo, tag, sha256 = None):
diff --git a/build_defs/workspace.bzl b/build_defs/workspace.bzl
index 64f855d48..72ab780d9 100644
--- a/build_defs/workspace.bzl
+++ b/build_defs/workspace.bzl
@@ -4,7 +4,8 @@ load("@bazel_skylib//lib:versions.bzl", "versions")
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
 load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
 load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies")
-load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
+load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
+load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
 
 _MAVEN_CENTRAL_URLS = ["https://repo1.maven.org/maven2/"]
 
@@ -196,14 +197,6 @@ def setup_j2cl_workspace(**kwargs):
         sha256 = "83ce07ec2058d8d629feb4e269216e286560b0e4587dea883f4e16b64ea51cad",
     )
 
-    kotlin_repositories(
-        compiler_release = {
-            "urls": [
-                "https://github.com/JetBrains/kotlin/releases/download/v1.6.10/kotlin-compiler-1.6.10.zip",
-            ],
-            "sha256": "432267996d0d6b4b17ca8de0f878e44d4a099b7e9f1587a98edc4d27e76c215a",
-        },
-    )
     kt_register_toolchains()
 
     # Required by protobuf_java_util

from j2cl.

sgammon avatar sgammon commented on June 8, 2024

I wonder if the J2CL command line transpiler might be an option instead? Is WASM supported through that? I was able to get it to build so long as Java was set to 11. We need 17 for some other targets, although we aren't using any syntax from 17 that makes it into the J2CL target.

from j2cl.

gkdn avatar gkdn commented on June 8, 2024

re. Bazel 6 support:
Thanks for reporting. We haven't looked into running with Bazel 6. We should address this but we are quite busy with other stuff at the moment so it may take some time.

re. command line tool for Wasm:
We should support wasm on the command line tool after we stabilize the transpiler. Currently for Wasm we are doing a monolithic compile (compile all sources in one shot) and we are in the process of rebuilding it to be "modular" similar to J2CL/JS or javac. However being said that with modular compilation the pipeline will be more complicated to use from the command line (again similar to J2CL/JS).

from j2cl.

treblereel avatar treblereel commented on June 8, 2024

@gkdn modularization sounds nice, looks like it allows us to perform incremental recompilation in maven multi-module project with the j2cl-maven-plugin. Cool

from j2cl.

sgammon avatar sgammon commented on June 8, 2024

@gkdn we're in bazel downstream so cli access is only a way to get access to J2CL before bazel 6 support. thank you for this response, we'll keep an eye out.

from j2cl.

gkdn avatar gkdn commented on June 8, 2024

@sgammon I think command line runner has all the flags available to run. The contract will change after the modularization but you can probably make it work for today.

from j2cl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.