cxxproject 0.6.29 → 0.6.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/README.md +195 -65
  2. data/lib/cxxproject/buildingblocks/building_block.rb +1 -1
  3. data/lib/cxxproject/buildingblocks/executable.rb +3 -0
  4. data/lib/cxxproject/buildingblocks/has_dependencies_mixin.rb +5 -5
  5. data/lib/cxxproject/buildingblocks/has_sources_mixin.rb +30 -16
  6. data/lib/cxxproject/buildingblocks/single_source.rb +0 -1
  7. data/lib/cxxproject/ext/rake_listener.rb +11 -13
  8. data/lib/cxxproject/plugin_context.rb +6 -4
  9. data/lib/cxxproject/toolchain/colorizing_formatter.rb +8 -5
  10. data/lib/cxxproject/utils/printer.rb +6 -6
  11. data/lib/cxxproject/version.rb +1 -1
  12. data/lib/cxxproject.rb +0 -1
  13. metadata +37 -145
  14. data/.gitignore +0 -18
  15. data/.rvmrc +0 -1
  16. data/Gemfile +0 -6
  17. data/Gemfile.lock +0 -35
  18. data/Rakefile.rb +0 -125
  19. data/cxxproject.gemspec +0 -22
  20. data/example/.gitignore +0 -1
  21. data/example/Rakefile.rb +0 -35
  22. data/example/big_project/.gitignore +0 -2
  23. data/example/big_project/Rakefile_generator.rb +0 -80
  24. data/example/big_project/fak.h +0 -9
  25. data/example/custom/.gitignore +0 -1
  26. data/example/custom/Rakefile.rb +0 -12
  27. data/example/custom/foo.cpp +0 -5
  28. data/example/custom/project.rb +0 -27
  29. data/example/dependency_tests/Rakefile.rb +0 -3
  30. data/example/dependency_tests/help1.h +0 -12
  31. data/example/dependency_tests/help2.h +0 -10
  32. data/example/dependency_tests/main.cpp +0 -6
  33. data/example/dependency_tests/project.rb +0 -3
  34. data/example/generator/Rakefile.rb +0 -12
  35. data/example/generator/main/main.cpp +0 -3
  36. data/example/generator/main/project/project.rb +0 -3
  37. data/example/oneFileOnly/Rakefile.rb +0 -3
  38. data/example/oneFileOnly/config.h +0 -2
  39. data/example/oneFileOnly/main.cpp +0 -8
  40. data/example/oneFileOnly/project_compile.rb +0 -3
  41. data/example/protobuf/.gitignore +0 -4
  42. data/example/protobuf/Rakefile.rb +0 -70
  43. data/example/protobuf/addressbook/addressbook.proto +0 -24
  44. data/example/protobuf/addressbook/addressbook_read.cc +0 -67
  45. data/example/protobuf/addressbook/addressbook_write.cc +0 -93
  46. data/example/protobuf/addressbook/project.rb +0 -16
  47. data/example/protobuf/protobuf.files +0 -37
  48. data/example/protobuf/protobuf_project.rb +0 -9
  49. data/example/simpleUnitTest/Rakefile.rb +0 -4
  50. data/example/simpleUnitTest/atest.cpp +0 -16
  51. data/example/simpleUnitTest/atest.h +0 -11
  52. data/example/simpleUnitTest/project.rb +0 -5
  53. data/example/simpleUnitTest/test.cpp +0 -13
  54. data/example/strange_dirs/Rakefile.rb +0 -4
  55. data/example/strange_dirs/lazyLib/project.rb +0 -5
  56. data/example/strange_dirs/main/main.cpp +0 -5
  57. data/example/strange_dirs/main/project.rb +0 -5
  58. data/example/strange_dirs/src/test.cpp +0 -4
  59. data/example/test.rb +0 -10
  60. data/example/three_tests/Rakefile.rb +0 -5
  61. data/example/three_tests/allsuites/project.rb +0 -4
  62. data/example/three_tests/main/main.cpp +0 -13
  63. data/example/three_tests/main/project.rb +0 -5
  64. data/example/three_tests/suite1/project.rb +0 -6
  65. data/example/three_tests/suite1/suite1.cpp +0 -3
  66. data/example/three_tests/suite1/suite1.h +0 -28
  67. data/example/three_tests/suite2/project.rb +0 -6
  68. data/example/three_tests/suite2/suite2.cpp +0 -3
  69. data/example/three_tests/suite2/suite2.h +0 -29
  70. data/junit.rb +0 -91
  71. data/lib/cxxproject/ext/string.rb +0 -9
  72. data/plugins/tmp/.rvmrc +0 -1
  73. data/plugins/tmp/BuildDir/objects/testme/test.o +0 -0
  74. data/plugins/tmp/BuildDir/objects/testme/test.o.d +0 -1
  75. data/plugins/tmp/BuildDir/testme.exe +0 -0
  76. data/plugins/tmp/Rakefile.rb +0 -6
  77. data/plugins/tmp/project.rb +0 -6
  78. data/plugins/tmp/reinstall/Rakefile.rb +0 -15
  79. data/plugins/tmp/test.cpp +0 -7
  80. data/rake_helper/perftools.rb +0 -34
  81. data/rake_helper/spec.rb +0 -65
  82. data/roodi.yml +0 -8
  83. data/spec/building_block_spec.rb +0 -103
  84. data/spec/file_ext_spec.rb +0 -30
  85. data/spec/ide_interface_spec.rb +0 -41
  86. data/spec/plugin_context_spec.rb +0 -57
  87. data/spec/provider_spec.rb +0 -39
  88. data/spec/rake_listener_ext_spec.rb +0 -58
  89. data/spec/spec_helper.rb +0 -18
  90. data/spec/string_spec.rb +0 -11
  91. data/spec/testdata/basic/exe12/help.cpp +0 -5
  92. data/spec/testdata/basic/exe12/help.h +0 -6
  93. data/spec/testdata/basic/exe12/main.cpp +0 -10
  94. data/spec/testdata/basic/exe12/project.rb +0 -5
  95. data/spec/testdata/basic/lib1/lib1.cpp +0 -7
  96. data/spec/testdata/basic/lib1/lib1.h +0 -8
  97. data/spec/testdata/basic/lib1/project.rb +0 -5
  98. data/spec/testdata/basic/lib2/lib2.cpp +0 -17
  99. data/spec/testdata/basic/lib2/lib2.h +0 -6
  100. data/spec/testdata/basic/lib2/project.rb +0 -8
  101. data/spec/testdata/multiple_levels/libs/lib1/lib1.cpp +0 -7
  102. data/spec/testdata/multiple_levels/libs/lib1/lib1.h +0 -8
  103. data/spec/testdata/multiple_levels/libs/lib1/project.rb +0 -5
  104. data/spec/testdata/multiple_levels/libs/lib2/lib2.cpp +0 -21
  105. data/spec/testdata/multiple_levels/libs/lib2/lib2.h +0 -6
  106. data/spec/testdata/multiple_levels/libs/lib2/project.rb +0 -19
  107. data/spec/testdata/multiple_levels/mainproject/basic/help.cpp +0 -5
  108. data/spec/testdata/multiple_levels/mainproject/basic/help.h +0 -6
  109. data/spec/testdata/multiple_levels/mainproject/basic/main.cpp +0 -10
  110. data/spec/testdata/multiple_levels/mainproject/basic/project.rb +0 -8
  111. data/spec/testdata/onlyOneHeader/.gitignore +0 -1
  112. data/spec/testdata/onlyOneHeader/Rakefile.rb +0 -4
  113. data/spec/testdata/onlyOneHeader/help.cpp +0 -5
  114. data/spec/testdata/onlyOneHeader/help.h +0 -7
  115. data/spec/testdata/onlyOneHeader/main.cpp +0 -8
  116. data/spec/testdata/onlyOneHeader/project.rb +0 -4
  117. data/spec/testdata/onlyOneHeader/testin.c +0 -0
  118. data/spec/toolchain_spec.rb +0 -29
@@ -1,58 +0,0 @@
1
- require 'spec_helper'
2
- require 'cxxproject'
3
- require 'cxxproject/ext/rake_listener.rb'
4
- require 'cxxproject/utils/cleanup'
5
-
6
- describe Rake::Task do
7
-
8
- before(:each) do
9
- Cxxproject::Utils.cleanup_rake
10
- end
11
- after(:each) do
12
- Cxxproject::Utils.cleanup_rake
13
- end
14
-
15
-
16
- it "should call a listener for prerequisites and execute" do
17
- task "mypre"
18
- t = task "test" => "mypre"
19
-
20
- l = mock
21
- Rake::add_listener(l)
22
-
23
- l.should_receive(:before_execute).with('mypre')
24
- l.should_receive(:after_execute).with('mypre')
25
- l.should_receive(:before_prerequisites).with('mypre')
26
- l.should_receive(:after_prerequisites).with('mypre')
27
- l.should_receive(:before_prerequisites).with('test')
28
- l.should_receive(:after_prerequisites).with('test')
29
- l.should_receive(:before_execute).with('test')
30
- l.should_receive(:after_execute).with('test')
31
- t.invoke
32
-
33
- Rake::remove_listener(l)
34
-
35
- t.invoke
36
- end
37
-
38
- class DummyListener
39
- def calls
40
- @calls ||= []
41
- end
42
- def after_execute(name)
43
- c = calls
44
- c << name
45
- end
46
- end
47
-
48
- it "should work with only half implemented rake-listener" do
49
- task "mypre"
50
- t = task "test" => "mypre"
51
- l = DummyListener.new
52
- Rake::add_listener(l)
53
- t.invoke
54
- Rake::remove_listener(l)
55
- l.calls.should eq(['mypre', 'test'])
56
- end
57
-
58
- end
data/spec/spec_helper.rb DELETED
@@ -1,18 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","lib")
2
-
3
- require 'cxxproject/utils/optional'
4
- initialize_simplecov = lambda do
5
- require 'simplecov'
6
- if ENV['COVERAGE']
7
- SimpleCov.start do
8
- add_group 'buildingblocks', 'lib/cxxproject/buildingblocks'
9
- add_group 'utils', 'lib/cxxproject/utils'
10
- add_group 'errorparser', 'lib/cxxproject/errorparser'
11
- add_group 'toolchain', 'lib/cxxproject/toolchain'
12
- add_group 'ext', 'lib/cxxproject/ext'
13
- end
14
- end
15
- end
16
- Cxxproject::Utils::optional_package(initialize_simplecov, nil)
17
-
18
- RakeFileUtils.send(:verbose, false)
data/spec/string_spec.rb DELETED
@@ -1,11 +0,0 @@
1
- require 'cxxproject'
2
-
3
- describe String do
4
- it 'should remove from start if matching' do
5
- s = "abcd"
6
- s.remove_from_start('abc').should == 'd'
7
- end
8
- it 'should not change the string if the start does not match' do
9
- "abcd".remove_from_start('z').should == 'abcd'
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- #include "help.h"
2
- #include <iostream>
3
- void helpMe() {
4
- std::cout << "help me" << std::endl;
5
- }
@@ -1,6 +0,0 @@
1
- #ifndef help_h_
2
- #define help_h_
3
-
4
- void helpMe();
5
-
6
- #endif
@@ -1,10 +0,0 @@
1
- // #include "lib2.h"
2
- #include <iostream>
3
- #include "help.h"
4
-
5
- int main(int argc, char** args) {
6
- helpMe();
7
- // lib2();
8
- std::cout << "hello world" << std::endl;
9
- return 0;
10
- }
@@ -1,5 +0,0 @@
1
- cxx_configuration do
2
- exe "basic",
3
- :sources => FileList.new('**/*.cpp'),
4
- :dependencies => ['2']
5
- end
@@ -1,7 +0,0 @@
1
- #include "lib1.h"
2
-
3
- #include <iostream>
4
-
5
- void lib1() {
6
- std::cout << "lib1" << std::endl;
7
- }
@@ -1,8 +0,0 @@
1
- #ifndef lib1_h_
2
- #define lib1_h_
3
-
4
- void lib1();
5
-
6
-
7
- #endif
8
-
@@ -1,5 +0,0 @@
1
- cxx_configuration do
2
- source_lib "1",
3
- :sources => ['lib1.cpp'],
4
- :includes => ['.']
5
- end
@@ -1,17 +0,0 @@
1
- #include "lib2.h"
2
-
3
- #include <iostream>
4
- #include <math.h>
5
- #include "lib1.h"
6
- #include <dlfcn.h>
7
- #include <zlib.h>
8
-
9
- void lib2() {
10
- std::cout << "lib2" << std::endl;
11
- lib1();
12
- std::cout << sin(5) << std::endl;
13
- void* help = dlopen("test", RTLD_LAZY);
14
- std::cout << (long)help << std::endl;
15
- Bytef b = 0;
16
- uLong res = crc32(0, &b, 1);
17
- }
@@ -1,6 +0,0 @@
1
- #ifndef lib2_h_
2
- #define lib2_h_
3
-
4
- void lib2();
5
-
6
- #endif
@@ -1,8 +0,0 @@
1
- cxx_configuration do
2
- deps = ['1', BinaryLibrary.new('z')]
3
- deps << BinaryLibrary.new('dl') if Utils::OS.linux?
4
- source_lib "2",
5
- :sources => FileList['**/*.cpp'],
6
- :dependencies => deps,
7
- :includes => ['.']
8
- end
@@ -1,7 +0,0 @@
1
- #include "lib1.h"
2
-
3
- #include <iostream>
4
-
5
- void lib1() {
6
- std::cout << "lib1" << std::endl;
7
- }
@@ -1,8 +0,0 @@
1
- #ifndef lib1_h_
2
- #define lib1_h_
3
-
4
- void lib1();
5
-
6
-
7
- #endif
8
-
@@ -1,5 +0,0 @@
1
- cxx_configuration do
2
- source_lib "1",
3
- :sources => FileList['lib1.cpp'],
4
- :includes => ['.']
5
- end
@@ -1,21 +0,0 @@
1
- #include "lib2.h"
2
-
3
- #include <iostream>
4
- #include <math.h>
5
- #include "lib1.h"
6
- #include <dlfcn.h>
7
- #include <zlib.h>
8
-
9
- void lib2() {
10
- #ifdef UNIT_TEST
11
- std::cout << "lib2 for UNIT_TEST defined" << std::endl;
12
- #else
13
- std::cout << "lib2" << std::endl;
14
- #endif
15
- lib1();
16
- std::cout << sin(5) << std::endl;
17
- void* help = dlopen("test", RTLD_LAZY);
18
- std::cout << (long)help << std::endl;
19
- Bytef b = 0;
20
- uLong res = crc32(0, &b, 1);
21
- }
@@ -1,6 +0,0 @@
1
- #ifndef lib2_h_
2
- #define lib2_h_
3
-
4
- void lib2();
5
-
6
- #endif
@@ -1,19 +0,0 @@
1
- cxx_configuration do
2
- deps = ['1', BinaryLibrary.new('z')]
3
- deps << BinaryLibrary.new('dl') if Utils::OS.linux?
4
-
5
- source_lib "2",
6
- :sources => FileList['**/*.cpp'],
7
- :dependencies => deps,
8
- :includes => ['.']
9
-
10
-
11
- unittest_flags = {
12
- :DEFINES => ['UNIT_TEST','CPPUNIT_MAIN="main"']
13
- }
14
- source_lib "2_debug",
15
- :sources => FileList['**/*.cpp'],
16
- :dependencies => deps,
17
- :includes => ['.'],
18
- :toolchain => Provider.modify_cpp_compiler("gcc", unittest_flags)
19
- end
@@ -1,5 +0,0 @@
1
- #include "help.h"
2
- #include <iostream>
3
- void helpMe() {
4
- std::cout << "help me" << std::endl;
5
- }
@@ -1,6 +0,0 @@
1
- #ifndef help_h_
2
- #define help_h_
3
-
4
- void helpMe();
5
-
6
- #endif
@@ -1,10 +0,0 @@
1
- #include "lib2.h"
2
- #include <iostream>
3
- #include "help.h"
4
-
5
- int main(int argc, char** args) {
6
- helpMe();
7
- lib2();
8
- std::cout << "hello world" << std::endl;
9
- return 0;
10
- }
@@ -1,8 +0,0 @@
1
- cxx_configuration do
2
- exe "basic",
3
- :sources => FileList['**/*.cpp'],
4
- :dependencies => ['2']
5
- exe "debug",
6
- :sources => FileList['**/*.cpp'],
7
- :dependencies => ['2_debug']
8
- end
@@ -1 +0,0 @@
1
- output
@@ -1,4 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
- require 'cxxproject'
3
- BuildDir='output'
4
- CxxProject2Rake.new(['project.rb'], BuildDir, "clang")
@@ -1,5 +0,0 @@
1
- #include "help.h"
2
- #include <iostream>
3
- void helpMe() {
4
- std::cout << "help me" << std::endl;
5
- }
@@ -1,7 +0,0 @@
1
- #ifndef help_h_
2
- #define help_h_
3
-
4
-
5
- void helpMe();
6
-
7
- #endif
@@ -1,8 +0,0 @@
1
- #include <iostream>
2
- #include "help.h"
3
-
4
- int main(int argc, char** args) {
5
- helpMe();
6
- std::cout << "hello world" << std::endl;
7
- return 0;
8
- }
@@ -1,4 +0,0 @@
1
- cxx_configuration do
2
- exe "basic",
3
- :sources => FileList.new('**/*.cpp')
4
- end
File without changes
@@ -1,29 +0,0 @@
1
- GCC_JSON = File.join(File.dirname(__FILE__),"..","lib","cxxproject","toolchain","gcc.json")
2
- require 'cxxproject/toolchain/toolchain'
3
-
4
- # describe String do
5
- # it 'should correctly load toolchain from json file' do
6
- # tc = Toolchain.new(GCC_JSON)
7
- # tc.name.should == "gcc"
8
- # tc.compiler.cpp.command.should == "g++"
9
- # tc.compiler.c.source_file_endings.should == [".c"]
10
- # tc.linker.output_ending == ".exe"
11
- # end
12
- #
13
- # it 'should be possible to add list items to existing settings' do
14
- # tc = Toolchain.new(GCC_JSON)
15
- # tc.compiler.c.source_file_endings.should == [".c"]
16
- # tc.compiler.c.source_file_endings << ".cc"
17
- # tc.compiler.c.source_file_endings.should == [".c",".cc"]
18
- # tc.compiler.c.source_file_endings << ".aa"
19
- # tc.compiler.c.source_file_endings.should == [".c",".cc",".aa"]
20
- # end
21
- #
22
- # it "should be possible to replace existing settings" do
23
- # tc = Toolchain.new(GCC_JSON)
24
- # tc.compiler.c.source_file_endings.should == [".c"]
25
- # tc.compiler.c.source_file_endings = [".cc"]
26
- # tc.compiler.c.source_file_endings.should == [".cc"]
27
- # end
28
- #
29
- # end