Permalink
Browse files

INitial working version for simple C++ projects

  • Loading branch information...
0 parents commit 4e7f04a784ff6443150310b7edf1c4046fd062a3 @joeyates committed Aug 9, 2010
Showing with 695 additions and 0 deletions.
  1. +5 −0 CHANGES
  2. +20 −0 COPYING
  3. +40 −0 README.rdoc
  4. +51 −0 Rakefile
  5. +284 −0 lib/rake/cpp.rb
  6. +275 −0 spec/project/build_spec.rb
  7. +12 −0 spec/project/main.cpp
  8. +6 −0 spec/project/main.h
  9. +2 −0 spec/spec_helper.rb
@@ -0,0 +1,5 @@
+= Rake::Cpp Changelog
+
+== Version 0.0.1
+
+* Initial version
20 COPYING
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Joe Yates
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,40 @@
+= rake-cpp - Rake for C/C++
+
+Rake was created as a make replacement, and rake-cpp
+aims to become a replacement for autom4te, autoconfig,
+configure.in, configure etc.
+
+= Installation
+
+ $ sudo gem install rake-cpp
+
+= Example
+
+== A minimal C++ project
+
+This case assumes you have a project where all source and header files are in the same directory.
+
+Create a file 'Rakefile' in the directory.
+
+Rakefile contents:
+
+ Rake::Cpp.new do |cpp|
+ cpp.target = 'my_program'
+ end
+
+ $ rake
+
+= Status
+
+- Builds C++ projects on Linux
+
+= Alternatives
+
+- make
+- CMake
+- Boost.Build
+- rakepp - another take on using rake for c++ projects
+
+== TODO
+
+- pre-compiled headers
@@ -0,0 +1,51 @@
+require 'rubygems' if RUBY_VERSION < '1.9'
+require 'rake'
+require 'rake/gempackagetask'
+require 'spec/rake/spectask'
+require 'rake/rdoctask'
+$:.unshift(File.dirname(__FILE__) + '/lib')
+require 'rake/cpp'
+
+RDOC_OPTS = ['--quiet', '--main', 'README.rdoc', '--inline-source']
+
+spec = Gem::Specification.new do |s|
+ s.name = 'rake-cpp'
+ s.summary = 'Rake for C/C++ Projects'
+ s.description = 'Provides Rake:CPP, a specific rake TaskLib for building C and C++ projects'
+ s.version = Rake::Cpp::VERSION::STRING
+
+ s.homepage = 'http://github.com/joeyates/rake-cpp'
+ s.author = 'Joe Yates'
+ s.email = 'joe.g.yates@gmail.com'
+
+ s.files = ['README.rdoc', 'COPYING', 'Rakefile'] + FileList['{lib,test}/**/*.rb']
+ s.require_paths = ['lib']
+ s.add_dependency('rake', '>= 0.8.7')
+
+ s.has_rdoc = true
+ s.rdoc_options += RDOC_OPTS
+ s.extra_rdoc_files = ['README.rdoc', 'COPYING']
+
+ s.test_file = 'test/all_tests.rb'
+end
+
+Rake::GemPackageTask.new(spec) do |pkg|
+end
+
+Spec::Rake::SpecTask.new do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts += [ '--color', '--format specdoc' ]
+end
+
+Spec::Rake::SpecTask.new('spec:rcov') do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = [ '--exclude spec' ]
+end
+
+Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'html'
+ rdoc.options += RDOC_OPTS
+ rdoc.title = 'Rake for C/C++ Projects'
+ rdoc.rdoc_files.add ['README.rdoc', 'COPYING', 'lib/**/*.rb']
+end
Oops, something went wrong.

0 comments on commit 4e7f04a

Please sign in to comment.