diff options
Diffstat (limited to 'recipes-core/jakarta-commons/jakarta-commons.inc')
-rw-r--r-- | recipes-core/jakarta-commons/jakarta-commons.inc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes-core/jakarta-commons/jakarta-commons.inc b/recipes-core/jakarta-commons/jakarta-commons.inc new file mode 100644 index 0000000..3ee081e --- /dev/null +++ b/recipes-core/jakarta-commons/jakarta-commons.inc | |||
@@ -0,0 +1,60 @@ | |||
1 | LICENSE = "AL2.0" | ||
2 | AUTHOR = "Apache Software Foundation" | ||
3 | |||
4 | inherit java-library | ||
5 | |||
6 | S = "${WORKDIR}/${BP}-src" | ||
7 | |||
8 | # Directory in which the projects sources are located. | ||
9 | MAINSOURCES = "src/java" | ||
10 | |||
11 | # Directories which should appear in the -sourcepath argument. | ||
12 | COMPILE_SOURCEPATH = "src/java" | ||
13 | |||
14 | COMPILE_FINDARGS = "-name '*.java'" | ||
15 | FINDARGS = "-name '*.properties'" | ||
16 | |||
17 | # Directories to be removed after compilation. | ||
18 | CLEAN_PATH = "" | ||
19 | |||
20 | # Some projects have a replaceable version number in their manifest template. | ||
21 | do_unpackpost() { | ||
22 | if [ -d src/conf ] | ||
23 | then | ||
24 | find src/conf -exec \ | ||
25 | sed -i -e "s|@version@|${PV}|" {} \; | ||
26 | fi | ||
27 | } | ||
28 | |||
29 | addtask unpackpost after do_unpack before do_patch | ||
30 | # Compile step is very similar for Jakarta commons packages | ||
31 | do_compile() { | ||
32 | mkdir -p build | ||
33 | |||
34 | if [ "${CP}" ] | ||
35 | then | ||
36 | oe_makeclasspath cp -s ${CP} | ||
37 | else | ||
38 | cp=. | ||
39 | fi | ||
40 | |||
41 | echo "javac -sourcepath ${COMPILE_SOURCEPATH} -cp $cp -d build \`find ${MAINSOURCES} ${COMPILE_FINDARGS}\`" | ||
42 | javac -sourcepath ${COMPILE_SOURCEPATH} -cp $cp -d build `find ${MAINSOURCES} ${COMPILE_FINDARGS}` | ||
43 | |||
44 | # Copy extraneous files | ||
45 | echo "(cd ${MAINSOURCES} && find . ${FINDARGS} -exec cp {} ../../build/{} \;)" | ||
46 | (cd ${MAINSOURCES} && find . ${FINDARGS} -exec cp {} ../../build/{} \;) | ||
47 | |||
48 | # Optionally remove stuff after compilation (needed for sourcepath hacks). | ||
49 | if [ ${CLEAN_PATH} ]; then | ||
50 | rm -rf ${CLEAN_PATH} | ||
51 | fi | ||
52 | |||
53 | # Some projects have manifest, some have not. This works for both. | ||
54 | if [ -f src/conf/MANIFEST.MF ] | ||
55 | then | ||
56 | fastjar -C build -c -m src/conf/MANIFEST.MF -f ${JARFILENAME} . | ||
57 | else | ||
58 | fastjar -C build -c -f ${JARFILENAME} . | ||
59 | fi | ||
60 | } | ||