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