LoginSignup
6
6

More than 5 years have passed since last update.

Eclipse Android Project の jar ファイルにソースファイルを attachment

Posted at

Eclipse Android Project の jar ファイルにソースファイルを attachment する方法は、Android SDK の revison 毎によって異なる。

revision
r17以前 attachment できる。Project Properties - Java Build Path から設定。
r18,r19 attachment できない。r18の libs/*.jar のファイルが自動的に Eclipse のBuild Pathに追加される新機能が原因
r20 attachment できる。詳細: http://code.google.com/p/android/issues/detail?id=27490

attachment 手順

Android SDK r20 以上で、 Eclipse Android Project の jar ファイルにソースファイルを attachment するには、
*.jar に対応した *.jar.properties にソースファイルjarファイルまたはソースファイルフォルダを定義する。

Eclipse Android Project の構成が下記とする。
* src (ソースディレクトリ)
* gen (自動生成ソースディレクトリ)
* libs (jarファイルを格納するディレクトリ)
* libs/android-support-v4.jar
* libs-sources (jarファイルのソースjarを格納するディレクトリ)
* libs-sources/android-support-v4-sources.jar (android-support-v4.jarのソースjarファイル)

libs/android-support-v4.jar に対応した libs/android-support-v4.jar.properties を作成

libs/android-support-v4.jar.properties

# src: relative or absolute path to the source folder (or archive)
src=../libs-sources/android-support-v4-sources.jar
# doc: relative or absolute path to the javadoc.
#doc=../xxx
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6