blob: 68ce918981eab7b2233bc82f3dd0a4fef896d7bc [file] [log] [blame]
Damien Martin-Guillerezbd6d60b2015-03-13 15:21:26 +00001#!/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
22set -eu
23
24cd $(dirname "$0")
25cd ..
26
27# Simply creates a Eclipse java project
28if [ ! -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>
47EOF
48fi
49
50./scripts/generate-classpath.sh >.classpath
51
52echo
53echo '***'
54echo '*** Eclipse project generated'
55echo '***'
56echo
57echo 'You can now import the bazel project into Eclipse.'