1 NAME=javax.inject 2 VERSION=SNAPSHOT 3 4 # Clear and recreate build directory. 5 rm -r build 6 mkdir -p build/classes 7 mkdir -p build/tck 8 mkdir -p build/dist 9 mkdir -p build/tck/classes 10 mkdir -p build/tck/dist 11 12 # Compile classes. 13 javac -g -d build/classes `find src -name *.java` 14 javac -g -classpath build/classes:lib/junit.jar -d build/tck/classes \ 15 `find tck -name *.java` 16 17 FOOTER="<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>\ 18 The JSR-330 Expert Group</a>. \ 19 Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache \ 20 License</a>, Version 2.0.</font>" 21 22 # Generate Javadocs. 23 javadoc -protected -bottom "$FOOTER" \ 24 -header "<font color='red'><b>This is a DRAFT specification.</b></font>" \ 25 -sourcepath src -d build/javadoc javax.inject 26 javadoc -classpath build/classes:lib/junit.jar -protected -bottom "$FOOTER" \ 27 -sourcepath tck -d build/tck/javadoc org.atinject.tck \ 28 org.atinject.tck.auto org.atinject.tck.auto.accessories 29 30 # Generate jars. 31 cp -R src build 32 cp -R tck build/tck/src 33 34 rmSvn() { 35 find $1 -name .svn -type d | xargs rm -r 36 } 37 38 rmSvn build/src 39 rmSvn build/tck/src 40 rm build/tck/src/tck.iml 41 42 jar cfM build/dist/$NAME-src.zip -C build/src . 43 jar cfM build/tck/dist/$NAME-tck-src.zip -C build/tck/src . 44 45 jar cfM build/dist/$NAME-javadoc.zip -C build/javadoc . 46 jar cfM build/tck/dist/$NAME-tck-javadoc.zip -C build/tck/javadoc . 47 jar cfM build/dist/$NAME.jar -C build/classes . 48 jar cfM build/tck/dist/$NAME-tck.jar -C build/tck/classes . 49 50 jar cfM build/$NAME.zip -C build/dist . 51 jar cfM build/$NAME-tck.zip -C build/tck/dist . 52 53 # Build Maven bundle. 54 mkdir build/maven 55 cp build/dist/$NAME.jar build/maven/$NAME-$VERSION.jar 56 cp build/dist/$NAME-src.zip build/maven/$NAME-$VERSION-sources.jar 57 cp build/dist/$NAME-javadoc.zip build/maven/$NAME-$VERSION-javadoc.jar 58 cp pom.xml build/maven 59 jar cfM build/$NAME-$VERSION-bundle.jar -C build/maven . 60