Umesh Krishnaswamy | 355b0e1 | 2012-12-27 20:35:28 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | d=$(dirname $0) |
| 4 | MAIN_CLASS=$1 |
| 5 | LIBRARIES=$2 |
| 6 | [ "${MAIN_CLASS}" ] || { echo "Run 'ant eclipse' to generate Eclipse project files"; exit 1; } |
| 7 | |
| 8 | |
| 9 | cat >$d/.project <<EOF |
| 10 | <?xml version="1.0" encoding="UTF-8"?> |
| 11 | <projectDescription> |
| 12 | <name>floodlight</name> |
| 13 | <comment></comment> |
| 14 | <projects> |
| 15 | </projects> |
| 16 | <buildSpec> |
| 17 | <buildCommand> |
| 18 | <name>org.eclipse.jdt.core.javabuilder</name> |
| 19 | <arguments> |
| 20 | </arguments> |
| 21 | </buildCommand> |
| 22 | </buildSpec> |
| 23 | <natures> |
| 24 | <nature>org.eclipse.jdt.core.javanature</nature> |
| 25 | </natures> |
| 26 | </projectDescription> |
| 27 | EOF |
| 28 | |
| 29 | |
| 30 | cat >$d/.classpath <<EOF |
| 31 | <?xml version="1.0" encoding="UTF-8"?> |
| 32 | <classpath> |
| 33 | <classpathentry kind="src" path="src/main/java" output="target/bin"/> |
| 34 | <classpathentry kind="src" path="src/main/resources"/> |
| 35 | <classpathentry kind="src" path="src/test/java" output="target/bin-test"/> |
| 36 | <classpathentry kind="src" path="lib/gen-java" output="target/bin"/> |
| 37 | EOF |
| 38 | ( |
| 39 | IFS=":" |
| 40 | for l in ${LIBRARIES}; do |
| 41 | cat >>$d/.classpath <<EOF |
| 42 | <classpathentry exported="true" kind="lib" path="$l"/> |
| 43 | EOF |
| 44 | done |
| 45 | ) |
| 46 | cat >>$d/.classpath <<EOF |
| 47 | <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
| 48 | <classpathentry kind="output" path="target/bin"/> |
| 49 | </classpath> |
| 50 | EOF |