-
Hi. I have next: Structure: How to concat source directories when I run j2cl:build or watch? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
spurce == source? The standard maven rules apply here, this plugin just reads how you've configured maven. Your build-helper-maven-plugin might work, but you need to make sure that you are adding those sources early enough in the build, and in such a way that a parent pom (if it exists) can see them. The conventional way would be for each of Shared/ and Web/ to have a src/main/java/ dir, with com/domain/app/ inside of them. Then, you run the j2cl:watch from the parent pom, so that it can see all of the child projects (though j2cl:build would still run from the Web project, which would depend on Shared). This is what we would strongly suggest, rather than one single project that contains both shared and client (and possibly server) code - j2cl does not have the kind of flexibility that GWT had in this regard. |
Beta Was this translation helpful? Give feedback.
Legacy isn't going to work here - j2cl is much pickier about how it works than GWT is.
GWT is not just a compiler, its a whole build system. The .gwt.xml "module files" help you define the structure of your code, how dependencies work, what packages can be compiled, which packages replace other packages. GWT only runs once, and is fed all of the sources at the same time, compiles each and optimizes them all at once.
J2CL doesn't support any of that, it is just "Feed me source to compile, and the bytecode if its dependencies", the same way that javac itself works. In turn, you run it once on each dependency you rely on and each module in your project (Google encourages that to be as small …