cxxproject_tomake 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 609e23d0e22950d01db639d2934256e90c4b30b5
4
+ data.tar.gz: 6480bd14e5b142e6ee2133ba3dfa2ec4f84c26f5
5
+ SHA512:
6
+ metadata.gz: 3a2874d26693437faa236e0f5709f56de2e509e1b0a91fbf75a2109b9751c242840eb90fb07d2ad7614615b7abb3cf8a09ebcf598e230db006ca3e2cfb2e586a
7
+ data.tar.gz: ff2591365d2158fb750fae9f990ccdb136a5ef4d17489b3ca274de4f90d7139ff047efa4fb5415b4eee2d930870bdb2dd0322cb616d3402f03eb8b7d5a78ba47
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Christian Köstlin
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # CxxprojectTomake
2
+ Plugin for cxxproject that creates a simple make.sh script for building the project.
3
+
4
+ TODO: mkdirs for the output folders are missing.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'cxxproject_tomake'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install cxxproject_tomake
19
+
20
+ ## Contributing
21
+
22
+ 1. Fork it
23
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
24
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
25
+ 4. Push to the branch (`git push origin my-new-feature`)
26
+ 5. Create new Pull Request
@@ -0,0 +1,5 @@
1
+ require "cxxproject_tomake/version"
2
+
3
+ module CxxprojectTomake
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,41 @@
1
+ cxx_plugin do |ruby_dsl, building_blocks, log|
2
+ def escape_spaces(command_line)
3
+ command_line.map do |line|
4
+ regexps = [/(-L)(.*)/,
5
+ /(-I)(.*)/]
6
+ regexps.inject(line) do |memo, regexp|
7
+ memo.gsub(regexp) do |match|
8
+ "#{$1}\"#{$2}\""
9
+ end
10
+ end
11
+ end
12
+ end
13
+
14
+ def handle_has_sources(io, building_block)
15
+ if building_block.kind_of?(Cxxproject::HasSources)
16
+ io.puts "pushd \"#{building_block.project_dir}\""
17
+ Dir.chdir(building_block.project_dir) do
18
+ building_block.collect_sources_and_toolchains.each do |source, toolchain|
19
+ io.puts escape_spaces(building_block.calc_command_line_for_source(source, toolchain)[0]).join(' ')
20
+ end
21
+ end
22
+ io.puts building_block.calc_command_line.join(' ')
23
+ io.puts "popd"
24
+ end
25
+ end
26
+
27
+ directory ruby_dsl.build_dir
28
+
29
+ desc 'create a makefile'
30
+ task :tomake => ruby_dsl.build_dir do
31
+ io = StringIO.new
32
+ io.puts('#!/bin/sh -ev')
33
+ Cxxproject::sorted_building_blocks.each do |building_block|
34
+ handle_has_sources(io, building_block)
35
+ end
36
+ File.open('make.sh', 'w') do |out|
37
+ out.write(io.string)
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,3 @@
1
+ module CxxprojectTomake
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cxxproject_tomake
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Christian Köstlin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cxx
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: haml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: creates simple makefiles for cxxprojects as fallback
42
+ email:
43
+ - christian.koestlin@esrlabs.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - LICENSE
49
+ - README.md
50
+ - lib/cxxproject_tomake.rb
51
+ - lib/cxxproject_tomake/plugin.rb
52
+ - lib/cxxproject_tomake/version.rb
53
+ homepage: http://marcmo.github.com/cxxproject/
54
+ licenses: []
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.5.1
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: "..."
76
+ test_files: []