Comments (6)
@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.
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.
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.
@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.
@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.
@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)
- package listing?
- io_bazel_rules_kotlin_configured HOT 4
- How to fix the error: unused native file on Windows 11? HOT 1
- Ready to work on download file
- Wasm sample broken v2 HOT 2
- JUnit test example for wasm HOT 5
- I receive the following issue during the build. Have anyone an idea what the reason is: HOT 3
- [WASM] HashMap.computeIfAbsent doesn't work as expected HOT 1
- Bazel: accidental impossible target HOT 2
- goog.reflect.sinkValue and deadcode elimination
- How to use it in vite +vue3
- Automate release/tag of the repo on green builds
- predicate is not usable by but exposed to JavaScript. HOT 3
- Support `rules_jvm_external` or `j2cl_maven_import_external` private registry HOT 1
- JRE emulation misses java.io.Externalizable
- Add dependabot to keep GitHub Actions up-to-date
- public methods are too eagerly optimized away; need ability to declare "@export" annotation HOT 9
- "Native JsType method '...' should be native, abstract or JsOverlay." error prevents default implementation for vanilla Java HOT 3
- `closure_js_library` typecheck fails when depending on j2cl jre HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from j2cl.