cxxproject 0.6.2 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile.rb CHANGED
@@ -47,7 +47,7 @@ begin
47
47
  end
48
48
  end
49
49
  RoodiTask.new('roodi', spec.files)
50
- task :gem => [:roodi]
50
+ task :agem => [:roodi]
51
51
  rescue LoadError # don't bail out when people do not have roodi installed!
52
52
  puts 'please gem install roodi'
53
53
  end
@@ -1,7 +1,7 @@
1
1
  module Cxxproject
2
2
  class Version
3
3
  def self.cxxproject
4
- "0.6.2"
4
+ "0.6.4"
5
5
  end
6
6
  end
7
7
  end
@@ -5,6 +5,6 @@ unittest_flags = {
5
5
  :DEFINES => ['UNIT_TEST','CPPUNIT_MAIN=main'],
6
6
  :FLAGS => "-O0 -g3 -Wall"
7
7
  }
8
- toolchain = Provider.modify_cpp_compiler("GCC", unittest_flags)
8
+ toolchain = Provider.modify_cpp_compiler("<%= toolchain_name %>", unittest_flags)
9
9
  dependent_projects = ['./project.rb']
10
10
  CxxProject2Rake.new(dependent_projects, BuildDir, toolchain, './')
@@ -1,5 +1,27 @@
1
1
  require 'rake'
2
2
  require 'erb'
3
+ require 'rubygems'
4
+
5
+ def choose_toolchain
6
+ res = nil
7
+ toolchains = []
8
+ prefix = "cxxproject_"
9
+ toolchain_gems = Gem::Specification.find_all do |gem|
10
+ gem.name.start_with?(prefix)
11
+ end
12
+ if toolchain_gems.length > 0
13
+ choose do |menu|
14
+ menu.prompt = "choose a toolchain:"
15
+ toolchain_gems.each do |gem|
16
+ name = gem.name[prefix.length..-1]
17
+ menu.choice(name.to_sym) { res = name }
18
+ end
19
+ end
20
+ else
21
+ say "no toolchains found...you need to install toolchain-gems in order to use cxxproject"
22
+ end
23
+ res
24
+ end
3
25
 
4
26
  def choose_building_block
5
27
  res = nil
@@ -27,10 +49,12 @@ def prepare_project(d)
27
49
  require 'highline/import'
28
50
 
29
51
  if agree("This will create a new cxx-project config in dir \"#{d}\" \nAre you sure you want to continue? [yn] ")
52
+ tc = choose_toolchain
53
+ return unless tc
30
54
  bb = choose_building_block
31
55
  generate_makefile = choose_generate_makefile
32
56
 
33
- create_project(d, bb, generate_makefile)
57
+ create_project(d, bb, tc, generate_makefile)
34
58
  else
35
59
  say "stopped project creation"
36
60
  end
@@ -40,13 +64,14 @@ def prepare_project(d)
40
64
  end
41
65
 
42
66
 
43
- def create_project(d, bb, generate_rakefile)
67
+ def create_project(d, bb, tc, generate_rakefile)
44
68
  rakefile_template = File.join(File.dirname(__FILE__),"..","tools","Rakefile.rb.template")
45
69
  projectrb_template = File.join(File.dirname(__FILE__),"..","tools","project.rb.template")
46
70
  s1 = IO.read(rakefile_template)
47
71
  s2 = IO.read(projectrb_template)
48
72
  name = "testme"
49
73
  building_block = bb
74
+ toolchain_name = tc[/(.*?)toolchain/,1]
50
75
  mkdir_p(d, :verbose => false)
51
76
  cd(d,:verbose => false) do
52
77
  if ((File.exists? "Rakefile.rb") || (File.exists? "project.rb"))
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cxxproject
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.2
5
+ version: 0.6.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - oliver mueller
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- hash: 3389425425970571321
143
+ hash: 1495580368314725504
144
144
  segments:
145
145
  - 0
146
146
  version: "0"