buildr-iidea 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG ADDED
@@ -0,0 +1,3 @@
1
+ 0.0.4 (May 29, 2010)
2
+ * Added: Ability to disable ipr generation using project.no_ipr
3
+ * Added: Documented the ability to disable the generation of iml files via project.no_iml
data/README.rdoc CHANGED
@@ -89,6 +89,24 @@ Will generate:
89
89
  foo-suffix2.iml
90
90
  bar/bar-suffix2.iml
91
91
 
92
+ === Disabling project file generation
93
+
94
+ The extension will not generate an iml file for a project if the "project.no_iml" method
95
+ is invoked. Generation of ipr files can be disabled by invoking the method "project.no_ipr".
96
+
97
+ ==== Example
98
+
99
+ define "foo" do
100
+ project.no_ipr
101
+ define "bar" do
102
+ project.no_iml
103
+ end
104
+ end
105
+
106
+ Will generate:
107
+
108
+ foo.iml
109
+
92
110
  === VCS Integration
93
111
 
94
112
  The extension will attempt to guess the VCS type of the project by looking for a .svn
data/buildr-iidea.gemspec CHANGED
@@ -12,11 +12,11 @@ settings of each project and extension specific settings.
12
12
  TEXT
13
13
 
14
14
  spec.files = Dir['{lib,spec}/**/*', '*.gemspec'] +
15
- ['LICENSE', 'NOTICE', 'README.rdoc', 'Rakefile']
15
+ ['LICENSE', 'NOTICE', 'README.rdoc', 'CHANGELOG', 'Rakefile']
16
16
  spec.require_paths = ['lib']
17
17
 
18
18
  spec.has_rdoc = true
19
- spec.extra_rdoc_files = 'README.rdoc', 'LICENSE', 'NOTICE'
19
+ spec.extra_rdoc_files = 'README.rdoc', 'LICENSE', 'NOTICE', 'CHANGELOG'
20
20
  spec.rdoc_options = '--title', "#{spec.name} #{spec.version}", '--main', 'README.rdoc'
21
21
 
22
22
  spec.post_install_message = "Thanks for installing the Intellij IDEA extension for Buildr"
@@ -44,7 +44,8 @@ module Buildr
44
44
 
45
45
  def initial_components
46
46
  [
47
- lambda { project_root_manager_component }
47
+ lambda { project_root_manager_component },
48
+ lambda { project_details_component }
48
49
  ]
49
50
  end
50
51
 
@@ -60,6 +61,12 @@ module Buildr
60
61
  end
61
62
  end
62
63
 
64
+ def project_details_component
65
+ create_component("ProjectDetails") do |xml|
66
+ xml.option("name" => "projectName", "value" => self.name )
67
+ end
68
+ end
69
+
63
70
  def modules_component
64
71
  create_component("ProjectModuleManager") do |xml|
65
72
  xml.modules do
@@ -12,6 +12,13 @@ module Buildr
12
12
 
13
13
  desc "Delete the generated Intellij IDEA artifacts"
14
14
  Project.local_task "iidea:clean"
15
+
16
+ # Remove the old idea tasks if they exist. Either could depending on the names
17
+ # selected for the IDEA project files by iidea extension and thus have been removed.
18
+ task_list = Rake.application.instance_variable_get('@tasks')
19
+ task_list.delete("idea")
20
+ task_list.delete("idea7x")
21
+ task_list.delete("idea7x:clean")
15
22
  end
16
23
 
17
24
  before_define do |project|
@@ -20,13 +27,6 @@ module Buildr
20
27
  end
21
28
 
22
29
  after_define do |project|
23
- # Remove the old idea tasks if they exist. Either could depending on the names
24
- # selected for the IDEA project files by iidea extension and thus have been removed.
25
- task_list = Rake.application.instance_variable_get('@tasks')
26
- task_list.delete("idea")
27
- task_list.delete("idea7x")
28
- task_list.delete("idea7x:clean")
29
-
30
30
  iidea = project.task("iidea:generate")
31
31
 
32
32
  files = [
@@ -68,7 +68,7 @@ module Buildr
68
68
  end
69
69
 
70
70
  def ipr?
71
- self.parent.nil?
71
+ !@no_ipr && self.parent.nil?
72
72
  end
73
73
 
74
74
  def iml
@@ -83,6 +83,10 @@ module Buildr
83
83
  end
84
84
  end
85
85
 
86
+ def no_ipr
87
+ @no_ipr = true
88
+ end
89
+
86
90
  def no_iml
87
91
  @has_iml = false
88
92
  end
@@ -51,6 +51,23 @@ describe "iidea:generate" do
51
51
  end
52
52
  end
53
53
 
54
+ describe "with ipr generation disabled" do
55
+ before do
56
+ @foo = define "foo" do
57
+ project.no_ipr
58
+ end
59
+ invoke_generate_task
60
+ end
61
+
62
+ it "generates a single IML" do
63
+ Dir[@foo._("**/*.iml")].should have(1).entry
64
+ end
65
+
66
+ it "generate no IPR" do
67
+ File.should_not be_exist(@foo._("foo.ipr"))
68
+ end
69
+ end
70
+
54
71
  describe "and id overrides" do
55
72
  before do
56
73
  @foo = define "foo" do
@@ -15,6 +15,11 @@ describe "iidea:generate" do
15
15
  xml_document(@foo._("foo.ipr")).
16
16
  should have_xpath("/project/component[@name='ProjectRootManager' and @project-jdk-name = '1.5' and @languageLevel = 'JDK_1_5']")
17
17
  end
18
+
19
+ it "generates a ProjectDetails component with the projectName option set" do
20
+ xml_document(@foo._("foo.ipr")).
21
+ should have_xpath("/project/component[@name='ProjectDetails']/option[@name = 'projectName' and @value = 'foo']")
22
+ end
18
23
  end
19
24
 
20
25
  describe "with compile.options.source = '1.6'" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Rhett Sutphin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-09 00:00:00 +10:00
18
+ date: 2010-05-29 00:00:00 +10:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -35,6 +35,7 @@ extra_rdoc_files:
35
35
  - README.rdoc
36
36
  - LICENSE
37
37
  - NOTICE
38
+ - CHANGELOG
38
39
  files:
39
40
  - lib/buildr_iidea.rb
40
41
  - lib/buildr/intellij_idea/idea_project.rb
@@ -59,6 +60,7 @@ files:
59
60
  - LICENSE
60
61
  - NOTICE
61
62
  - README.rdoc
63
+ - CHANGELOG
62
64
  - Rakefile
63
65
  has_rdoc: true
64
66
  homepage: http://github.com/realityforge/buildr-iidea
@@ -67,7 +69,7 @@ licenses: []
67
69
  post_install_message: Thanks for installing the Intellij IDEA extension for Buildr
68
70
  rdoc_options:
69
71
  - --title
70
- - buildr-iidea 0.0.3
72
+ - buildr-iidea 0.0.4
71
73
  - --main
72
74
  - README.rdoc
73
75
  require_paths: