mcbuild 0.0.61 → 0.0.62
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mcbuild.rb +19 -13
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9754c48769d8ea820e342e05ed1bfd47ab6c9c3
|
4
|
+
data.tar.gz: 040553fb6de7447d594999676bec57f0a4ab2ea1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 201841f31a445284b406fb4bf956d5aad04af04f4506e97686c1e38254dbd22ec788c56a08ed2173050116bf5a22cf9983c15ef6addaaf49311f3ca3a9ba252e
|
7
|
+
data.tar.gz: aed2aff46f2b148851f919fbc8789e414095c4edd458dd0cc7824671aa04bc80e3ed9be91ce8775b0e7694886db61db10253dfa80feb247935015c50958fc000
|
data/lib/mcbuild.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
require 'find'
|
3
3
|
require 'fileutils'
|
4
|
+
require 'colored'
|
4
5
|
|
5
6
|
class MCTarget
|
6
7
|
def self.RaspberryPi2
|
@@ -82,9 +83,9 @@ class MCBuild
|
|
82
83
|
end
|
83
84
|
}
|
84
85
|
}
|
85
|
-
puts "usage:"
|
86
|
+
puts "usage:".bold.cyan
|
86
87
|
valid_args.each { |arg|
|
87
|
-
puts "./build.rb #{arg}"
|
88
|
+
puts "./build.rb #{arg}".green
|
88
89
|
}
|
89
90
|
self
|
90
91
|
end
|
@@ -113,6 +114,11 @@ class MCBuild
|
|
113
114
|
self
|
114
115
|
end
|
115
116
|
|
117
|
+
def error_log(err)
|
118
|
+
puts "Error[#{@d}]: ".red + err.red
|
119
|
+
self
|
120
|
+
end
|
121
|
+
|
116
122
|
#remove the last slash from path
|
117
123
|
def remove_slash(str)
|
118
124
|
arr = str.split('/')
|
@@ -301,7 +307,7 @@ class MCBuild
|
|
301
307
|
puts " filename extension -> #{@fext}"
|
302
308
|
puts " output extension -> #{@oext}"
|
303
309
|
puts " archive extension -> #{@aext}"
|
304
|
-
puts " compile flags -> #{@flags}"
|
310
|
+
puts " compile flags -> #{@flags}".yellow
|
305
311
|
puts " source dir -> #{@d}"
|
306
312
|
puts " excludes -> #{self.excludes}"
|
307
313
|
puts "--------------------------------"
|
@@ -350,7 +356,7 @@ class MCBuild
|
|
350
356
|
Find.find(@d) { |header|
|
351
357
|
base = File.basename(header)
|
352
358
|
if @headers.include? base
|
353
|
-
puts "copying-> #{header}"
|
359
|
+
puts "copying-> #{header}".cyan
|
354
360
|
FileUtils.cp("#{header}", "#{@d}/#{@outpath}/archive/include")
|
355
361
|
end
|
356
362
|
}
|
@@ -367,9 +373,9 @@ class MCBuild
|
|
367
373
|
base = File.basename(header)
|
368
374
|
if (ext == ".h") && (!header.include? self.export_include_path)
|
369
375
|
if (except != nil) && (except.include? base)
|
370
|
-
puts "except: #{base}"
|
376
|
+
puts "except: #{base}".magenta
|
371
377
|
else
|
372
|
-
puts "copying-> #{header}"
|
378
|
+
puts "copying-> #{header}".cyan
|
373
379
|
FileUtils.cp("#{header}", self.export_include_path)
|
374
380
|
end
|
375
381
|
end
|
@@ -436,14 +442,14 @@ class MCBuild
|
|
436
442
|
base = File.basename(file, ext)
|
437
443
|
if ext == ".c" || ext == ".asm" || ext == ".S"
|
438
444
|
if (@excludes != nil) && (@excludes.include? base)
|
439
|
-
puts "exclude: #{base}"
|
445
|
+
puts "exclude: #{base}".magenta
|
440
446
|
else
|
441
447
|
compile_file(file)
|
442
448
|
end
|
443
449
|
end
|
444
450
|
}
|
445
451
|
rescue Exception => e
|
446
|
-
|
452
|
+
error_log(e)
|
447
453
|
end
|
448
454
|
self
|
449
455
|
end
|
@@ -464,7 +470,7 @@ class MCBuild
|
|
464
470
|
system(cmd)
|
465
471
|
self
|
466
472
|
else
|
467
|
-
|
473
|
+
error_log('please use set_shared(true) before archive so')
|
468
474
|
nil
|
469
475
|
end
|
470
476
|
end
|
@@ -481,7 +487,7 @@ class MCBuild
|
|
481
487
|
FileUtils.mkdir_p("#{@d}/#{path}")
|
482
488
|
FileUtils.cp("#{self.export_lib_path}/lib#{@name}#{@aext}", "#{@d}/#{path}")
|
483
489
|
rescue Exception => e
|
484
|
-
|
490
|
+
error_log(e)
|
485
491
|
end
|
486
492
|
self
|
487
493
|
end
|
@@ -491,7 +497,7 @@ class MCBuild
|
|
491
497
|
FileUtils.mkdir_p("#{@d}/#{path}")
|
492
498
|
FileUtils.cp("#{self.export_lib_path}/lib#{@name}.so", "#{@d}/#{path}")
|
493
499
|
rescue Exception => e
|
494
|
-
|
500
|
+
error_log(e)
|
495
501
|
end
|
496
502
|
self
|
497
503
|
end
|
@@ -501,8 +507,8 @@ class MCBuild
|
|
501
507
|
end
|
502
508
|
|
503
509
|
def done
|
504
|
-
puts "---------- build finished ----------"
|
505
|
-
puts "#{self.export_lib_path}/#{name}"
|
510
|
+
puts "---------- build finished ----------".green
|
511
|
+
puts "#{self.export_lib_path}/#{name}".green
|
506
512
|
end
|
507
513
|
end
|
508
514
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mcbuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.62
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sun Yuli
|
@@ -9,21 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2016-09-17 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: colored
|
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'
|
12
|
+
dependencies: []
|
27
13
|
description:
|
28
14
|
email: sunpaq@gmail.com
|
29
15
|
executables: []
|
@@ -41,12 +27,12 @@ require_paths:
|
|
41
27
|
- lib
|
42
28
|
required_ruby_version: !ruby/object:Gem::Requirement
|
43
29
|
requirements:
|
44
|
-
- -
|
30
|
+
- - ">="
|
45
31
|
- !ruby/object:Gem::Version
|
46
32
|
version: '0'
|
47
33
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
34
|
requirements:
|
49
|
-
- -
|
35
|
+
- - ">="
|
50
36
|
- !ruby/object:Gem::Version
|
51
37
|
version: '0'
|
52
38
|
requirements: []
|