paper_house 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.rspec +1 -0
- data/.travis.yml +17 -0
- data/Gemfile +35 -0
- data/Guardfile +28 -0
- data/README.md +116 -0
- data/Rakefile +139 -0
- data/cucumber.yml +3 -0
- data/examples/c_extension/.gitignore +5 -0
- data/examples/c_extension/Rakefile +3 -0
- data/examples/c_extension/Rakefile.llvm +5 -0
- data/examples/c_extension/hello.c +6 -0
- data/examples/executable/.gitignore +4 -0
- data/examples/executable/Rakefile +3 -0
- data/examples/executable/Rakefile.llvm +5 -0
- data/examples/executable/hello.c +7 -0
- data/examples/executable_subdirs/.gitignore +4 -0
- data/examples/executable_subdirs/Rakefile +9 -0
- data/examples/executable_subdirs/includes/hello.h +1 -0
- data/examples/executable_subdirs/sources/hello.c +6 -0
- data/examples/executable_subdirs/sources/main.c +8 -0
- data/examples/shared_library/.gitignore +8 -0
- data/examples/shared_library/Rakefile +17 -0
- data/examples/shared_library/Rakefile.llvm +19 -0
- data/examples/shared_library/hello.c +6 -0
- data/examples/shared_library/hello.h +1 -0
- data/examples/shared_library/main.c +7 -0
- data/examples/shared_library/symlinks.rake +7 -0
- data/examples/shared_library_subdirs/.gitignore +8 -0
- data/examples/shared_library_subdirs/Rakefile +27 -0
- data/examples/shared_library_subdirs/includes/hello.h +1 -0
- data/examples/shared_library_subdirs/sources/hello.c +6 -0
- data/examples/shared_library_subdirs/sources/main.c +8 -0
- data/examples/static_library/.gitignore +7 -0
- data/examples/static_library/Rakefile +13 -0
- data/examples/static_library/Rakefile.llvm +14 -0
- data/examples/static_library/hello.c +6 -0
- data/examples/static_library/hello.h +1 -0
- data/examples/static_library/main.c +7 -0
- data/examples/static_library_subdirs/.gitignore +7 -0
- data/examples/static_library_subdirs/Rakefile +17 -0
- data/examples/static_library_subdirs/includes/hello.h +1 -0
- data/examples/static_library_subdirs/sources/hello.c +6 -0
- data/examples/static_library_subdirs/sources/main.c +8 -0
- data/features/c_extension_task.feature +119 -0
- data/features/executable_task.feature +83 -0
- data/features/shared_library_task.feature +209 -0
- data/features/static_library_task.feature +116 -0
- data/features/step_definitions/paper_house_steps.rb +8 -0
- data/features/support/env.rb +41 -0
- data/features/support/hooks.rb +12 -0
- data/lib/paper_house/auto_depends.rb +95 -0
- data/lib/paper_house/build_task.rb +188 -0
- data/lib/paper_house/c_extension_task.rb +95 -0
- data/lib/paper_house/cc_options.rb +81 -0
- data/lib/paper_house/dependency.rb +74 -0
- data/lib/paper_house/executable_task.rb +77 -0
- data/lib/paper_house/library_task.rb +64 -0
- data/lib/paper_house/linker_options.rb +89 -0
- data/lib/paper_house/platform.rb +69 -0
- data/lib/paper_house/safe_popen.rb +50 -0
- data/lib/paper_house/shared_library_task.rb +92 -0
- data/lib/paper_house/static_library_task.rb +65 -0
- data/lib/paper_house/version.rb +30 -0
- data/lib/paper_house.rb +30 -0
- data/paper_house.gemspec +34 -0
- data/spec/paper_house/c_extension_task_spec.rb +59 -0
- data/spec/paper_house/cc_options_spec.rb +59 -0
- data/spec/paper_house/executable_task_spec.rb +49 -0
- data/spec/paper_house/shared_library_task_spec.rb +94 -0
- data/spec/paper_house/static_library_task_spec.rb +61 -0
- data/spec/paper_house/version_spec.rb +31 -0
- data/spec/spec_helper.rb +46 -0
- metadata +161 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2013 NEC Corporation
|
3
|
+
#
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License, version 3, as
|
6
|
+
# published by the Free Software Foundation.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License along
|
14
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16
|
+
#
|
17
|
+
|
18
|
+
|
19
|
+
require "paper_house/shared_library_task"
|
20
|
+
|
21
|
+
|
22
|
+
module PaperHouse
|
23
|
+
describe SharedLibraryTask do
|
24
|
+
it "should find registered tasks by name" do
|
25
|
+
task = SharedLibraryTask.new( :libtest, "0.1.0" )
|
26
|
+
|
27
|
+
SharedLibraryTask.find_by( :libtest ).should eq task
|
28
|
+
SharedLibraryTask.find_by( "libtest" ).should eq task
|
29
|
+
SharedLibraryTask.find_by( :no_such_task ).should be_nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
describe SharedLibraryTask, %{.new( :libtest, "0.1.0" )} do
|
35
|
+
subject { SharedLibraryTask.new :libtest, "0.1.0" }
|
36
|
+
|
37
|
+
its( :cc ) { should eq "gcc" }
|
38
|
+
its( :cflags ) { should be_empty }
|
39
|
+
its( :includes ) { should be_empty }
|
40
|
+
its( :name ) { should eq "libtest" }
|
41
|
+
its( :sources ) { should eq "*.c" }
|
42
|
+
its( :target_directory ) { should eq "." }
|
43
|
+
its( :version ) { should eq "0.1.0" }
|
44
|
+
its( :linker_name ) { should eq "libtest.so" }
|
45
|
+
its( :soname ) { should eq "libtest.so.0" }
|
46
|
+
its( :target_file_name ) { should eq "libtest.so.0.1.0" }
|
47
|
+
its( :library_name ) { should eq "libtest" }
|
48
|
+
its( :lname ) { should eq "test" }
|
49
|
+
|
50
|
+
it {
|
51
|
+
expect {
|
52
|
+
Rake::Task[ subject.name ].invoke
|
53
|
+
}.to raise_error( "Cannot find sources (*.c)." )
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
describe SharedLibraryTask, %{(:library_name = "libtest")} do
|
59
|
+
subject {
|
60
|
+
SharedLibraryTask.new( :libtest, "0.1.0" ) do | task |
|
61
|
+
task.library_name = "libtest"
|
62
|
+
end
|
63
|
+
}
|
64
|
+
|
65
|
+
its( :library_name ) { should eq "libtest" }
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
describe SharedLibraryTask, %{(:library_name = "test")} do
|
70
|
+
subject {
|
71
|
+
SharedLibraryTask.new( :libtest, "0.1.0" ) do | task |
|
72
|
+
task.library_name = "test"
|
73
|
+
end
|
74
|
+
}
|
75
|
+
|
76
|
+
its( :library_name ) { should eq "libtest" }
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
describe SharedLibraryTask, %{.new( :libtest )} do
|
81
|
+
subject { SharedLibraryTask.new "libtest" }
|
82
|
+
|
83
|
+
it {
|
84
|
+
expect { subject }.to raise_error( ":version option is a mandatory." )
|
85
|
+
}
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
### Local variables:
|
91
|
+
### mode: Ruby
|
92
|
+
### coding: utf-8-unix
|
93
|
+
### indent-tabs-mode: nil
|
94
|
+
### End:
|
@@ -0,0 +1,61 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2013 NEC Corporation
|
3
|
+
#
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License, version 3, as
|
6
|
+
# published by the Free Software Foundation.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License along
|
14
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16
|
+
#
|
17
|
+
|
18
|
+
|
19
|
+
require "paper_house/static_library_task"
|
20
|
+
|
21
|
+
|
22
|
+
module PaperHouse
|
23
|
+
describe StaticLibraryTask do
|
24
|
+
it "should find registered tasks by name" do
|
25
|
+
task = StaticLibraryTask.new( :libtest )
|
26
|
+
|
27
|
+
StaticLibraryTask.find_by( :libtest ).should eq task
|
28
|
+
StaticLibraryTask.find_by( "libtest" ).should eq task
|
29
|
+
StaticLibraryTask.find_by( :no_such_task ).should be_nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
describe StaticLibraryTask, ".new( :libtest )" do
|
35
|
+
subject { StaticLibraryTask.new :libtest }
|
36
|
+
|
37
|
+
its( :cc ) { should eq "gcc" }
|
38
|
+
its( :cflags ) { should be_empty }
|
39
|
+
its( :includes ) { should be_empty }
|
40
|
+
its( :name ) { should eq "libtest" }
|
41
|
+
its( :sources ) { should eq "*.c" }
|
42
|
+
its( :target_directory ) { should eq "." }
|
43
|
+
its( :library_name ) { should eq "libtest" }
|
44
|
+
its( :lname ) { should eq "test" }
|
45
|
+
its( :target_file_name ) { should eq "libtest.a" }
|
46
|
+
its( :target_path ) { should eq "./libtest.a" }
|
47
|
+
|
48
|
+
it {
|
49
|
+
expect {
|
50
|
+
Rake::Task[ subject.name ].invoke
|
51
|
+
}.to raise_error( "Cannot find sources (*.c)." )
|
52
|
+
}
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
### Local variables:
|
58
|
+
### mode: Ruby
|
59
|
+
### coding: utf-8-unix
|
60
|
+
### indent-tabs-mode: nil
|
61
|
+
### End:
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2013 NEC Corporation
|
3
|
+
#
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License, version 3, as
|
6
|
+
# published by the Free Software Foundation.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License along
|
14
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16
|
+
#
|
17
|
+
|
18
|
+
|
19
|
+
require "paper_house/version"
|
20
|
+
|
21
|
+
|
22
|
+
describe PaperHouse do
|
23
|
+
it { expect( PaperHouse::VERSION ).to match( /\A\d+\.\d+\.\d+\Z/ ) }
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
### Local variables:
|
28
|
+
### mode: Ruby
|
29
|
+
### coding: utf-8-unix
|
30
|
+
### indent-tabs-mode: nil
|
31
|
+
### End:
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2013 NEC Corporation
|
3
|
+
#
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License, version 3, as
|
6
|
+
# published by the Free Software Foundation.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License along
|
14
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16
|
+
#
|
17
|
+
|
18
|
+
|
19
|
+
require "rubygems"
|
20
|
+
|
21
|
+
require "simplecov"
|
22
|
+
SimpleCov.start
|
23
|
+
|
24
|
+
|
25
|
+
require "rake"
|
26
|
+
require "rspec"
|
27
|
+
|
28
|
+
|
29
|
+
RSpec.configure do | config |
|
30
|
+
config.before( :all ) do
|
31
|
+
Rake::Task.clear
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
if ENV[ "TRAVIS" ]
|
37
|
+
require "coveralls"
|
38
|
+
Coveralls.wear_merged!
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
### Local variables:
|
43
|
+
### mode: Ruby
|
44
|
+
### coding: utf-8-unix
|
45
|
+
### indent-tabs-mode: nil
|
46
|
+
### End:
|
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: paper_house
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yasuhito Takamiya
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: POpen4
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 10.1.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 10.1.0
|
41
|
+
description: Rake tasks for compiling C projects.
|
42
|
+
email:
|
43
|
+
- yasuhito@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files:
|
47
|
+
- README.md
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- .rspec
|
51
|
+
- .travis.yml
|
52
|
+
- Gemfile
|
53
|
+
- Guardfile
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- cucumber.yml
|
57
|
+
- examples/c_extension/.gitignore
|
58
|
+
- examples/c_extension/Rakefile
|
59
|
+
- examples/c_extension/Rakefile.llvm
|
60
|
+
- examples/c_extension/hello.c
|
61
|
+
- examples/executable/.gitignore
|
62
|
+
- examples/executable/Rakefile
|
63
|
+
- examples/executable/Rakefile.llvm
|
64
|
+
- examples/executable/hello.c
|
65
|
+
- examples/executable_subdirs/.gitignore
|
66
|
+
- examples/executable_subdirs/Rakefile
|
67
|
+
- examples/executable_subdirs/includes/hello.h
|
68
|
+
- examples/executable_subdirs/sources/hello.c
|
69
|
+
- examples/executable_subdirs/sources/main.c
|
70
|
+
- examples/shared_library/.gitignore
|
71
|
+
- examples/shared_library/Rakefile
|
72
|
+
- examples/shared_library/Rakefile.llvm
|
73
|
+
- examples/shared_library/hello.c
|
74
|
+
- examples/shared_library/hello.h
|
75
|
+
- examples/shared_library/main.c
|
76
|
+
- examples/shared_library/symlinks.rake
|
77
|
+
- examples/shared_library_subdirs/.gitignore
|
78
|
+
- examples/shared_library_subdirs/Rakefile
|
79
|
+
- examples/shared_library_subdirs/includes/hello.h
|
80
|
+
- examples/shared_library_subdirs/sources/hello.c
|
81
|
+
- examples/shared_library_subdirs/sources/main.c
|
82
|
+
- examples/static_library/.gitignore
|
83
|
+
- examples/static_library/Rakefile
|
84
|
+
- examples/static_library/Rakefile.llvm
|
85
|
+
- examples/static_library/hello.c
|
86
|
+
- examples/static_library/hello.h
|
87
|
+
- examples/static_library/main.c
|
88
|
+
- examples/static_library_subdirs/.gitignore
|
89
|
+
- examples/static_library_subdirs/Rakefile
|
90
|
+
- examples/static_library_subdirs/includes/hello.h
|
91
|
+
- examples/static_library_subdirs/sources/hello.c
|
92
|
+
- examples/static_library_subdirs/sources/main.c
|
93
|
+
- features/c_extension_task.feature
|
94
|
+
- features/executable_task.feature
|
95
|
+
- features/shared_library_task.feature
|
96
|
+
- features/static_library_task.feature
|
97
|
+
- features/step_definitions/paper_house_steps.rb
|
98
|
+
- features/support/env.rb
|
99
|
+
- features/support/hooks.rb
|
100
|
+
- lib/paper_house.rb
|
101
|
+
- lib/paper_house/auto_depends.rb
|
102
|
+
- lib/paper_house/build_task.rb
|
103
|
+
- lib/paper_house/c_extension_task.rb
|
104
|
+
- lib/paper_house/cc_options.rb
|
105
|
+
- lib/paper_house/dependency.rb
|
106
|
+
- lib/paper_house/executable_task.rb
|
107
|
+
- lib/paper_house/library_task.rb
|
108
|
+
- lib/paper_house/linker_options.rb
|
109
|
+
- lib/paper_house/platform.rb
|
110
|
+
- lib/paper_house/safe_popen.rb
|
111
|
+
- lib/paper_house/shared_library_task.rb
|
112
|
+
- lib/paper_house/static_library_task.rb
|
113
|
+
- lib/paper_house/version.rb
|
114
|
+
- paper_house.gemspec
|
115
|
+
- spec/paper_house/c_extension_task_spec.rb
|
116
|
+
- spec/paper_house/cc_options_spec.rb
|
117
|
+
- spec/paper_house/executable_task_spec.rb
|
118
|
+
- spec/paper_house/shared_library_task_spec.rb
|
119
|
+
- spec/paper_house/static_library_task_spec.rb
|
120
|
+
- spec/paper_house/version_spec.rb
|
121
|
+
- spec/spec_helper.rb
|
122
|
+
homepage: http://github.com/trema/paper-house
|
123
|
+
licenses:
|
124
|
+
- GPL3
|
125
|
+
metadata: {}
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options: []
|
128
|
+
require_paths:
|
129
|
+
- lib
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
requirements: []
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 2.0.7
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Rake for C projects.
|
146
|
+
test_files:
|
147
|
+
- features/c_extension_task.feature
|
148
|
+
- features/executable_task.feature
|
149
|
+
- features/shared_library_task.feature
|
150
|
+
- features/static_library_task.feature
|
151
|
+
- features/step_definitions/paper_house_steps.rb
|
152
|
+
- features/support/env.rb
|
153
|
+
- features/support/hooks.rb
|
154
|
+
- spec/paper_house/c_extension_task_spec.rb
|
155
|
+
- spec/paper_house/cc_options_spec.rb
|
156
|
+
- spec/paper_house/executable_task_spec.rb
|
157
|
+
- spec/paper_house/shared_library_task_spec.rb
|
158
|
+
- spec/paper_house/static_library_task_spec.rb
|
159
|
+
- spec/paper_house/version_spec.rb
|
160
|
+
- spec/spec_helper.rb
|
161
|
+
has_rdoc:
|