dev_tasks 0.0.163 → 0.0.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README +15 -5
- data/lib/add.rb +13 -3
- data/lib/color.rb +1 -1
- data/lib/command.rb +47 -0
- data/lib/commandarray.rb +12 -0
- data/lib/commands.rb +11 -16
- data/lib/console.rb +16 -0
- data/lib/dependencies.rb +9 -4
- data/lib/dev_tasks.rb +3 -15
- data/lib/environment.rb +6 -1
- data/lib/htmllog.rb +53 -0
- data/lib/jsonlog.rb +18 -0
- data/lib/logger.rb +37 -0
- data/lib/msbuild.rb +7 -5
- data/lib/spec.json +1 -1
- data/lib/yamllog.rb +18 -0
- data/spec/command_spec.rb +58 -0
- data/spec/dependencies_spec.rb +15 -10
- data/spec/dev_tasks_spec.rb +31 -24
- data/spec/msbuild_spec.rb +1 -1
- data/spec/test_data/cpp_projects/helloLib/DEV.default..json +76 -0
- data/spec/test_data/cpp_projects/helloLib/rakefile.rb +2 -1
- data/spec/test_data/csharp_projects/helloDll/DEV.default..json +79 -0
- metadata +25 -28
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 50c941ccd13a48379a5f0af1ba5415d2a54cbf28
|
4
|
+
data.tar.gz: 1a91761d63c5bae3bcb04852d00addcf87fd72f2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8b88becd6aadc237d2403ec5c6141f9c2f004ffe5c91b3a64572ec28087530e6585228ac8805ab5032c348f313bd25ed53a95fc1bae1ec489dcb06d38662804a
|
7
|
+
data.tar.gz: b47439a93c8c996f8b6219ad1f0e474c22218765c04ff120dfbd84bae6adf0c8754205527acff70f437836fb5307ab209f8cbe507fcdac4e4656180aecc23beb
|
data/README
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
=dev_tasks {<img src="https://badge.fury.io/rb/dev_tasks.png" alt="Gem Version" />}[http://badge.fury.io/rb/dev_tasks]
|
2
|
-
A gem
|
2
|
+
A ruby gem to aid in the definition of various rake tasks.
|
3
|
+
The dev_tasks gem defines a constant DEV
|
3
4
|
|
4
5
|
==Installation
|
5
6
|
The gem can be installed by the single command
|
@@ -9,11 +10,20 @@ The gem can be installed by the single command
|
|
9
10
|
This is an example of a simple usage
|
10
11
|
require 'dev_tasks'
|
11
12
|
|
13
|
+
==Keys
|
14
|
+
DEV[:files][:source]
|
15
|
+
DEV[:commands][:add]
|
16
|
+
An array of commands to add revision control tracking for files.
|
17
|
+
|
18
|
+
==CommandArrays
|
19
|
+
DEV[:commands][:add]
|
20
|
+
|
21
|
+
|
22
|
+
|
12
23
|
==Tasks
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
is defined.
|
24
|
+
[:add] - tracks all untracked git or subversion files defined by DEV[:files][:source]
|
25
|
+
:build - tracks all untracked git or subversion files defined by DEV[:files][:source]
|
26
|
+
|
17
27
|
|
18
28
|
==License
|
19
29
|
Copyright 2014 Lou Parslow
|
data/lib/add.rb
CHANGED
@@ -2,11 +2,21 @@ require_relative './commandarray.rb'
|
|
2
2
|
|
3
3
|
class Add < CommandArray
|
4
4
|
|
5
|
+
# updates the commands in the Add CommandArray
|
6
|
+
#
|
7
|
+
# if a .git directory exists, the command 'git add -A -v' will be appended the Add Commands
|
8
|
+
# if a .svn directory exists, all DEV[:files][:source] files that are not tracked by subversion
|
9
|
+
# will have the appropriate svn add command appended to the Add Commands
|
5
10
|
def update
|
6
11
|
if(Dir.exists?(".git"))
|
7
|
-
|
8
|
-
|
9
|
-
|
12
|
+
DEV_TASKS[:files][:source].each{|f|
|
13
|
+
if(`git status #{f}`.include?('untracked'))
|
14
|
+
add "git add #{f} -v"
|
15
|
+
end
|
16
|
+
}
|
17
|
+
#if(`git status`.include?('untracked files present'))
|
18
|
+
# self.add 'git add -A -v'
|
19
|
+
#end
|
10
20
|
end
|
11
21
|
if(Dir.exists?(".svn") && defined?(DEV_TASKS))
|
12
22
|
DEV_TASKS[:files][:source].each{|f|
|
data/lib/color.rb
CHANGED
data/lib/command.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
class Command < Hash
|
2
|
+
def initialize command
|
3
|
+
self[:input] = command
|
4
|
+
self[:timeout] = 0
|
5
|
+
self[:directory] = ''
|
6
|
+
self[:exit_code] = 0
|
7
|
+
self[:output] = ''
|
8
|
+
self[:error] = ''
|
9
|
+
self[:machine_name] = ''
|
10
|
+
self[:user_name] = ''
|
11
|
+
self[:start_time] = nil
|
12
|
+
self[:end_time] = nil
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
def execute
|
17
|
+
|
18
|
+
Logger.start_command self
|
19
|
+
|
20
|
+
#print " " + Color.green + self[:input] + Color.clear
|
21
|
+
|
22
|
+
self[:start_time]=Time.now
|
23
|
+
timer=Timer.new
|
24
|
+
if self[:input].include?('<%') && self[:input].include?('%>')
|
25
|
+
ruby = self[:input].gsub("<%","").gsub("%>","")
|
26
|
+
self[:output]=eval(ruby)
|
27
|
+
#puts " " + timer.elapsed_str
|
28
|
+
self[:elapsed] = timer.elapsed_str
|
29
|
+
self[:end_time] = Time.now
|
30
|
+
else
|
31
|
+
self[:output] = `#{self[:input]}`
|
32
|
+
self[:elapsed] = timer.elapsed_str
|
33
|
+
self[:end_time] = Time.now
|
34
|
+
self[:exit_code]=$?
|
35
|
+
#if $? != 0
|
36
|
+
# puts self[:output]
|
37
|
+
# raise Color.yellow + "`" + Color.green + self[:input] + Color.yellow + "`" + Color.clear +
|
38
|
+
# " has exit code " + $?.to_s + " " + out
|
39
|
+
#else
|
40
|
+
# puts " " + timer.elapsed_str
|
41
|
+
#end
|
42
|
+
end
|
43
|
+
|
44
|
+
Logger.end_command self
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
data/lib/commandarray.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require_relative './command.rb'
|
2
|
+
|
1
3
|
class CommandArray < Array
|
2
4
|
|
3
5
|
def update
|
@@ -6,4 +8,14 @@ class CommandArray < Array
|
|
6
8
|
def add command
|
7
9
|
self << command if(!include?(command))
|
8
10
|
end
|
11
|
+
|
12
|
+
def execute
|
13
|
+
i=0
|
14
|
+
while i < self.length
|
15
|
+
self[i]=Command.new(self[i]) if(self[i].is_a?(String))
|
16
|
+
self[i].execute
|
17
|
+
i=i+1
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
9
21
|
end
|
data/lib/commands.rb
CHANGED
@@ -34,26 +34,21 @@ class Commands < Hash
|
|
34
34
|
self[:publish].update
|
35
35
|
end
|
36
36
|
|
37
|
-
def
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
else
|
46
|
-
out = `#{command}`
|
47
|
-
if $? != 0
|
48
|
-
puts out
|
49
|
-
raise Color.yellow + "`" + Color.green + command + Color.yellow + "`" + Color.clear +
|
50
|
-
" has exit code " + $?.to_s + " " + out
|
37
|
+
def execute_task task
|
38
|
+
sym_task = task.to_sym
|
39
|
+
if(self.has_key?(sym_task))
|
40
|
+
self[sym_task].update
|
41
|
+
if(self[sym_task].length>0)
|
42
|
+
Logger.start_task task
|
43
|
+
self[sym_task].execute
|
44
|
+
Logger.end_task task
|
51
45
|
else
|
52
|
-
|
46
|
+
self.delete sym_task
|
53
47
|
end
|
54
|
-
|
48
|
+
end
|
55
49
|
end
|
56
50
|
|
51
|
+
|
57
52
|
def show
|
58
53
|
self.each do |key,array|
|
59
54
|
if(array.length > 0)
|
data/lib/console.rb
CHANGED
@@ -29,6 +29,22 @@ class Console
|
|
29
29
|
puts " "
|
30
30
|
end
|
31
31
|
|
32
|
+
def self.start_command command
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.end_command command
|
37
|
+
|
38
|
+
if command[:exit_code] != 0
|
39
|
+
print " " + Color.green + command[:input] + Color.clear
|
40
|
+
puts command[:output]
|
41
|
+
raise Color.yellow + "`" + Color.green + command[:input] + Color.yellow + "`" + Color.clear +
|
42
|
+
" has exit code " + command[:exit_code].to_s + " " + command[:output]
|
43
|
+
else
|
44
|
+
puts command[:input] + " " + command[:elapsed]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
32
48
|
def self.print_hash(indent,hash)
|
33
49
|
max_length=0
|
34
50
|
hash.each { |name,value| max_length=name.to_s.length if name.to_s.length > max_length }
|
data/lib/dependencies.rb
CHANGED
@@ -22,13 +22,18 @@ class Dependencies < Hash
|
|
22
22
|
cs_system_deps=Array.new
|
23
23
|
cs_file_deps=Array.new
|
24
24
|
Dir.glob("**/*.rb").each{|f|
|
25
|
-
text=File.read(f)
|
25
|
+
text=File.read(f,:encoding=>'UTF-8')
|
26
26
|
ruby_deps=ruby_deps|Dependencies.ruby_dependencies(text)
|
27
27
|
}
|
28
28
|
Dir.glob("*.csproj").each{|f|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
begin
|
30
|
+
text=File.read(f,:encoding=>'UTF-8')
|
31
|
+
cs_system_deps=cs_system_deps|Dependencies.csharp_system_dependencies(text)
|
32
|
+
cs_file_deps=cs_file_deps|Dependencies.csharp_file_dependencies(text)
|
33
|
+
rescue Exception => ex
|
34
|
+
puts "Exception raised while scanning " + f + " for dependencies"
|
35
|
+
raise ex
|
36
|
+
end
|
32
37
|
}
|
33
38
|
|
34
39
|
self[:ruby]=ruby_deps.sort if(ruby_deps.length>0)
|
data/lib/dev_tasks.rb
CHANGED
@@ -11,6 +11,7 @@ require_relative './timer.rb'
|
|
11
11
|
require_relative './settings.rb'
|
12
12
|
require_relative './text.rb'
|
13
13
|
require_relative './svnexports.rb'
|
14
|
+
require_relative './logger.rb'
|
14
15
|
|
15
16
|
CLEAN.include('log','bin/**/*.pdb')
|
16
17
|
CLOBBER.include('bin','obj','TestResults','*.gem','bin/**/*.exe')
|
@@ -84,21 +85,7 @@ class DevTasks < Hash
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def execute_task task
|
87
|
-
|
88
|
-
timer=Timer.new
|
89
|
-
Console.announce_task_start task
|
90
|
-
#self[:commands][sym_task].update if self[:commands][sym_task].respond_to? update
|
91
|
-
if(!self[:commands].has_key?(sym_task))
|
92
|
-
puts "no commands discovered for task " + task
|
93
|
-
else
|
94
|
-
self[:commands][sym_task].update
|
95
|
-
self[:commands][sym_task].each {|c| self[:commands].execute_command(c) }
|
96
|
-
end
|
97
|
-
elapsed = timer.elapsed
|
98
|
-
if elapsed > 30
|
99
|
-
elapsed_str="[" + "%.0f" %(elapsed) + "s]"
|
100
|
-
Console.announce_task_end task, elapsed_str
|
101
|
-
end
|
88
|
+
self[:commands].execute_task task
|
102
89
|
end
|
103
90
|
|
104
91
|
def define_task task_name
|
@@ -165,6 +152,7 @@ end
|
|
165
152
|
desc 'dev_tasks default'
|
166
153
|
task :default do
|
167
154
|
Rake::Task[:dev_tasks_default].invoke
|
155
|
+
Logger.finalize
|
168
156
|
end
|
169
157
|
|
170
158
|
desc 'displays information about current rake directory'
|
data/lib/environment.rb
CHANGED
@@ -78,7 +78,12 @@ class Environment < Hash
|
|
78
78
|
machine = `hostname`
|
79
79
|
machine = machine.split('.')[0] if machine.include?('.')
|
80
80
|
return machine.strip
|
81
|
-
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.user
|
84
|
+
return ENV['USER'] if !ENV['USER'].nil? #on Unix
|
85
|
+
ENV['USERNAME']
|
86
|
+
end
|
82
87
|
|
83
88
|
def self.working_directory
|
84
89
|
Rake.application.original_dir
|
data/lib/htmllog.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
class HtmlLog
|
2
|
+
def initialize
|
3
|
+
FileUtils.mkdir('log') if !File.exists?('log')
|
4
|
+
@file=File.open('log/rake.html','w')
|
5
|
+
@file.write '<html>'
|
6
|
+
@file.write '<body>'
|
7
|
+
@file.write '<h1>'
|
8
|
+
@file.write "rake"
|
9
|
+
ARGV.each do|a|
|
10
|
+
puts " #{a}"
|
11
|
+
end
|
12
|
+
@file.write '</h1>'
|
13
|
+
@file.write '<h2>directory:' + File.dirname(__FILE__) + '</h2>'
|
14
|
+
@file.write '<h2>time:' + Time.now.to_s + '</h2>'
|
15
|
+
@current_task=nil
|
16
|
+
@task_commands=Hash.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def finalize
|
20
|
+
@file.write('<ul>')
|
21
|
+
@task_commands.each{|k,v|
|
22
|
+
|
23
|
+
@file.write('<li>')
|
24
|
+
@file.write(k)
|
25
|
+
@file.write('</li>')
|
26
|
+
|
27
|
+
}
|
28
|
+
@file.write '</ul>'
|
29
|
+
@file.write '</body>'
|
30
|
+
@file.write '</html>'
|
31
|
+
@file.close
|
32
|
+
end
|
33
|
+
|
34
|
+
def start_task task
|
35
|
+
@current_task=task
|
36
|
+
@task_commands[task]=Hash.new
|
37
|
+
@task_commands[task][:command_results]=Array.new
|
38
|
+
end
|
39
|
+
|
40
|
+
def end_task task
|
41
|
+
|
42
|
+
@current_task=nil
|
43
|
+
#@file
|
44
|
+
end
|
45
|
+
|
46
|
+
def start_command command
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
def end_command command
|
51
|
+
#@task_commands[@current_task][:command_results] << result
|
52
|
+
end
|
53
|
+
end
|
data/lib/jsonlog.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
class JsonLog
|
4
|
+
def initialize
|
5
|
+
end
|
6
|
+
|
7
|
+
def finalize
|
8
|
+
name='DEV'
|
9
|
+
ARGV.each do|a|
|
10
|
+
name="#{name}.#{a}"
|
11
|
+
end
|
12
|
+
name="#{name}.json"
|
13
|
+
FileUtils.mkdir('log') if !File.exists?('log')
|
14
|
+
File.open("log/#{name}","w") do |f|
|
15
|
+
f.write(JSON.pretty_generate(DEV))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/logger.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative './htmllog.rb'
|
2
|
+
require_relative './jsonlog.rb'
|
3
|
+
require_relative './yamllog.rb'
|
4
|
+
|
5
|
+
class Logger
|
6
|
+
@@timers=Hash.new
|
7
|
+
@@html_log=HtmlLog.new
|
8
|
+
@@json_log=JsonLog.new
|
9
|
+
@@yaml_log=YamlLog.new
|
10
|
+
def self.start_task task
|
11
|
+
@@timers[task]=Timer.new
|
12
|
+
Console.announce_task_start task
|
13
|
+
@@html_log.start_task task
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.end_task task
|
17
|
+
elapsed=@@timers[task].elapsed
|
18
|
+
@@html_log.end_task task
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.finalize
|
22
|
+
@@html_log.finalize
|
23
|
+
@@json_log.finalize
|
24
|
+
@@yaml_log.finalize
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.start_command command
|
28
|
+
Console.start_command command
|
29
|
+
//
|
30
|
+
@@html_log.start_command command
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.end_command command
|
34
|
+
Console.end_command command
|
35
|
+
@@html_log.end_command command
|
36
|
+
end
|
37
|
+
end
|
data/lib/msbuild.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require_relative './color.rb'
|
2
4
|
|
3
5
|
# Visual Studio 2008 version 9.0, solution format version 10.00
|
@@ -12,7 +14,7 @@ class MSBuild < Hash
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def self.get_vs_version(sln_filename)
|
15
|
-
sln_text=File.read(sln_filename)
|
17
|
+
sln_text=File.read(sln_filename,:encoding=>'UTF-8')
|
16
18
|
sln_text.scan(/Format Version 10.00/).each{|m|
|
17
19
|
return :vs9
|
18
20
|
}
|
@@ -21,8 +23,8 @@ class MSBuild < Hash
|
|
21
23
|
|
22
24
|
def self.get_configurations(sln_filename)
|
23
25
|
configs=Array.new
|
24
|
-
|
25
|
-
sln_text.scan(/= ([\w]+)\|/).each{|m|
|
26
|
+
sln_text=File.read(sln_filename,:encoding=>'UTF-8')
|
27
|
+
sln_text.scan( /= ([\w]+)\|/ ).each{|m|
|
26
28
|
c=m.first.to_s
|
27
29
|
configs << c if !configs.include?(c)
|
28
30
|
}
|
@@ -31,8 +33,8 @@ class MSBuild < Hash
|
|
31
33
|
|
32
34
|
def self.get_platforms(sln_filename)
|
33
35
|
platforms=Array.new
|
34
|
-
|
35
|
-
sln_text.scan(/= [\w]+\|([\w ]+)/).each{|m|
|
36
|
+
sln_text=File.read(sln_filename,:encoding=>"UTF-8").gsub!( /\P{ASCII}/ , '')
|
37
|
+
sln_text.scan( /= [\w]+\|([\w ]+)/ ).each{|m|
|
36
38
|
p=m.first.to_s
|
37
39
|
platforms << p if !platforms.include?(p)
|
38
40
|
}
|
data/lib/spec.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"dev_tasks","version":"0.0.
|
1
|
+
{"name":"dev_tasks","version":"0.0.164"}
|
data/lib/yamllog.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
class YamlLog
|
4
|
+
def initialize
|
5
|
+
end
|
6
|
+
|
7
|
+
def finalize
|
8
|
+
name='DEV'
|
9
|
+
ARGV.each do|a|
|
10
|
+
name="#{name}.#{a}"
|
11
|
+
end
|
12
|
+
name="#{name}.yml"
|
13
|
+
FileUtils.mkdir('log') if !File.exists?('log')
|
14
|
+
File.open("log/#{name}","w") do |f|
|
15
|
+
f.write(DEV.to_yaml)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require_relative '../lib/command.rb'
|
2
|
+
|
3
|
+
describe Command do
|
4
|
+
it "should be able to execute ruby --version command" do
|
5
|
+
cmd=Command.new("ruby --version")
|
6
|
+
# Timeout
|
7
|
+
expect(cmd[:timeout]).to eq(0)
|
8
|
+
cmd[:timeout]=3000
|
9
|
+
expect(cmd[:timeout]).to eq(3000)
|
10
|
+
|
11
|
+
# Directory
|
12
|
+
expect(cmd[:directory]).to eq("")
|
13
|
+
cmd[:directory] = File.dirname(__FILE__)
|
14
|
+
expect(cmd[:directory]).to eq(File.dirname(__FILE__))
|
15
|
+
|
16
|
+
# ExitCode
|
17
|
+
expect(cmd[:exit_code]).to eq(0)
|
18
|
+
cmd[:exit_code] = 1
|
19
|
+
expect(cmd[:exit_code]).to eq(1)
|
20
|
+
|
21
|
+
# Input
|
22
|
+
expect(cmd[:input]).to eq("ruby --version")
|
23
|
+
cmd2 = Command.new('')
|
24
|
+
expect(cmd2[:input]).to eq('')
|
25
|
+
|
26
|
+
# Output
|
27
|
+
expect(cmd[:output]).to eq('')
|
28
|
+
cmd[:output]='test'
|
29
|
+
expect(cmd[:output]).to eq('test')
|
30
|
+
|
31
|
+
# Error
|
32
|
+
expect(cmd[:error]).to eq('')
|
33
|
+
cmd[:error]='error_test'
|
34
|
+
expect(cmd[:error]).to eq('error_test')
|
35
|
+
|
36
|
+
# MachineName
|
37
|
+
expect(cmd[:machine_name]).to eq('')
|
38
|
+
cmd[:machine_name]='machine_name_test'
|
39
|
+
expect(cmd[:machine_name]).to eq('machine_name_test')
|
40
|
+
|
41
|
+
# UserName
|
42
|
+
expect(cmd[:user_name]).to eq('')
|
43
|
+
cmd[:user_name]='user_name_test'
|
44
|
+
expect(cmd[:user_name]).to eq('user_name_test')
|
45
|
+
|
46
|
+
# StartTime
|
47
|
+
expect(cmd[:start_time]).to eq(nil)
|
48
|
+
cmd[:start_time]=Time.now
|
49
|
+
expect(cmd[:start_time]).not_to eq(nil)
|
50
|
+
|
51
|
+
# EndTime
|
52
|
+
expect(cmd[:end_time]).to eq(nil)
|
53
|
+
cmd[:end_time]=Time.now
|
54
|
+
expect(cmd[:end_time]).not_to eq(nil)
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
data/spec/dependencies_spec.rb
CHANGED
@@ -1,23 +1,28 @@
|
|
1
1
|
require_relative '../lib/dependencies.rb'
|
2
2
|
|
3
3
|
describe Dependencies do
|
4
|
+
|
4
5
|
it "should be able to extract C# system dependencies" do
|
5
|
-
system_deps = Dependencies.csharp_system_dependencies File.read(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
system_deps = Dependencies.csharp_system_dependencies File.read(
|
7
|
+
"#{File.dirname(__FILE__)}/test_data/csharp_projects/JsonNet.Test.csproj",
|
8
|
+
:encoding=>'UTF-8')
|
9
|
+
expect(system_deps.length).to eq(7)
|
10
|
+
expect(system_deps.include?('System')).to eq(true)
|
11
|
+
expect(system_deps.include?('System.Xml')).to eq(true)
|
12
|
+
expect(system_deps.include?('Microsoft.CSharp')).to eq(true)
|
10
13
|
end
|
11
14
|
|
12
15
|
it "should be able to extract C# file dependencies" do
|
13
|
-
system_deps = Dependencies.csharp_file_dependencies File.read(
|
14
|
-
|
15
|
-
|
16
|
+
system_deps = Dependencies.csharp_file_dependencies File.read(
|
17
|
+
"#{File.dirname(__FILE__)}/test_data/csharp_projects/JsonNet.Test.csproj",
|
18
|
+
:encoding=>'UTF-8')
|
19
|
+
expect(system_deps.length).to eq(2)
|
20
|
+
expect(system_deps.include?('dep\github\lou-parslow\NetLibs\develop\NUnit\2.6.3\bin\framework\nunit.framework.dll')).to eq(true)
|
16
21
|
end
|
17
22
|
|
18
23
|
it "should be able to extract ruby dependencies" do
|
19
24
|
system_deps = Dependencies.ruby_dependencies File.read("#{File.dirname(__FILE__)}/test_data/example.rb")
|
20
|
-
|
21
|
-
|
25
|
+
expect(system_deps.length).to eq(2)
|
26
|
+
expect(system_deps.include?('json')).to eq(true)
|
22
27
|
end
|
23
28
|
end
|
data/spec/dev_tasks_spec.rb
CHANGED
@@ -8,31 +8,38 @@ describe DevTasks do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
Dir.chdir("#{File.dirname(__FILE__)}/test_data/csharp_projects/helloDll") do
|
13
|
-
dev_task=DevTasks.new
|
14
|
-
expect(dev_task[:name]).to eq('helloDll')
|
15
|
-
#expect(dev_task[:artifact_files].length).to eq(3)
|
16
|
-
end
|
17
|
-
dir="#{File.dirname(__FILE__)}/test_data/csharp_projects/helloDll"
|
18
|
-
Environment.rake(dir,"default",false)
|
19
|
-
File.exists?("#{dir}/bin/Net4.0/Debug/helloDll.dll").should eq(true)
|
20
|
-
File.exists?("#{dir}/bin/Net4.5/Release/helloDll.dll").should eq(true)
|
21
|
-
end
|
11
|
+
if(RUBY_PLATFORM.include?("mingw"))
|
22
12
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
it "should be able to load example C# project" do
|
14
|
+
Dir.chdir("#{File.dirname(__FILE__)}/test_data/csharp_projects/helloDll") do
|
15
|
+
dev_task=DevTasks.new
|
16
|
+
expect(dev_task[:name]).to eq('helloDll')
|
17
|
+
end
|
18
|
+
dir="#{File.dirname(__FILE__)}/test_data/csharp_projects/helloDll"
|
19
|
+
expect(File.exists?(dir)).to eq(true)
|
20
|
+
Environment.rake(dir,"default",false)
|
28
21
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
22
|
+
if(!RUBY_PLATFORM.include?("mingw"))
|
23
|
+
expect(File.exists?("#{dir}/bin/Net4.0/Debug/helloDll.dll")).to eq(true)
|
24
|
+
expect(File.exists?("#{dir}/bin/Net4.5/Release/helloDll.dll")).to eq(true)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
it "should be able to rake cpp static library" do
|
28
|
+
dir="#{File.dirname(__FILE__)}/test_data/cpp_projects/helloLib"
|
29
|
+
|
30
|
+
Environment.rake(dir,"clobber",false)
|
31
|
+
#File.exists?("#{dir}/bin").should eq(false)
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
Environment.rake(dir,"default",false)
|
34
|
+
if(RUBY_PLATFORM.include?("mingw"))
|
35
|
+
expect(File.exists?("#{dir}/bin/v90/Debug/helloLib.v9.lib")).to eq(true)
|
36
|
+
expect(File.exists?("#{dir}/bin/v90/Release/helloLib.v9.lib")).to eq(true)
|
37
|
+
expect(File.exists?("#{dir}/bin/v120/Debug/helloLib.v12.lib")).to eq(true)
|
38
|
+
expect(File.exists?("#{dir}/bin/v120/Release/helloLib.v12.lib")).to eq(true)
|
39
|
+
end
|
40
|
+
|
41
|
+
Environment.rake(dir,"clobber",false)
|
42
|
+
#File.exists?("#{dir}/bin").should eq(false)
|
43
|
+
end
|
44
|
+
end
|
38
45
|
end
|
data/spec/msbuild_spec.rb
CHANGED
@@ -4,6 +4,6 @@ describe MSBuild do
|
|
4
4
|
|
5
5
|
it "should have be able extract 'Any CPU' platform from sln file" do
|
6
6
|
platforms=MSBuild.get_platforms("#{File.dirname(__FILE__)}/test_data/csharp_projects/helloDll/helloDll.sln")
|
7
|
-
platforms.include?('Any CPU').
|
7
|
+
expect(platforms.include?('Any CPU')).to eq(true)
|
8
8
|
end
|
9
9
|
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
{
|
2
|
+
"name": "helloLib",
|
3
|
+
"svn_exports": {
|
4
|
+
},
|
5
|
+
"scm": "none",
|
6
|
+
"scm_origin": "",
|
7
|
+
"branch": null,
|
8
|
+
"command_order": [
|
9
|
+
"pull",
|
10
|
+
"upgrade",
|
11
|
+
"setup",
|
12
|
+
"add",
|
13
|
+
"build",
|
14
|
+
"test",
|
15
|
+
"commit",
|
16
|
+
"push",
|
17
|
+
"verify",
|
18
|
+
"publish"
|
19
|
+
],
|
20
|
+
"relative_directory": "lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib",
|
21
|
+
"working_directory": "/Users/louie/wrk/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib",
|
22
|
+
"context": "wrk",
|
23
|
+
"machine": "bluefin",
|
24
|
+
"platform": "universal.x86_64-darwin14",
|
25
|
+
"dev_root": "/Users/louie",
|
26
|
+
"settings": {
|
27
|
+
"colorize": true
|
28
|
+
},
|
29
|
+
"files": {
|
30
|
+
"source": "helloLib.cpp helloLib.h helloLib.v12.sln helloLib.v12.vcxproj helloLib.v12.vcxproj.filters helloLib.v9.sln helloLib.v9.vcproj rakefile.rb",
|
31
|
+
"build": "helloLib.v12.sln helloLib.v9.sln",
|
32
|
+
"artifact": "helloLib.h"
|
33
|
+
},
|
34
|
+
"commands": {
|
35
|
+
"upgrade": [
|
36
|
+
|
37
|
+
],
|
38
|
+
"setup": [
|
39
|
+
"svnadmin --help",
|
40
|
+
"svnadmin create repo"
|
41
|
+
],
|
42
|
+
"build": [
|
43
|
+
|
44
|
+
],
|
45
|
+
"test": [
|
46
|
+
|
47
|
+
],
|
48
|
+
"add": [
|
49
|
+
|
50
|
+
],
|
51
|
+
"commit": [
|
52
|
+
|
53
|
+
],
|
54
|
+
"push": [
|
55
|
+
|
56
|
+
],
|
57
|
+
"verify": [
|
58
|
+
|
59
|
+
],
|
60
|
+
"publish": [
|
61
|
+
"svn mkdir file:////Users/louie/wrk/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib/repo/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib-0 --parents -m\"publish\"",
|
62
|
+
"svn checkout file:////Users/louie/wrk/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib/repo/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib-0 /Users/louie/tmp/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib@0",
|
63
|
+
"<%Environment.copy_files(DEV_TASKS[:files][:artifact],'/Users/louie/tmp/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib@0')%>",
|
64
|
+
"<%Environment.svn_add_all('/Users/louie/tmp/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib@0')%>",
|
65
|
+
"svn commit /Users/louie/tmp/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib@0@ -m\"publish\"",
|
66
|
+
"<%FileUtils.rm_r('/Users/louie/tmp/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib@0')%>"
|
67
|
+
]
|
68
|
+
},
|
69
|
+
"dependencies": {
|
70
|
+
},
|
71
|
+
"newest_source_file": "rakefile.rb",
|
72
|
+
"newest_artifact_file": "helloLib.h",
|
73
|
+
"up_to_date": false,
|
74
|
+
"debug": true,
|
75
|
+
"publish_path": "file:////Users/louie/wrk/lep-open/DevTasksGem/spec/test_data/cpp_projects/helloLib/repo"
|
76
|
+
}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
require_relative '../../../../lib/dev_tasks.rb'
|
2
2
|
|
3
3
|
DEV[:debug]=true
|
4
|
+
DEV[:commands][:setup] << "svnadmin --help"
|
4
5
|
DEV[:commands][:setup] << "svnadmin create repo" if(!File.exists?('repo'))
|
5
6
|
DEV[:publish_path]="file:///#{DEV[:working_directory]}/repo"
|
6
7
|
CLEAN.include("**.*.{suo,cache,ncb,user,opensdf}","obj")
|
7
|
-
CLOBBER.include("bin","repo","#{Environment.dev_root}/tmp/LEP-open")
|
8
|
+
CLOBBER.include("bin","repo","#{Environment.dev_root}/tmp/LEP-open")
|
@@ -0,0 +1,79 @@
|
|
1
|
+
{
|
2
|
+
"name": "helloDll",
|
3
|
+
"svn_exports": {
|
4
|
+
},
|
5
|
+
"scm": "none",
|
6
|
+
"scm_origin": "",
|
7
|
+
"branch": null,
|
8
|
+
"command_order": [
|
9
|
+
"pull",
|
10
|
+
"upgrade",
|
11
|
+
"setup",
|
12
|
+
"add",
|
13
|
+
"build",
|
14
|
+
"test",
|
15
|
+
"commit",
|
16
|
+
"push",
|
17
|
+
"verify",
|
18
|
+
"publish"
|
19
|
+
],
|
20
|
+
"relative_directory": "lep-open/DevTasksGem/spec/test_data/csharp_projects/helloDll",
|
21
|
+
"working_directory": "/Users/louie/wrk/lep-open/DevTasksGem/spec/test_data/csharp_projects/helloDll",
|
22
|
+
"context": "wrk",
|
23
|
+
"machine": "bluefin",
|
24
|
+
"platform": "universal.x86_64-darwin14",
|
25
|
+
"dev_root": "/Users/louie",
|
26
|
+
"settings": {
|
27
|
+
"colorize": true
|
28
|
+
},
|
29
|
+
"files": {
|
30
|
+
"source": "Properties/AssemblyInfo.cs helloDll.Net2.0.csproj helloDll.Net3.5.csproj helloDll.Net4.0.csproj helloDll.Net4.5.csproj helloDll.cs helloDll.sln rakefile.rb",
|
31
|
+
"build": "helloDll.sln",
|
32
|
+
"artifact": "bin/Net2.0/Debug/helloDll.dll bin/Net2.0/Release/helloDll.dll bin/Net3.5/Debug/helloDll.dll bin/Net3.5/Release/helloDll.dll bin/Net4.0/Debug/helloDll.dll bin/Net4.0/Release/helloDll.dll bin/Net4.5/Debug/helloDll.dll bin/Net4.5/Release/helloDll.dll obj/Debug/helloDll.dll obj/Release/helloDll.dll"
|
33
|
+
},
|
34
|
+
"commands": {
|
35
|
+
"upgrade": [
|
36
|
+
|
37
|
+
],
|
38
|
+
"setup": [
|
39
|
+
|
40
|
+
],
|
41
|
+
"build": [
|
42
|
+
|
43
|
+
],
|
44
|
+
"test": [
|
45
|
+
|
46
|
+
],
|
47
|
+
"add": [
|
48
|
+
|
49
|
+
],
|
50
|
+
"commit": [
|
51
|
+
|
52
|
+
],
|
53
|
+
"push": [
|
54
|
+
|
55
|
+
],
|
56
|
+
"verify": [
|
57
|
+
|
58
|
+
],
|
59
|
+
"publish": [
|
60
|
+
|
61
|
+
]
|
62
|
+
},
|
63
|
+
"dependencies": {
|
64
|
+
"C#": {
|
65
|
+
"system": [
|
66
|
+
"Microsoft.CSharp",
|
67
|
+
"System",
|
68
|
+
"System.Core",
|
69
|
+
"System.Data",
|
70
|
+
"System.Data.DataSetExtensions",
|
71
|
+
"System.Xml",
|
72
|
+
"System.Xml.Linq"
|
73
|
+
]
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"newest_source_file": "helloDll.Net2.0.csproj",
|
77
|
+
"newest_artifact_file": "bin/Net2.0/Debug/helloDll.dll",
|
78
|
+
"up_to_date": false
|
79
|
+
}
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dev_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.164
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Lou Parslow
|
@@ -14,81 +13,71 @@ dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: term-ansicolor
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: json
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rspec
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: json
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
description: defines rake tasks for ruby and C# projects
|
@@ -101,6 +90,7 @@ files:
|
|
101
90
|
- lib/artifacts.x.rb
|
102
91
|
- lib/build.rb
|
103
92
|
- lib/color.rb
|
93
|
+
- lib/command.rb
|
104
94
|
- lib/commandarray.rb
|
105
95
|
- lib/commands.rb
|
106
96
|
- lib/commit.rb
|
@@ -108,6 +98,9 @@ files:
|
|
108
98
|
- lib/dependencies.rb
|
109
99
|
- lib/dev_tasks.rb
|
110
100
|
- lib/environment.rb
|
101
|
+
- lib/htmllog.rb
|
102
|
+
- lib/jsonlog.rb
|
103
|
+
- lib/logger.rb
|
111
104
|
- lib/msbuild.rb
|
112
105
|
- lib/publish.rb
|
113
106
|
- lib/pull.rb
|
@@ -120,7 +113,9 @@ files:
|
|
120
113
|
- lib/timer.rb
|
121
114
|
- lib/upgrade.rb
|
122
115
|
- lib/verify.rb
|
116
|
+
- lib/yamllog.rb
|
123
117
|
- lib/spec.json
|
118
|
+
- spec/command_spec.rb
|
124
119
|
- spec/dependencies_spec.rb
|
125
120
|
- spec/dev_tasks_spec.rb
|
126
121
|
- spec/environment_spec.rb
|
@@ -130,6 +125,8 @@ files:
|
|
130
125
|
- spec/test_data/csharp_projects/helloDll/rakefile.rb
|
131
126
|
- spec/test_data/example.rb
|
132
127
|
- spec/test_data/ruby_project/rakefile.rb
|
128
|
+
- spec/test_data/cpp_projects/helloLib/DEV.default..json
|
129
|
+
- spec/test_data/csharp_projects/helloDll/DEV.default..json
|
133
130
|
- spec/test_data/csharp_projects/helloDll/helloDll.Net2.0.csproj
|
134
131
|
- spec/test_data/csharp_projects/helloDll/helloDll.Net3.5.csproj
|
135
132
|
- spec/test_data/csharp_projects/helloDll/helloDll.Net4.0.csproj
|
@@ -142,26 +139,26 @@ files:
|
|
142
139
|
homepage: http://rubygems.org/gems/dev_tasks
|
143
140
|
licenses:
|
144
141
|
- Apache 2.0
|
142
|
+
metadata: {}
|
145
143
|
post_install_message:
|
146
144
|
rdoc_options: []
|
147
145
|
require_paths:
|
148
146
|
- lib
|
149
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
-
none: false
|
151
148
|
requirements:
|
152
|
-
- -
|
149
|
+
- - '>='
|
153
150
|
- !ruby/object:Gem::Version
|
154
151
|
version: '0'
|
155
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
-
none: false
|
157
153
|
requirements:
|
158
|
-
- -
|
154
|
+
- - '>='
|
159
155
|
- !ruby/object:Gem::Version
|
160
156
|
version: '0'
|
161
157
|
requirements: []
|
162
158
|
rubyforge_project:
|
163
|
-
rubygems_version:
|
159
|
+
rubygems_version: 2.0.3
|
164
160
|
signing_key:
|
165
|
-
specification_version:
|
161
|
+
specification_version: 4
|
166
162
|
summary: development rake tasks
|
167
163
|
test_files: []
|
164
|
+
has_rdoc:
|