Optimize imports

Issue #310 resolved
Jesper Öqvist created an issue

JastAdd includes all imports from all aspects in each generated file. This leads to many unused imports being included in the generated code. We could avoid this by searching for uses of single imported typenames. Since optimizing the imports may add unwanted code generation time we can add this as an optional feature (--optimize_imports).

Comments (3)

  1. Jesper Mattsson

    This would be very helpful for us.

    Not only does the extra imports cause a myriad of compilation warnings, but they also cause a lot of unneeded recompilations when working in Eclipse on pure Java classes that are imported this way.

  2. Jesper Öqvist reporter

    Add --optimize-imports option

    The --optimize-import options can be enabled to reduce the number of unused imports in generated code.

    fixes #310 (bitbucket)

    → <<cset 334f8260ee0e>>

  3. Log in to comment