dev 2.0.268 → 2.0.269
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dev +1 -1
- data/lib/base/array.rb +34 -4
- data/lib/base/command.rb +101 -12
- data/lib/base/dir.rb +14 -8
- data/lib/base/environment.rb +169 -52
- data/lib/base/gemspec.rb +10 -2
- data/lib/base/history.rb +26 -1
- data/lib/base/project.rb +237 -121
- data/lib/base/projects.rb +130 -66
- data/lib/base/timeout.rb +54 -16
- data/lib/base/version.rb +54 -0
- data/lib/commands.rb +4 -2
- data/lib/dev.rb +50 -44
- data/lib/tasks.rb +20 -12
- data/lib/tasks/add.rb +8 -8
- data/lib/tasks/analyze.rb +1 -1
- data/lib/tasks/build.rb +25 -9
- data/lib/tasks/commit.rb +7 -7
- data/lib/tasks/default.rb +7 -1
- data/lib/tasks/doc.rb +1 -1
- data/lib/tasks/publish.rb +7 -11
- data/lib/tasks/pull.rb +1 -4
- data/lib/tasks/push.rb +2 -2
- data/lib/tasks/setup.rb +36 -15
- data/lib/tasks/test.rb +4 -5
- data/lib/tasks/update.rb +2 -2
- metadata +5 -5
data/lib/tasks.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
puts __FILE__ if defined?(DEBUG)
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
|
5
1
|
class Tasks
|
6
|
-
|
2
|
+
attr_accessor :env
|
3
|
+
@@default=nil
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
def initialize env=nil
|
6
|
+
@@default=self
|
7
|
+
@env=env
|
8
|
+
@env=Environment.new if @env.nil?
|
9
|
+
end
|
11
10
|
|
12
|
-
def
|
11
|
+
def execute value
|
13
12
|
if(value.respond_to?(:execute))
|
14
13
|
value.update if value.respond_to?(:update)
|
15
14
|
value.execute
|
@@ -24,14 +23,23 @@ class Tasks
|
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
27
|
-
def
|
26
|
+
def execute_task task
|
28
27
|
if(defined?(COMMANDS))
|
29
28
|
if(COMMANDS.has_key?(task))
|
30
|
-
puts "
|
31
|
-
|
29
|
+
puts ":#{task}" if !@env.colorize?
|
30
|
+
if @env.colorize?
|
31
|
+
require 'ansi/code'
|
32
|
+
puts ANSI.white + ANSI.bold + ":#{task}" + ANSI.reset if @env.colorize?
|
33
|
+
end
|
34
|
+
execute(COMMANDS[task])
|
32
35
|
end
|
33
36
|
end
|
34
37
|
end
|
38
|
+
|
39
|
+
def self.execute_task task
|
40
|
+
@@default=Tasks.new if @@default.nil?
|
41
|
+
@@default.execute_task task
|
42
|
+
end
|
35
43
|
end
|
36
44
|
|
37
45
|
['add','analyze','build','clobber','commit',
|
data/lib/tasks/add.rb
CHANGED
@@ -6,7 +6,7 @@ task :add do Tasks.execute_task :add;end
|
|
6
6
|
class Add < Array
|
7
7
|
def update
|
8
8
|
if(File.exists?('.git') && File.exists?('.gitignore'))
|
9
|
-
|
9
|
+
add_quiet 'git add --all'
|
10
10
|
else
|
11
11
|
if(defined?(SOURCE))
|
12
12
|
if(File.exists?('.svn'))
|
@@ -21,11 +21,11 @@ class Add < Array
|
|
21
21
|
end
|
22
22
|
if(status.include?('?') || status.include?('was not found') || error.include?('was not found'))
|
23
23
|
if(f.include?(' '))
|
24
|
-
puts "svn add \"#{f}\" --parents"
|
25
|
-
add "svn add \"#{f}\" --parents"
|
24
|
+
#puts "svn add \"#{f}\" --parents"
|
25
|
+
add_quiet add "svn add \"#{f}\" --parents"
|
26
26
|
else
|
27
|
-
|
28
|
-
|
27
|
+
#puts "svn add #{f} --parents"
|
28
|
+
add_quiet "svn add #{f} --parents"
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -34,10 +34,10 @@ class Add < Array
|
|
34
34
|
if(File.exists?('.git'))
|
35
35
|
SOURCE.each{|f|
|
36
36
|
if(File.exists?(f) && File.file?(f))
|
37
|
-
status
|
37
|
+
status=Command.output("git status #{f} --short")
|
38
38
|
if status.include?('??') || status.include?(' M ')
|
39
|
-
puts "git add #{f} -v"
|
40
|
-
|
39
|
+
#puts "git add #{f} -v"
|
40
|
+
add_quiet "git add #{f} -v"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
}
|
data/lib/tasks/analyze.rb
CHANGED
data/lib/tasks/build.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
puts __FILE__ if defined?(DEBUG)
|
2
2
|
|
3
|
+
require_relative('../base/environment.rb')
|
4
|
+
|
3
5
|
desc 'performs build commands'
|
4
6
|
task :build do Tasks.execute_task :build;end
|
7
|
+
#task :build do Tasks.execute_task :build;end
|
5
8
|
|
6
9
|
SLN_FILES=FileList.new('*.sln','*/*.sln','*/*/*.sln')
|
7
10
|
NUGET_FILES=FileList.new('**/*.nuspec')
|
@@ -10,51 +13,64 @@ WXS_FILES=FileList.new('**/*.wxs')
|
|
10
13
|
class Build < Array
|
11
14
|
def update
|
12
15
|
|
13
|
-
changed = true
|
14
|
-
if(changed)
|
16
|
+
#changed = true
|
17
|
+
#if(changed)
|
18
|
+
puts "Build scanning for gemspec files" if Environment.default.debug?
|
15
19
|
Dir.glob('*.gemspec'){|gemspec|
|
16
|
-
|
20
|
+
add_quiet("gem build #{gemspec}") if !File.exist?(Gemspec.gemfile gemspec)
|
17
21
|
}
|
18
22
|
|
23
|
+
puts "Build scanning for sln files" if Environment.default.debug?
|
19
24
|
SLN_FILES.each{|sln_file|
|
20
|
-
|
25
|
+
puts " #{sln_file}" if Environment.default.debug?
|
21
26
|
build_commands = MSBuild.get_build_commands sln_file
|
22
27
|
if(!build_commands.nil?)
|
23
28
|
build_commands.each{|c|
|
24
|
-
|
29
|
+
puts " build command #{c} discovered." if Environment.default.debug?
|
30
|
+
#self.add c
|
31
|
+
add_quiet(c)
|
25
32
|
}
|
33
|
+
else
|
34
|
+
puts " no build command discovered." if Environment.default.debug?
|
26
35
|
end
|
27
36
|
}
|
28
37
|
|
38
|
+
puts "Build scanning for nuget files" if Environment.default.debug?
|
29
39
|
NUGET_FILES.each{|nuget_file|
|
30
40
|
build_commands = Nuget.get_build_commands nuget_file
|
31
41
|
if(!build_commands.nil?)
|
32
42
|
build_commands.each{|c|
|
33
|
-
|
43
|
+
add_quiet(c)
|
44
|
+
#self.add c
|
34
45
|
}
|
35
46
|
end
|
36
47
|
}
|
37
48
|
|
49
|
+
puts "Build scanning for wxs <Product> files" if Environment.default.debug?
|
38
50
|
WXS_FILES.each{|wxs_file|
|
39
51
|
if(IO.read(wxs_file).include?('<Product'))
|
40
52
|
build_commands = Wix.get_build_commands wxs_file
|
41
53
|
if(!build_commands.nil?)
|
42
54
|
build_commands.each{|c|
|
43
|
-
self.add c
|
55
|
+
#self.add c
|
56
|
+
add_quiet(c)
|
44
57
|
}
|
45
58
|
end
|
46
59
|
end
|
47
60
|
}
|
61
|
+
|
62
|
+
puts "Build scanning for wxs <Bundle> files" if Environment.default.debug?
|
48
63
|
WXS_FILES.each{|wxs_file|
|
49
64
|
if(IO.read(wxs_file).include?('<Bundle'))
|
50
65
|
build_commands = Wix.get_build_commands wxs_file
|
51
66
|
if(!build_commands.nil?)
|
52
67
|
build_commands.each{|c|
|
53
|
-
self.add c
|
68
|
+
#self.add c
|
69
|
+
add_quiet(c)
|
54
70
|
}
|
55
71
|
end
|
56
72
|
end
|
57
73
|
}
|
58
|
-
end
|
74
|
+
#end
|
59
75
|
end
|
60
76
|
end
|
data/lib/tasks/commit.rb
CHANGED
@@ -4,7 +4,7 @@ desc 'commits source files to git or subversion'
|
|
4
4
|
if(File.exists?('git'))
|
5
5
|
task :commit=>[:add] do Tasks.execute_task :commit; end
|
6
6
|
else
|
7
|
-
task :commit do Tasks.execute_task :commit;end
|
7
|
+
task :commit=>[:add] do Tasks.execute_task :commit;end
|
8
8
|
end
|
9
9
|
|
10
10
|
class Commit < Array
|
@@ -20,11 +20,11 @@ class Commit < Array
|
|
20
20
|
Commit.reset_commit_message
|
21
21
|
raise "commit.message required to perform commit"
|
22
22
|
else
|
23
|
-
|
23
|
+
add_quiet "git commit -m'all'"
|
24
24
|
end
|
25
25
|
else
|
26
|
-
|
27
|
-
|
26
|
+
add_quiet "git commit -a -v --file commit.message"
|
27
|
+
add_quiet "<%Commit.reset_commit_message%>"
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -34,11 +34,11 @@ class Commit < Array
|
|
34
34
|
Commit.reset_commit_message
|
35
35
|
raise "commit.message required to perform commit"
|
36
36
|
else
|
37
|
-
|
37
|
+
add_quiet 'svn commit -m"commit all"'
|
38
38
|
end
|
39
39
|
else
|
40
|
-
|
41
|
-
|
40
|
+
add_quiet 'svn commit --file commit.message'
|
41
|
+
add_quiet "<%Commit.reset_commit_message%>"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/tasks/default.rb
CHANGED
@@ -2,6 +2,7 @@ puts __FILE__ if defined?(DEBUG)
|
|
2
2
|
|
3
3
|
require_relative('info.rb')
|
4
4
|
require_relative('../base/array.rb')
|
5
|
+
require_relative('../base/environment.rb')
|
5
6
|
require_relative('../base/projects.rb')
|
6
7
|
require_relative('../base/timer.rb')
|
7
8
|
|
@@ -22,6 +23,11 @@ if(!defined?(NO_DEFAULT_TASK))
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
puts "[:default] completed in #{TIMER.elapsed_str}"
|
26
|
+
puts "[:default] completed in #{TIMER.elapsed_str}" if !Environment.default.colorize?
|
27
|
+
if Environment.default.colorize?
|
28
|
+
require 'ansi/code'
|
29
|
+
puts ANSI.white + ANSI.bold + ":default" + " completed in " + ANSI.yellow + "#{TIMER.elapsed_str}" + ANSI.reset
|
30
|
+
end
|
31
|
+
|
26
32
|
end # :default
|
27
33
|
end
|
data/lib/tasks/doc.rb
CHANGED
@@ -6,7 +6,7 @@ task :doc do Tasks.execute_task :doc;end
|
|
6
6
|
class Doc < Array
|
7
7
|
def update
|
8
8
|
if(Command.exit_code('yard --version'))
|
9
|
-
|
9
|
+
add_quiet 'yard doc - LICENSE' if File.exists?('README.md') && File.exists?('LICENSE')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/tasks/publish.rb
CHANGED
@@ -1,39 +1,35 @@
|
|
1
1
|
puts __FILE__ if defined?(DEBUG)
|
2
|
-
|
2
|
+
require_relative '../base/array.rb'
|
3
3
|
desc 'performs publish commands'
|
4
4
|
task :publish do Tasks.execute_task :publish; end
|
5
5
|
|
6
6
|
class Publish < Array
|
7
|
-
def update
|
8
7
|
|
9
|
-
|
8
|
+
def update
|
10
9
|
if(File.exists?('.git') && defined?(VERSION))
|
11
|
-
|
10
|
+
add_quiet "<%Git.tag('#{Rake.application.original_dir}','#{VERSION}')%>"
|
12
11
|
end
|
13
12
|
|
14
13
|
if(Internet.available?)
|
15
14
|
if(File.exists?('.git'))
|
16
15
|
if(`git branch`.include?('* master'))
|
17
16
|
Dir.glob('*.gemspec').each{|gemspec_file|
|
18
|
-
|
17
|
+
add_passive "gem push #{Gemspec.gemfile(gemspec_file)}" if !Gemspec.published? gemspec_file
|
19
18
|
}
|
20
19
|
end
|
21
20
|
end
|
22
21
|
if(File.exists?('.svn'))
|
23
22
|
if(`svn info`.include?('/trunk'))
|
24
23
|
Dir.glob('*.gemspec').each{|gemspec_file|
|
25
|
-
|
24
|
+
add_quiet "gem push #{Gemspec.gemfile(gemspec_file)}" if !Gemspec.published? gemspec_file
|
26
25
|
}
|
27
26
|
end
|
28
27
|
end
|
29
28
|
end
|
30
29
|
|
31
|
-
puts 'publish glob, checking...' if defined? DEBUG
|
32
30
|
Dir.glob("#{Rake.application.original_dir}/**/*.{nupkg,msi,gem}").each{|publish_file|
|
33
|
-
|
34
|
-
|
35
|
-
FileUtils.mkdir_p("#{Environment.dev_root}/publish") if !File.exists?("#{Environment.dev_root}/publish")
|
36
|
-
add "<%FileUtils.cp('#{publish_file}','#{dest}')%>" if(!File.exists?(dest))
|
31
|
+
dest="#{Environment.default.publish_dir}/#{File.basename(publish_file)}"
|
32
|
+
add_quiet "<%FileUtils.cp('#{publish_file}','#{dest}')%>" if(!File.exists?(dest))
|
37
33
|
}
|
38
34
|
end
|
39
35
|
end
|
data/lib/tasks/pull.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
puts __FILE__ if defined?(DEBUG)
|
2
|
-
|
3
|
-
|
4
1
|
desc 'performs a git pull'
|
5
2
|
task :pull do Tasks.execute_task :pull; end
|
6
3
|
|
@@ -8,7 +5,7 @@ class Pull < Array
|
|
8
5
|
def update
|
9
6
|
if(Internet.available?)
|
10
7
|
if(File.exists?('.git') && `git config --list`.include?('user.name='))
|
11
|
-
|
8
|
+
add_quiet('git pull') if Git.branch == 'master'
|
12
9
|
end
|
13
10
|
end
|
14
11
|
end
|
data/lib/tasks/push.rb
CHANGED
@@ -6,8 +6,8 @@ task :push do Tasks.execute_task :push;end
|
|
6
6
|
class Push < Array
|
7
7
|
def update
|
8
8
|
if(File.exists?('.git') && `git config --list`.include?('user.name=') && `git branch`.include?('* master'))
|
9
|
-
|
10
|
-
|
9
|
+
add_quiet 'git push'
|
10
|
+
add_quiet 'git push --tags'
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/lib/tasks/setup.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
puts __FILE__ if defined?(DEBUG)
|
2
|
-
|
3
1
|
desc 'performs setup commands'
|
4
2
|
task :setup do Tasks.execute_task :setup;end
|
5
3
|
|
@@ -9,32 +7,55 @@ task :setup do Tasks.execute_task :setup;end
|
|
9
7
|
# SVN_EXPORT={ 'System.Data.SQLite/1.0.93.0' => 'https://third-party.googlecode.com/svn/trunk/System.Data.SQLite/1.0.93.0' }
|
10
8
|
#
|
11
9
|
class Setup < Array
|
10
|
+
|
11
|
+
def initialize value=nil
|
12
|
+
env=value if value.kind_of? Environment
|
13
|
+
end
|
14
|
+
|
12
15
|
def update
|
13
|
-
|
16
|
+
env=Environment.new if env.nil?
|
14
17
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
add_quiet 'bundle install' if File.exists? 'Gemfile'
|
19
|
+
#add Command.new( { :input => 'bundle install', :quiet => true}) if(File.exists?('Gemfile'))
|
20
|
+
|
21
|
+
#['bin','data','log','make','publish','test'].each{|dir|
|
22
|
+
# add "<%FileUtils.mkdir('#{Environment.default.devroot}/#{dir}')%>" if !File.exists? "#{Environment.dev_root}/#{dir}"
|
23
|
+
#}
|
18
24
|
|
19
25
|
Dir.glob('*.gemspec').each{|gemspec_file|
|
20
|
-
|
26
|
+
add_quiet "<%Gemspec.update('#{gemspec_file}')%>"
|
27
|
+
#add Command.new( { :input => "<%Gemspec.update('#{gemspec_file}')%>", :quiet => true} )
|
21
28
|
}
|
22
29
|
|
23
30
|
if(Dir.glob('**/packages.config').length > 0)
|
24
31
|
Dir.glob('*.sln').each{|sln_file|
|
25
|
-
|
32
|
+
add_quiet "nuget restore #{sln_file}"
|
26
33
|
}
|
27
34
|
end
|
28
35
|
|
36
|
+
puts 'Setup checking SVN_EXPORTS...' if env.debug?
|
29
37
|
if(defined?(SVN_EXPORTS))
|
30
38
|
SVN_EXPORTS.each{|k,v|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
39
|
+
dest="#{Command.dev_root}/dep/#{k}"
|
40
|
+
if(!File.exists?(dest))
|
41
|
+
puts "#{Command.dev_root}/dep/#{k} does not exists" if env.debug?
|
42
|
+
FileUtils.mkdir_p(File.dirname(dest)) if !File.exists?(File.dirname(dest))
|
43
|
+
if(!dest.include?("@"))
|
44
|
+
puts "adding svn export #{v} #{dest}" if env.debug?
|
45
|
+
add_quiet "svn export #{v} #{dest}"
|
46
|
+
end
|
47
|
+
if(dest.include?("@"))
|
48
|
+
puts "adding svn export #{v} #{dest}@" if env.debug?
|
49
|
+
add_quiet "svn export #{v} #{dest}@"
|
50
|
+
end
|
51
|
+
#add "svn export #{v} #{dest}" if !dest.include?("@")
|
52
|
+
#add "svn export #{v} #{dest}@" if dest.include?("@")
|
53
|
+
else
|
54
|
+
puts "#{Command.dev_root}/dep/#{k} exists." if env.debug?
|
36
55
|
end
|
37
56
|
}
|
57
|
+
else
|
58
|
+
puts 'SVN_EXPORTS is not defined' if env.debug?
|
38
59
|
end
|
39
60
|
|
40
61
|
if(defined?(GIT_EXPORTS))
|
@@ -47,7 +68,7 @@ class Setup < Array
|
|
47
68
|
puts `git reset --hard #{v.split('@')[1]}`
|
48
69
|
end
|
49
70
|
else
|
50
|
-
|
71
|
+
add_quiet "git clone #{v} #{directory}"
|
51
72
|
end
|
52
73
|
end
|
53
74
|
}
|
@@ -75,7 +96,7 @@ class Setup < Array
|
|
75
96
|
end
|
76
97
|
}
|
77
98
|
Dir.glob('**/*.wxs').each{|wxs|
|
78
|
-
current_version=IO.read(wxs).scan(/Version=\"([\d.]+)\"/)[0]
|
99
|
+
current_version=IO.read(wxs).scan(/Version=\"([\d.]+)\"/)[0][0]
|
79
100
|
puts "#{wxs} current version=#{current_version}" if defined?(DEBUG)
|
80
101
|
if(current_version.include?('Version='))
|
81
102
|
target_version="Version=\"#{VERSION}\")="
|
data/lib/tasks/test.rb
CHANGED
@@ -10,10 +10,9 @@ puts __FILE__ if defined?(DEBUG)
|
|
10
10
|
desc 'performs test commands'
|
11
11
|
task :test => [:build] do Tasks.execute_task :test;end
|
12
12
|
|
13
|
-
|
14
13
|
class Test < Array
|
15
14
|
def update
|
16
|
-
|
15
|
+
add_quiet 'rspec --format documentation' if File.exists?('spec')
|
17
16
|
|
18
17
|
if(defined?(NUNIT))
|
19
18
|
NUNIT.each{|nunit_dll|
|
@@ -23,18 +22,18 @@ class Test < Array
|
|
23
22
|
dll_arg="\"#{nunit_dll}\"" if(nunit_dll.include?(' '))
|
24
23
|
xml_arg="/xml:#{nunit_dll}.TestResults.xml"
|
25
24
|
xml_arg="/xml:\"#{nunit_dll}.TestResults.xml\"" if(nunit_dll.include?(' '))
|
26
|
-
|
25
|
+
add_quiet "#{nunit_arg} #{dll_arg} #{xml_arg}"
|
27
26
|
}
|
28
27
|
end
|
29
28
|
|
30
29
|
if(defined?(NUNIT_X86))
|
31
30
|
NUNIT_X86.each{|nunit_dll|
|
32
|
-
|
31
|
+
add_quiet "\"#{Test.nunit_console_x86}\" \"#{Rake.application.original_dir}\\#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
|
33
32
|
}
|
34
33
|
end
|
35
34
|
|
36
35
|
if(defined?(TESTS))
|
37
|
-
TEST.each{|t|
|
36
|
+
TEST.each{|t| add_quiet t}
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|