Closed victorjoh closed 3 years ago
You can't use gwt-user with J2CL, and I believe you couldn't use com.google.gwt.regexp
anyway because I think it uses JSNI.
You should be able to use https://github.com/gwtproject/gwt-regexp (org.gwtproject.regexp
) though: https://search.maven.org/artifact/org.gwtproject.regexp/gwt-regexp
Thank you, that worked.
I added that dependency like this in the WORKSPACE file:
j2cl_maven_import_external(
name = "org_gwtproject_regexp-j2cl",
artifact = "org.gwtproject.regexp:gwt-regexp:1.0.0-RC1",
server_urls = _MAVEN_CENTRAL_URLS,
deps = [
"@com_google_jsinterop_base//:jsinterop-base-j2cl",
"@com_google_elemental2//:elemental2-core-j2cl",
],
)
I want to transpile Java code that uses the java.util.regex.Pattern class. But since that JRE class is unsupported (not included here: http://www.gwtproject.org/doc/latest/RefJreEmulation.html), I thought I could use com.google.gwt.regexp.shared.RegExp instead.
I extended the hello world sample and added the dependency in the WORKSPACE file like this, similar to the guava sample:
and I added dependency to the j2cl_library rule in the BUILD file like this:
but when building I get the following error:
Can you please tell what I am doing wrong?
I am using Bazelisk v1.7.3