-
Notifications
You must be signed in to change notification settings - Fork 142
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
Are there J2CL binaries without depedency on build system? #58
Comments
For just j2cl, if you build it with bazel, there is a jar you can run with just plain Bazel can also produce a shell script that runs the jar, letting you even skip A maven plugin is under development which lets you take simple maven projects, and combines the various phases of the build (preprocess sources, compile to JS, combine+optimize JS to a single output) into a single, easy to configure step in a pom file. Whereas GWT2 behaved as a standalone build tool, J2CL is meant to fit into a larger build ecosystem, and not reinvent every wheel, but share as much as possible, and let the build tool decide what needs to be built/rebuilt, etc. On the one hand, this makes it somewhat more difficult to run J2CL itself, but also makes it more flexible, as it is a small gear in a big machine, instead of being the entire machine and assuming a lot about how you will use it. |
To be honest, it creates many barriers for adoption. It is so complex and unobvious. |
Right, work is still being done to put the kind of polish on it that GWT2 has. If you use maven, the https://repo.vertispan.com/j2cl/ repository has To run the jar you're looking for, try this:
|
Thanks, seems possible to use it like this. |
Has anyone managed to make it work? Error: ...Main.java:1: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files Any help? |
@Antonio-Sorrentini You need to pass the Java Runtime Emulation library ( |
@tbroyer thank you very much, I was about to give up! :-) |
So now the next step is to have closure to work. java -jar closure-compiler.jar --js="**.js" Is there any way to do it without bazel or maven and no build tools at all please, just command line? I promise that if I reach my goal I'll write an extensive tutorial on how to do all this. Honestly at the moment it seems impossible to use j2cl if you just want to use it with command line. |
Is there any reason not to use bazel? Anyway if you can install |
Antonio,
I'd love to see some documentation on how you did it all if it works!
Thanks
…On Tue, Oct 1, 2019 at 9:20 AM Roberto Lublinerman ***@***.***> wrote:
Is there any reason not to use bazel?
Anyway if you can install bazel but still want to be able to build
without it you could run bazel build -s
<whatever-target-you-want-to-build> and you will see the commands that
bazel executes. From that you can see what parameters are passed to J2CL,
jscompiler etc, etc. and learn how to build arbitrary targets by hand.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#58?email_source=notifications&email_token=ALOWJEBCKN4ATSORNLGTKETQMN2FLA5CNFSM4H7SSANKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAB3LRQ#issuecomment-537114054>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALOWJECYM3GXHC5CMPJLI2DQMN2FLANCNFSM4H7SSANA>
.
|
@rluble: thank you very much for the "-s" suggestion, it's really useful. About bazel I can't afford to learn and switch to a new building tool in this moment and after all both j2cl and closure are conceived very well to be just indipendent tools in a complex toolchain, but if the toolchain is fixed and imposed the overall workflow flexibility could severely be affected. @giavaneerspublicprojects: I'll try my best both in making this work and writing a tutorial about it. |
BTW, which build system are you using? Maybe you could contribute build scripts once you have everything figured out. |
@rluble I'm still trying so I can't say anything at the moment. But for now my feelings are that everything can be done and really there is no need for specific scripts or code. What I see totally lacking is documentation, examples, tutorials and the like. In fact even googling for just an example of something real made with j2cl gives nothing at all. Anyway whatever will be, be it code or info, if I succeed I'll do my best to share and give as much as I can. This seems to me a piece of software that deserves a lot more attention and adoption of what is possible at the moment just because of missing info. |
Ops, about build system: I use Ubuntu and bazel to build it but then I transfer on another machine and try to integrate the built tools on a windows machine inside my toolchain which is mainly developed by myself. I'm building a very extended and complicated project which is an AI platform I'm going to launch in a few weeks after almost 18 months of development. So far I used JSweet for client side programming, and I like it. But... I feel j2cl would fit better. |
Please care to share if you had succeeded. |
Sorry, I didn't succeed and remained with JSweet. |
Can I just download compiler JAR somewhere and run it with
java -jar
?With old GWT it was a really simple task to start the compiler.
The text was updated successfully, but these errors were encountered: