In Eclipse, how can I move project files without d

2019-06-08 15:15发布

问题:

I have two Eclipse projects: one that depends upon a certain library (android.jar) and one that is more abstract and doesn't contain that dependency.

I am in the process of migrating all classes that have no dependencies on the package, in my case android.*, to the more abstract project. Is there a Eclipse feature that can help automate the move?

Ideally, there would be feature that directly lets you automatically search for and move files that can be relocated to a new project. It would find files that that are:

  • independent of a specified package (with wildcards)
  • independent of other files within the same project that are dependent on the same package (in other words, no indirect dependencies on the package)

回答1:

I submitted an Eclipse enhancement request to support such a refactoring. In the meantime, I found some promising tools to help with the decoupling and dependency analysis.

  • eDepend is a dependency viewer plugin that includes a Class/Package dependency diagram that displays elements dependencies, relationships with libraries/other projects and dependency cycles. It can also list find classes that caused the dependencies.
  • STAN structure analysis for Java
  • nWire
  • Class Dependency Analyzer
  • Dependency Finder

Related questions: 1