Buildr C0 Coverage Information - RCov

lib/buildr/ide/eclipse/plugin.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/buildr/ide/eclipse/plugin.rb 71 43
22.54%
27.91%

Key

Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.

Coverage Details

1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements.  See the NOTICE file distributed with this
3 # work for additional information regarding copyright ownership.  The ASF
4 # licenses this file to you under the Apache License, Version 2.0 (the
5 # "License"); 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, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
13 # License for the specific language governing permissions and limitations under
14 # the License.
15 
16 
17 require 'buildr/core/project'
18 require 'buildr/core/common'
19 
20 module Buildr
21   module Eclipse
22     module Plugin
23       include Extension
24 
25       NATURE    = 'org.eclipse.pde.PluginNature'
26       CONTAINER = 'org.eclipse.pde.core.requiredPlugins'
27       BUILDERS   = ['org.eclipse.pde.ManifestBuilder', 'org.eclipse.pde.SchemaBuilder']
28 
29       after_define do |project|
30         eclipse = project.eclipse
31 
32         # smart defaults
33         if eclipse.natures.empty? && (
34             (File.exists? project.path_to("plugin.xml")) ||
35             (File.exists? project.path_to("OSGI-INF")) ||
36             (File.exists?(project.path_to("META-INF/MANIFEST.MF")) && File.read(project.path_to("META-INF/MANIFEST.MF")).match(/^Bundle-SymbolicName:/)))
37           eclipse.natures = [NATURE, Buildr::Eclipse::Java::NATURE]
38           eclipse.classpath_containers = [CONTAINER, Buildr::Eclipse::Java::CONTAINER] if eclipse.classpath_containers.empty?
39           eclipse.builders = BUILDERS + [Buildr::Eclipse::Java::BUILDER] if eclipse.builders.empty?
40         end
41 
42         # :plugin nature explicitly set
43         if eclipse.natures.include? :plugin
44           unless eclipse.natures.include? NATURE
45             # plugin nature must be before java nature
46             eclipse.natures += [Buildr::Eclipse::Java::NATURE] unless eclipse.natures.include? Buildr::Eclipse::Java::NATURE
47             index = eclipse.natures.index(Buildr::Eclipse::Java::NATURE) || -1
48             eclipse.natures = eclipse.natures.insert(index, NATURE)
49           end
50           unless eclipse.classpath_containers.include? CONTAINER
51             # plugin container must be before java container
52             index = eclipse.classpath_containers.index(Buildr::Eclipse::Java::CONTAINER) || -1
53             eclipse.classpath_containers = eclipse.classpath_containers.insert(index, CONTAINER)
54           end
55           unless (eclipse.builders.include?(BUILDERS[0]) && eclipse.builders.include?(BUILDERS[1]))
56             # plugin builder must be before java builder
57             index = eclipse.classpath_containers.index(Buildr::Eclipse::Java::BUILDER) || -1
58             eclipse.builders = eclipse.builders.insert(index, BUILDERS[1]) unless eclipse.builders.include? BUILDERS[1]
59             index = eclipse.classpath_containers.index(BUILDERS[1]) || -1
60             eclipse.builders = eclipse.builders.insert(index, BUILDERS[0]) unless eclipse.builders.include? BUILDERS[0]
61           end
62         end
63       end
64 
65     end
66   end
67 end
68 
69 class Buildr::Project
70   include Buildr::Eclipse::Plugin
71 end

Generated on 2011-07-06 23:35:37 -0700 with rcov 0.9.8