buildr-iidea 0.0.9 → 0.0.10
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 +38 -33
- data/LICENSE +203 -203
- data/NOTICE +16 -16
- data/README.rdoc +328 -328
- data/Rakefile +42 -33
- data/buildr-iidea.gemspec +25 -25
- data/lib/buildr/intellij_idea/idea_file.rb +85 -85
- data/lib/buildr/intellij_idea/idea_module.rb +255 -263
- data/lib/buildr/intellij_idea/idea_project.rb +105 -105
- data/lib/buildr/intellij_idea/project_extension.rb +108 -108
- data/lib/buildr/intellij_idea/version.rb +10 -10
- data/lib/buildr_iidea.rb +6 -6
- data/spec/buildr/intellij_idea/clean_spec.rb +37 -37
- data/spec/buildr/intellij_idea/dependency_spec.rb +115 -115
- data/spec/buildr/intellij_idea/extra_modules_spec.rb +24 -24
- data/spec/buildr/intellij_idea/facet_generation_spec.rb +36 -36
- data/spec/buildr/intellij_idea/group_spec.rb +33 -33
- data/spec/buildr/intellij_idea/idea_file_generation_spec.rb +243 -243
- data/spec/buildr/intellij_idea/inform_spec.rb +28 -28
- data/spec/buildr/intellij_idea/initial_components_spec.rb +38 -38
- data/spec/buildr/intellij_idea/module_content_generation_spec.rb +96 -96
- data/spec/buildr/intellij_idea/module_defaults.rb +15 -15
- data/spec/buildr/intellij_idea/module_property_inheritance_spec.rb +27 -27
- data/spec/buildr/intellij_idea/project_extension_spec.rb +96 -96
- data/spec/buildr/intellij_idea/template_spec.rb +233 -233
- data/spec/spec_helper.rb +79 -72
- data/spec/xpath_matchers.rb +108 -108
- metadata +15 -16
- data/spec/spec.opts +0 -1
@@ -1,28 +1,28 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "iidea:generate" do
|
4
|
-
describe "with a single project definition" do
|
5
|
-
before do
|
6
|
-
@foo = define "foo"
|
7
|
-
end
|
8
|
-
|
9
|
-
it "informs the user about generating IPR" do
|
10
|
-
lambda { invoke_generate_task }.should show_info(/Writing (.+)\/foo\.ipr/)
|
11
|
-
end
|
12
|
-
|
13
|
-
it "informs the user about generating IML" do
|
14
|
-
lambda { invoke_generate_task }.should show_info(/Writing (.+)\/foo\.iml/)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
describe "with a subproject" do
|
18
|
-
before do
|
19
|
-
@foo = define "foo" do
|
20
|
-
define 'bar'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
it "informs the user about generating subporoject IML" do
|
25
|
-
lambda { invoke_generate_task }.should show_info(/Writing (.+)\/bar\/bar\.iml/)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "iidea:generate" do
|
4
|
+
describe "with a single project definition" do
|
5
|
+
before do
|
6
|
+
@foo = define "foo"
|
7
|
+
end
|
8
|
+
|
9
|
+
it "informs the user about generating IPR" do
|
10
|
+
lambda { invoke_generate_task }.should show_info(/Writing (.+)\/foo\.ipr/)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "informs the user about generating IML" do
|
14
|
+
lambda { invoke_generate_task }.should show_info(/Writing (.+)\/foo\.iml/)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
describe "with a subproject" do
|
18
|
+
before do
|
19
|
+
@foo = define "foo" do
|
20
|
+
define 'bar'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "informs the user about generating subporoject IML" do
|
25
|
+
lambda { invoke_generate_task }.should show_info(/Writing (.+)\/bar\/bar\.iml/)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,38 +1,38 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "iidea:generate" do
|
4
|
-
describe "with compile.options.source = '1.6'" do
|
5
|
-
|
6
|
-
before do
|
7
|
-
@foo = define "foo" do
|
8
|
-
compile.options.source = '1.5'
|
9
|
-
end
|
10
|
-
invoke_generate_task
|
11
|
-
end
|
12
|
-
|
13
|
-
it "generate an ProjectRootManager with 1.5 jdk specified" do
|
14
|
-
#raise File.read(@foo._("foo.ipr"))
|
15
|
-
xml_document(@foo._("foo.ipr")).
|
16
|
-
should have_xpath("/project/component[@name='ProjectRootManager' and @project-jdk-name = '1.5' and @languageLevel = 'JDK_1_5']")
|
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
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "with compile.options.source = '1.6'" do
|
26
|
-
before do
|
27
|
-
@foo = define "foo" do
|
28
|
-
compile.options.source = '1.6'
|
29
|
-
end
|
30
|
-
invoke_generate_task
|
31
|
-
end
|
32
|
-
|
33
|
-
it "generate an ProjectRootManager with 1.6 jdk specified" do
|
34
|
-
xml_document(@foo._("foo.ipr")).
|
35
|
-
should have_xpath("/project/component[@name='ProjectRootManager' and @project-jdk-name = '1.6' and @languageLevel = 'JDK_1_6']")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "iidea:generate" do
|
4
|
+
describe "with compile.options.source = '1.6'" do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@foo = define "foo" do
|
8
|
+
compile.options.source = '1.5'
|
9
|
+
end
|
10
|
+
invoke_generate_task
|
11
|
+
end
|
12
|
+
|
13
|
+
it "generate an ProjectRootManager with 1.5 jdk specified" do
|
14
|
+
#raise File.read(@foo._("foo.ipr"))
|
15
|
+
xml_document(@foo._("foo.ipr")).
|
16
|
+
should have_xpath("/project/component[@name='ProjectRootManager' and @project-jdk-name = '1.5' and @languageLevel = 'JDK_1_5']")
|
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
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "with compile.options.source = '1.6'" do
|
26
|
+
before do
|
27
|
+
@foo = define "foo" do
|
28
|
+
compile.options.source = '1.6'
|
29
|
+
end
|
30
|
+
invoke_generate_task
|
31
|
+
end
|
32
|
+
|
33
|
+
it "generate an ProjectRootManager with 1.6 jdk specified" do
|
34
|
+
xml_document(@foo._("foo.ipr")).
|
35
|
+
should have_xpath("/project/component[@name='ProjectRootManager' and @project-jdk-name = '1.6' and @languageLevel = 'JDK_1_6']")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -1,96 +1,96 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "iidea:generate" do
|
4
|
-
describe "with iml.skip_content! specified" do
|
5
|
-
before do
|
6
|
-
@foo = define "foo" do
|
7
|
-
iml.skip_content!
|
8
|
-
end
|
9
|
-
invoke_generate_task
|
10
|
-
end
|
11
|
-
|
12
|
-
it "generate an IML with no content section" do
|
13
|
-
doc = xml_document(@foo._(root_module_filename(@foo)))
|
14
|
-
doc.should_not have_xpath("/module/component[@name='NewModuleRootManager']/content")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "with iml.skip_content! not specified and standard layout" do
|
19
|
-
before do
|
20
|
-
@foo = define "foo" do
|
21
|
-
end
|
22
|
-
invoke_generate_task
|
23
|
-
end
|
24
|
-
|
25
|
-
it "generate an IML with content section" do
|
26
|
-
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content")
|
27
|
-
end
|
28
|
-
|
29
|
-
it "generate an exclude in content section for reports" do
|
30
|
-
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/reports']")
|
31
|
-
end
|
32
|
-
|
33
|
-
it "generate an exclude in content section for target" do
|
34
|
-
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/target']")
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe "with subprojects" do
|
39
|
-
before do
|
40
|
-
@foo = define "foo" do
|
41
|
-
define "bar" do
|
42
|
-
compile.from _(:source, :main, :bar)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
invoke_generate_task
|
46
|
-
@bar_doc = xml_document(project('foo:bar')._('bar.iml'))
|
47
|
-
end
|
48
|
-
|
49
|
-
it "generates the correct source directories" do
|
50
|
-
@bar_doc.should have_xpath("//content/sourceFolder[@url='file://$MODULE_DIR$/src/main/bar']")
|
51
|
-
end
|
52
|
-
|
53
|
-
it "generates the correct exclude directories" do
|
54
|
-
@bar_doc.should have_xpath("//content/excludeFolder[@url='file://$MODULE_DIR$/target']")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe "with report dir outside content" do
|
59
|
-
before do
|
60
|
-
layout = Layout::Default.new
|
61
|
-
layout[:reports] = "../reports"
|
62
|
-
|
63
|
-
@foo = define "foo", :layout => layout do
|
64
|
-
end
|
65
|
-
invoke_generate_task
|
66
|
-
end
|
67
|
-
|
68
|
-
it "generate an exclude in content section for target" do
|
69
|
-
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/target']")
|
70
|
-
end
|
71
|
-
|
72
|
-
it "generates an content section without an exclude for report dir" do
|
73
|
-
root_module_xml(@foo).should have_nodes("/module/component[@name='NewModuleRootManager']/content/excludeFolder", 1)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
describe "with target dir outside content" do
|
78
|
-
before do
|
79
|
-
layout = Layout::Default.new
|
80
|
-
layout[:target] = "../target"
|
81
|
-
layout[:target, :main] = "../target"
|
82
|
-
|
83
|
-
@foo = define "foo", :layout => layout do
|
84
|
-
end
|
85
|
-
invoke_generate_task
|
86
|
-
end
|
87
|
-
|
88
|
-
it "generate an exclude in content section for reports" do
|
89
|
-
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/reports']")
|
90
|
-
end
|
91
|
-
|
92
|
-
it "generates an content section without an exclude for target dir" do
|
93
|
-
root_module_xml(@foo).should have_nodes("/module/component[@name='NewModuleRootManager']/content/excludeFolder", 1)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "iidea:generate" do
|
4
|
+
describe "with iml.skip_content! specified" do
|
5
|
+
before do
|
6
|
+
@foo = define "foo" do
|
7
|
+
iml.skip_content!
|
8
|
+
end
|
9
|
+
invoke_generate_task
|
10
|
+
end
|
11
|
+
|
12
|
+
it "generate an IML with no content section" do
|
13
|
+
doc = xml_document(@foo._(root_module_filename(@foo)))
|
14
|
+
doc.should_not have_xpath("/module/component[@name='NewModuleRootManager']/content")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "with iml.skip_content! not specified and standard layout" do
|
19
|
+
before do
|
20
|
+
@foo = define "foo" do
|
21
|
+
end
|
22
|
+
invoke_generate_task
|
23
|
+
end
|
24
|
+
|
25
|
+
it "generate an IML with content section" do
|
26
|
+
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content")
|
27
|
+
end
|
28
|
+
|
29
|
+
it "generate an exclude in content section for reports" do
|
30
|
+
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/reports']")
|
31
|
+
end
|
32
|
+
|
33
|
+
it "generate an exclude in content section for target" do
|
34
|
+
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/target']")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "with subprojects" do
|
39
|
+
before do
|
40
|
+
@foo = define "foo" do
|
41
|
+
define "bar" do
|
42
|
+
compile.from _(:source, :main, :bar)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
invoke_generate_task
|
46
|
+
@bar_doc = xml_document(project('foo:bar')._('bar.iml'))
|
47
|
+
end
|
48
|
+
|
49
|
+
it "generates the correct source directories" do
|
50
|
+
@bar_doc.should have_xpath("//content/sourceFolder[@url='file://$MODULE_DIR$/src/main/bar']")
|
51
|
+
end
|
52
|
+
|
53
|
+
it "generates the correct exclude directories" do
|
54
|
+
@bar_doc.should have_xpath("//content/excludeFolder[@url='file://$MODULE_DIR$/target']")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe "with report dir outside content" do
|
59
|
+
before do
|
60
|
+
layout = Layout::Default.new
|
61
|
+
layout[:reports] = "../reports"
|
62
|
+
|
63
|
+
@foo = define "foo", :layout => layout do
|
64
|
+
end
|
65
|
+
invoke_generate_task
|
66
|
+
end
|
67
|
+
|
68
|
+
it "generate an exclude in content section for target" do
|
69
|
+
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/target']")
|
70
|
+
end
|
71
|
+
|
72
|
+
it "generates an content section without an exclude for report dir" do
|
73
|
+
root_module_xml(@foo).should have_nodes("/module/component[@name='NewModuleRootManager']/content/excludeFolder", 1)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe "with target dir outside content" do
|
78
|
+
before do
|
79
|
+
layout = Layout::Default.new
|
80
|
+
layout[:target] = "../target"
|
81
|
+
layout[:target, :main] = "../target"
|
82
|
+
|
83
|
+
@foo = define "foo", :layout => layout do
|
84
|
+
end
|
85
|
+
invoke_generate_task
|
86
|
+
end
|
87
|
+
|
88
|
+
it "generate an exclude in content section for reports" do
|
89
|
+
root_module_xml(@foo).should have_xpath("/module/component[@name='NewModuleRootManager']/content/excludeFolder[@url='file://$MODULE_DIR$/reports']")
|
90
|
+
end
|
91
|
+
|
92
|
+
it "generates an content section without an exclude for target dir" do
|
93
|
+
root_module_xml(@foo).should have_nodes("/module/component[@name='NewModuleRootManager']/content/excludeFolder", 1)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "Buildr::IntellijIdea::IdeaModule" do
|
4
|
-
before do
|
5
|
-
@foo = define "foo"
|
6
|
-
end
|
7
|
-
|
8
|
-
it "has correct default iml.type setting" do
|
9
|
-
@foo.iml.type.should == "JAVA_MODULE"
|
10
|
-
end
|
11
|
-
|
12
|
-
it "has correct default iml.local_repository_env_override setting" do
|
13
|
-
@foo.iml.local_repository_env_override.should == "MAVEN_REPOSITORY"
|
14
|
-
end
|
15
|
-
end
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "Buildr::IntellijIdea::IdeaModule" do
|
4
|
+
before do
|
5
|
+
@foo = define "foo"
|
6
|
+
end
|
7
|
+
|
8
|
+
it "has correct default iml.type setting" do
|
9
|
+
@foo.iml.type.should == "JAVA_MODULE"
|
10
|
+
end
|
11
|
+
|
12
|
+
it "has correct default iml.local_repository_env_override setting" do
|
13
|
+
@foo.iml.local_repository_env_override.should == "MAVEN_REPOSITORY"
|
14
|
+
end
|
15
|
+
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "Buildr::IntellijIdea::IdeaModule" do
|
4
|
-
describe "settings inherited in subprojects" do
|
5
|
-
before do
|
6
|
-
mkdir_p 'bar'
|
7
|
-
@foo = define "foo" do
|
8
|
-
iml.type = "FOO_MODULE_TYPE"
|
9
|
-
define 'bar'
|
10
|
-
end
|
11
|
-
invoke_generate_task
|
12
|
-
end
|
13
|
-
|
14
|
-
it "generates root IML with specified type" do
|
15
|
-
module_file = root_module_filename(@foo)
|
16
|
-
File.should be_exist(module_file)
|
17
|
-
File.read(module_file).should =~ /FOO_MODULE_TYPE/
|
18
|
-
end
|
19
|
-
|
20
|
-
it "generates subproject IML with inherited type" do
|
21
|
-
module_file = subproject_module_filename(@foo, "bar")
|
22
|
-
File.should be_exist(module_file)
|
23
|
-
File.read(module_file).should =~ /FOO_MODULE_TYPE/
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "Buildr::IntellijIdea::IdeaModule" do
|
4
|
+
describe "settings inherited in subprojects" do
|
5
|
+
before do
|
6
|
+
mkdir_p 'bar'
|
7
|
+
@foo = define "foo" do
|
8
|
+
iml.type = "FOO_MODULE_TYPE"
|
9
|
+
define 'bar'
|
10
|
+
end
|
11
|
+
invoke_generate_task
|
12
|
+
end
|
13
|
+
|
14
|
+
it "generates root IML with specified type" do
|
15
|
+
module_file = root_module_filename(@foo)
|
16
|
+
File.should be_exist(module_file)
|
17
|
+
File.read(module_file).should =~ /FOO_MODULE_TYPE/
|
18
|
+
end
|
19
|
+
|
20
|
+
it "generates subproject IML with inherited type" do
|
21
|
+
module_file = subproject_module_filename(@foo, "bar")
|
22
|
+
File.should be_exist(module_file)
|
23
|
+
File.read(module_file).should =~ /FOO_MODULE_TYPE/
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -1,96 +1,96 @@
|
|
1
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "project extension" do
|
4
|
-
it "provides an 'iidea:generate' task" do
|
5
|
-
Rake::Task.tasks.detect{|task| task.to_s == "iidea:generate"}.should_not be_nil
|
6
|
-
end
|
7
|
-
|
8
|
-
it "documents the 'iidea:generate' task" do
|
9
|
-
Rake::Task.tasks.detect{|task| task.to_s == "iidea:generate"}.comment.should_not be_nil
|
10
|
-
end
|
11
|
-
|
12
|
-
it "provides an 'iidea:clean' task" do
|
13
|
-
Rake::Task.tasks.detect{|task| task.to_s == "iidea:clean"}.should_not be_nil
|
14
|
-
end
|
15
|
-
|
16
|
-
it "documents the 'iidea:clean' task" do
|
17
|
-
Rake::Task.tasks.detect{|task| task.to_s == "iidea:clean"}.comment.should_not be_nil
|
18
|
-
end
|
19
|
-
|
20
|
-
it "removes the 'idea' task" do
|
21
|
-
Rake::Task.tasks.detect{|task| task.to_s == "idea"}.should be_nil
|
22
|
-
end
|
23
|
-
|
24
|
-
it "removes the 'idea7x' task" do
|
25
|
-
Rake::Task.tasks.detect{|task| task.to_s == "idea7x"}.should be_nil
|
26
|
-
end
|
27
|
-
|
28
|
-
it "removes the 'idea7x:clean' task" do
|
29
|
-
Rake::Task.tasks.detect{|task| task.to_s == "idea7x:clean"}.should be_nil
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "#no_iml" do
|
33
|
-
it "makes #iml? false" do
|
34
|
-
@foo = define "foo" do
|
35
|
-
project.no_iml
|
36
|
-
end
|
37
|
-
@foo.iml?.should be_false
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe "#iml" do
|
42
|
-
before do
|
43
|
-
define "foo" do
|
44
|
-
iml.suffix = "-top"
|
45
|
-
|
46
|
-
define "bar" do
|
47
|
-
iml.suffix = "-mid"
|
48
|
-
|
49
|
-
define "baz" do
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
it "inherits the direct parent's IML settings" do
|
56
|
-
project('foo:bar:baz').iml.suffix.should == "-mid"
|
57
|
-
end
|
58
|
-
|
59
|
-
it "does not modify the parent's IML settings" do
|
60
|
-
project('foo').iml.suffix.should == "-top"
|
61
|
-
end
|
62
|
-
|
63
|
-
it "works even when the parent has no IML" do
|
64
|
-
lambda {
|
65
|
-
define "a" do
|
66
|
-
project.no_iml
|
67
|
-
define "b" do
|
68
|
-
iml.suffix = "-alone"
|
69
|
-
end
|
70
|
-
end
|
71
|
-
}.should_not raise_error
|
72
|
-
end
|
73
|
-
|
74
|
-
it "inherits from the first ancestor which has an IML" do
|
75
|
-
define "a" do
|
76
|
-
iml.suffix = "-a"
|
77
|
-
define "b" do
|
78
|
-
iml.suffix = "-b"
|
79
|
-
define "c" do
|
80
|
-
project.no_iml
|
81
|
-
define "d" do
|
82
|
-
project.no_iml
|
83
|
-
define "e" do
|
84
|
-
project.no_iml
|
85
|
-
define "f" do
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
project("a:b:c:d:e:f").iml.suffix.should == "-b"
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "project extension" do
|
4
|
+
it "provides an 'iidea:generate' task" do
|
5
|
+
Rake::Task.tasks.detect{|task| task.to_s == "iidea:generate"}.should_not be_nil
|
6
|
+
end
|
7
|
+
|
8
|
+
it "documents the 'iidea:generate' task" do
|
9
|
+
Rake::Task.tasks.detect{|task| task.to_s == "iidea:generate"}.comment.should_not be_nil
|
10
|
+
end
|
11
|
+
|
12
|
+
it "provides an 'iidea:clean' task" do
|
13
|
+
Rake::Task.tasks.detect{|task| task.to_s == "iidea:clean"}.should_not be_nil
|
14
|
+
end
|
15
|
+
|
16
|
+
it "documents the 'iidea:clean' task" do
|
17
|
+
Rake::Task.tasks.detect{|task| task.to_s == "iidea:clean"}.comment.should_not be_nil
|
18
|
+
end
|
19
|
+
|
20
|
+
it "removes the 'idea' task" do
|
21
|
+
Rake::Task.tasks.detect{|task| task.to_s == "idea"}.should be_nil
|
22
|
+
end
|
23
|
+
|
24
|
+
it "removes the 'idea7x' task" do
|
25
|
+
Rake::Task.tasks.detect{|task| task.to_s == "idea7x"}.should be_nil
|
26
|
+
end
|
27
|
+
|
28
|
+
it "removes the 'idea7x:clean' task" do
|
29
|
+
Rake::Task.tasks.detect{|task| task.to_s == "idea7x:clean"}.should be_nil
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "#no_iml" do
|
33
|
+
it "makes #iml? false" do
|
34
|
+
@foo = define "foo" do
|
35
|
+
project.no_iml
|
36
|
+
end
|
37
|
+
@foo.iml?.should be_false
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "#iml" do
|
42
|
+
before do
|
43
|
+
define "foo" do
|
44
|
+
iml.suffix = "-top"
|
45
|
+
|
46
|
+
define "bar" do
|
47
|
+
iml.suffix = "-mid"
|
48
|
+
|
49
|
+
define "baz" do
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
it "inherits the direct parent's IML settings" do
|
56
|
+
project('foo:bar:baz').iml.suffix.should == "-mid"
|
57
|
+
end
|
58
|
+
|
59
|
+
it "does not modify the parent's IML settings" do
|
60
|
+
project('foo').iml.suffix.should == "-top"
|
61
|
+
end
|
62
|
+
|
63
|
+
it "works even when the parent has no IML" do
|
64
|
+
lambda {
|
65
|
+
define "a" do
|
66
|
+
project.no_iml
|
67
|
+
define "b" do
|
68
|
+
iml.suffix = "-alone"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
}.should_not raise_error
|
72
|
+
end
|
73
|
+
|
74
|
+
it "inherits from the first ancestor which has an IML" do
|
75
|
+
define "a" do
|
76
|
+
iml.suffix = "-a"
|
77
|
+
define "b" do
|
78
|
+
iml.suffix = "-b"
|
79
|
+
define "c" do
|
80
|
+
project.no_iml
|
81
|
+
define "d" do
|
82
|
+
project.no_iml
|
83
|
+
define "e" do
|
84
|
+
project.no_iml
|
85
|
+
define "f" do
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
project("a:b:c:d:e:f").iml.suffix.should == "-b"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|