diff options
Diffstat (limited to 'recipes-core/ecj/libecj-bootstrap.inc')
| -rw-r--r-- | recipes-core/ecj/libecj-bootstrap.inc | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/recipes-core/ecj/libecj-bootstrap.inc b/recipes-core/ecj/libecj-bootstrap.inc new file mode 100644 index 0000000..e704a87 --- /dev/null +++ b/recipes-core/ecj/libecj-bootstrap.inc | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | # This package compiles and stages only the Jar. | ||
| 2 | |||
| 3 | DESCRIPTION = "JDT Core Batch Compiler - Jar only" | ||
| 4 | HOMEPAGE = "http://www.eclipse.org/" | ||
| 5 | LICENSE = "EPL-1" | ||
| 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/EPL-1;md5=d830412fb40c35122cb4d78375d30f76" | ||
| 7 | |||
| 8 | DEPENDS = "fastjar-native jikes-initial virtual/java-initial" | ||
| 9 | |||
| 10 | inherit native java | ||
| 11 | |||
| 12 | S = "${WORKDIR}" | ||
| 13 | |||
| 14 | JAR = "ecj-bootstrap-${PV}.jar" | ||
| 15 | |||
| 16 | do_unpackpost() { | ||
| 17 | if [ ! -d source ]; then | ||
| 18 | mkdir source | ||
| 19 | fi | ||
| 20 | |||
| 21 | if [ ! -d build ]; then | ||
| 22 | mkdir build | ||
| 23 | fi | ||
| 24 | |||
| 25 | # Remove crap. | ||
| 26 | rm about.html build.xml | ||
| 27 | rm -rf META-INF | ||
| 28 | |||
| 29 | # Move source into separate subdir. | ||
| 30 | mv org source/ | ||
| 31 | |||
| 32 | # Remove stuff unneeded for the bootstrap compiler. | ||
| 33 | rm -rf source/org/eclipse/jdt/internal/compiler/apt | ||
| 34 | rm -rf source/org/eclipse/jdt/internal/compiler/tool | ||
| 35 | rm -rf source/org/eclipse/jdt/internal/antadapter | ||
| 36 | rm source/org/eclipse/jdt/core/JDTCompilerAdapter.java | ||
| 37 | |||
| 38 | # Make a copy of the remaining source to get the embedded | ||
| 39 | # resources. | ||
| 40 | cp -R source/org build/ | ||
| 41 | |||
| 42 | # Remove source code and other stuff. | ||
| 43 | find build -name '*.java' -exec rm -f {} \; | ||
| 44 | find build -name '*.html' -exec rm -f {} \; | ||
| 45 | } | ||
| 46 | |||
| 47 | addtask unpackpost after do_unpack before do_patch | ||
| 48 | |||
| 49 | do_compile() { | ||
| 50 | find source -name '*.java' > sourcefiles | ||
| 51 | split -l 25 sourcefiles ecj-sources. | ||
| 52 | |||
| 53 | # Compiling in place is done because the sources contain | ||
| 54 | # property files which need to be available at runtime. | ||
| 55 | for list in `find . -name 'ecj-sources.*'`; do | ||
| 56 | echo "building files in $list ..."; | ||
| 57 | echo jikes-initial -d build -source 1.4 -sourcepath source `cat $list`; | ||
| 58 | jikes-initial \ | ||
| 59 | -d build -source 1.4 -sourcepath source `cat $list`; | ||
| 60 | done | ||
| 61 | |||
| 62 | fastjar -c -C build . -f ${JAR} | ||
| 63 | } | ||
| 64 | |||
| 65 | do_install() { | ||
| 66 | oe_jarinstall ${JAR} ecj-bootstrap.jar | ||
| 67 | } | ||
| 68 | |||
