Damien Martin-Guillerez | bd6d60b | 2015-03-13 15:21:26 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2015 Google Inc. All rights reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | # Generates an Eclipse project. If a .project is not present, it will creates |
| 17 | # it and it will overwrite any .classpath file present |
| 18 | # |
| 19 | # Usage: ./setup-eclipse.sh |
| 20 | # |
| 21 | |
| 22 | set -eu |
| 23 | |
| 24 | cd $(dirname "$0") |
| 25 | cd .. |
| 26 | |
| 27 | # Simply creates a Eclipse java project |
| 28 | if [ ! -f ".project" ]; then |
| 29 | cat >.project <<'EOF' |
| 30 | <?xml version="1.0" encoding="UTF-8"?> |
| 31 | <projectDescription> |
| 32 | <name>bazel</name> |
| 33 | <comment></comment> |
| 34 | <projects> |
| 35 | </projects> |
| 36 | <buildSpec> |
| 37 | <buildCommand> |
| 38 | <name>org.eclipse.jdt.core.javabuilder</name> |
| 39 | <arguments> |
| 40 | </arguments> |
| 41 | </buildCommand> |
| 42 | </buildSpec> |
| 43 | <natures> |
| 44 | <nature>org.eclipse.jdt.core.javanature</nature> |
| 45 | </natures> |
| 46 | </projectDescription> |
| 47 | EOF |
| 48 | fi |
| 49 | |
| 50 | ./scripts/generate-classpath.sh >.classpath |
| 51 | |
| 52 | echo |
| 53 | echo '***' |
| 54 | echo '*** Eclipse project generated' |
| 55 | echo '***' |
| 56 | echo |
| 57 | echo 'You can now import the bazel project into Eclipse.' |