---
title: "如何将自己的类build到Android.jar"
author: "marine8888"
date: "2011-02-07T12:13:33Z"
tags: []
categories: ["移动开发"]
slug: "build-android-jar"
draft: false
lastmod: "2011-02-07T12:13:33Z"
id: 901472
url: "https://androidstudy.iteye.com/blog/901472"
---

FROM: [http://blog.csdn.net/SkyGray/archive/2010/09/01/5856146.aspx](http://blog.csdn.net/SkyGray/archive/2010/09/01/5856146.aspx)

 很多情况下,我们都需要去修改framework,如添加一些自己的类等.一些情况下可能添加类之后,我们并不需要做太多的工作这个类已经就build到Android.jar中了.但是有些时候,是需要去修改一些编译的mk文件的.

    比如当我们在/framework/base/下添加了一个/test的文件夹,里面有很多我们自己定义的类.如果想要把它build进Android.jar,供其它类使用的话,我们还要去修改

    /build/core/pathmap.mk

 

01. \#
02. # A list of all source roots under frameworks/base, which will be
03. # built into the android.jar.
04. \#
05. # Note - "common" is included here, even though it is also built
06. # into a static library (android-common) for unbundled use.  This
07. # is so common and the other framework libraries can have mutual
08. # interdependencies.
09. \#
10. FRAMEWORKS\_BASE\_SUBDIRS := \\
11. $(addsuffix /java, \\
12. core \\
13. graphics \\
14. location \\
15. media \\
16. opengl \\
17. sax \\
18. telephony \\
19. test \\
20. wifi \\
21. vpn \\
22. keystore \\
23. )