简体   繁体   English

Android库项目:重构和导航

[英]Android Library Projects: Refactoring and Navigation

Currently (it changed quite a bit over time) Android Library projects become jar files in the referencing project. 目前(随着时间的推移,它发生了很大变化)Android库项目成为引用项目中的jar文件。 There are some issues with this approach: namely refactoring and navigation through code. 这种方法存在一些问题:即通过代码进行重构和导航。

Is there any way to refactor the library that considers to change the dependent projects (eg rename)? 有没有办法重构考虑更改依赖项目的库(例如重命名)? Right now renames in the library project won't be propagated to dependent project. 现在,库项目中的重命名不会传播到依赖项目。 For each project I currently have to adjust them manually. 对于每个项目,我目前必须手动调整它们。 (Workaround: remove the library reference from the dependent projects and add the library project as a plain Java Project reference.) (解决方法:从依赖项目中删除库引用,并将库项目添加为纯Java项目引用。)

Also, navigating from dependent project to the library brings me to decompiled classes inside the library project jar, but not to the source. 此外,从依赖项目导航到库使我进入库项目jar内的反编译类,但不是源。 Is my Eclipse setup messed or is it just the current Android Library way? 我的Eclipse设置是否混乱或者它只是当前的Android库方式?

There is a dirty way to achieve this. 有一种肮脏的方式来实现这一目标。 You add the library to your dependent project as usual but also as a project in "Java Build Path" of the Project Properties. 您可以像往常一样将库添加到依赖项目中,也可以作为项目属性的“Java构建路径”中的项目。

In Order and Export the library must be above the Android Dependencies. 在Order和Export中,库必须位于Android Dependencies之上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM