blob: a39dc62d692e958b5747c35392e2851a150d306b [file] [log] [blame]
Umesh Krishnaswamy355b0e12012-12-27 20:35:28 -08001#!/bin/bash
2
3d=$(dirname $0)
4MAIN_CLASS=$1
5LIBRARIES=$2
6[ "${MAIN_CLASS}" ] || { echo "Run 'ant eclipse' to generate Eclipse project files"; exit 1; }
7
8
9cat >$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>
27EOF
28
29
30cat >$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"/>
37EOF
38(
39IFS=":"
40for l in ${LIBRARIES}; do
41cat >>$d/.classpath <<EOF
42 <classpathentry exported="true" kind="lib" path="$l"/>
43EOF
44done
45)
46cat >>$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>
50EOF