The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (C) 2008 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | export A_STUBS=out/stubs/a/stubs |
| 18 | export B_STUBS=out/stubs/b/stubs |
| 19 | export EXPECTED_STUBS=out/stubs/expected/stubs |
| 20 | export EXPECTED=$DIR/expected |
| 21 | |
| 22 | function build_stubs() |
| 23 | { |
| 24 | ID=$1 |
| 25 | SRC_DIR=$2 |
| 26 | STUBS_DIR=$3 |
| 27 | |
| 28 | OBJ_DIR=out/stubs/$ID |
| 29 | |
| 30 | rm -rf $OBJ_DIR &> /dev/null |
| 31 | mkdir -p $OBJ_DIR |
| 32 | |
| 33 | find $SRC_DIR -name '*.java' > $OBJ_DIR/javadoc-src-list |
| 34 | ( \ |
| 35 | LD_LIBRARY_PATH=out/host/darwin-x86/lib \ |
| 36 | javadoc \ |
| 37 | \@$OBJ_DIR/javadoc-src-list \ |
| 38 | -J-Xmx512m \ |
| 39 | -J-Djava.library.path=out/host/darwin-x86/lib \ |
| 40 | \ |
| 41 | -quiet \ |
| 42 | -doclet DroidDoc \ |
| 43 | -docletpath out/host/darwin-x86/framework/clearsilver.jar:out/host/darwin-x86/framework/droiddoc.jar \ |
| 44 | -templatedir tools/droiddoc/templates \ |
| 45 | -classpath out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar \ |
| 46 | -sourcepath $SRC_DIR:out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar \ |
| 47 | -d $OBJ_DIR/docs \ |
| 48 | -hdf page.build MAIN-eng.joeo.20080710.121320 -hdf page.now "10 Jul 2008 12:13" \ |
| 49 | -stubs $STUBS_DIR \ |
| 50 | -stubpackages com.android.stubs:com.android.stubs.a:com.android.stubs.b:com.android.stubs.hidden \ |
| 51 | && rm -rf $OBJ_DIR/docs/assets \ |
| 52 | && mkdir -p $OBJ_DIR/docs/assets \ |
| 53 | && cp -fr tools/droiddoc/templates/assets/* $OBJ_DIR/docs/assets/ \ |
| 54 | )# || (rm -rf $OBJ_DIR; exit 45) |
| 55 | } |
| 56 | |
| 57 | function compile_stubs() |
| 58 | { |
| 59 | ID=$1 |
| 60 | STUBS_DIR=$2 |
| 61 | |
| 62 | OBJ_DIR=out/stubs/$ID |
| 63 | CLASS_DIR=$OBJ_DIR/class |
| 64 | mkdir -p $CLASS_DIR |
| 65 | |
| 66 | find $STUBS_DIR -name "*.java" > $OBJ_DIR/java-src-list |
| 67 | javac @$OBJ_DIR/java-src-list -d $CLASS_DIR |
| 68 | } |