rules_jvm icon indicating copy to clipboard operation
rules_jvm copied to clipboard

Preserve Cache between the runs

Open gn-harness opened this issue 3 years ago • 2 comments

We have large build targets (one for each top level directory) in https://github.com/harness/harness-core.

When I run gazelle - I have to deal (manually fix) with a bunch of cyclic dependencies. Each time I refactor, I run gazelle to regenerate the build files. Even if changes are isolated to a sub-directory, I have to run gazelle on entire workspace. It appears on each run, we map package to build target -- so if we try running gazelle only on a sub-directory, it does not resolve imports from other directories.

Is there a way to create a cache of such mapping and update it with new runs?

gn-harness avatar Jul 01 '22 05:07 gn-harness

Unfortunately not easily - see https://github.com/bazelbuild/bazel-gazelle/issues/1181 for some discussion on this topic. I definitely agree that this would be a useful thing to have!

illicitonion avatar Jul 01 '22 09:07 illicitonion

Thanks Daniel! Have you tried using go_prefix for java -- does that help our usecase as discussed in the other ticket?

gn-harness avatar Jul 01 '22 22:07 gn-harness