As mentioned by Morrison Chang, there currently isn't any way to release an android library project as a jar, nor is there any way to obfuscate the project with the exception of the java source. However, there is a way to obfuscate the source code, although this is not officially supported.
All you need to do is run the "ant clean release" command in your library. The obfuscated source is written into "bin/proguard/obfuscated.jar". Just put that jar file in the libs directory of your exported library project, and delete the contents of the src directory, and your pretty much done.
There is one gotcha with the above approach, however. It doesn't handle resources quite right. To fix this, you should strip out all the resource classes (R.class and R$*.class) from your copy of obfuscated.jar. This in turn will require you to disable obfuscation for these resource classes. This can be done by adding the following to proguard-project.txt:
-keep public class **.R {
public *;
}
-keep public class **.R$* {
public *;
}
For your reference, here is the ant target I use to build an obfuscated, sourceless android library project:
<?xml version="1.0" encoding="UTF-8"?>
<project name="library_rules" default="librelease">
<target name="librelease" depends="release"
description="Build a sourceless and obfuscated android library.">
<property name="libname" value="myProject" />
<property name="librelease.dir" location="bin/${libname}" />
<delete file="${librelease.dir}"/>
<mkdir dir="${librelease.dir}"/>
<mkdir dir="${librelease.dir}/libs"/>
<mkdir dir="${librelease.dir}/src"/>
<copy todir="${librelease.dir}/res">
<fileset dir="res"/>
</copy>
<copy file="AndroidManifest.xml" todir="${librelease.dir}" />
<copy file="ant.properties" todir="${librelease.dir}" />
<copy file="build.xml" todir="${librelease.dir}" />
<copy file="project.properties" tofile="${librelease.dir}/project.properties" />
<jar destfile="${librelease.dir}/libs/${libname}.jar">
<zipfileset src="bin/proguard/obfuscated.jar" excludes="**/R.class,**/R$$*.class"/>
</jar>
</target>
</project>
The android library project to be exported will be located in bin/myProject. This has been tested using Android SDK tools v20.0.3 and v21.