fuburake 0.9.5.37 → 1.0.0.38
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 +8 -8
- data/lib/assembly_info.rb +43 -42
- data/lib/bottles.rb +16 -15
- data/lib/fubudocs.rb +103 -104
- data/lib/fuburake.rb +348 -346
- data/lib/msbuild.rb +54 -53
- data/lib/nuget.rb +20 -20
- data/lib/nunit.rb +81 -86
- data/lib/platform.rb +48 -15
- data/lib/ripple.rb +35 -34
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjUwMDM2OGI5N2JmNDY4MjM3NWRiZmJlZWFhNGYzMjFlYTc1NjczZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjY2MTczNjI4ZDhjN2UxMWRlNzhhNTcyMzEyMjgwOTEwYWU5NTI4Mw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmEwOTcyZjA2MTdkZjc5ZjVlNTEwMmM3MTk4ODk3ZGVkY2RlM2RlZDJlNTZi
|
10
|
+
OTRmZjJhZDZlZjg2Yjc1OTVhMGQ5YzkzYmJhMjE3YjdhNzJlYzhjNjM0YjQx
|
11
|
+
NTcwNTQ0NTU5OWU1MzM2NTFlOGYwYzdkMzRmNzE5Y2NmZTUzNzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWFhNjE1ZWUzODgxNDZkNjhjYTcwMjg4NWE2Zjk3ZGZmYmFkODA4NmIyNjFi
|
14
|
+
YWFkNmEwZGU1ZWQxYTVkMzJhMTc1MTZkY2M4OGI5NDA4MmU0OTQxNzU3NGU3
|
15
|
+
ODBkY2IwZTdlMTBlYjFiYzlmMTM2YjE0M2JkOTI0Yzg1MWRkN2E=
|
data/lib/assembly_info.rb
CHANGED
@@ -1,48 +1,49 @@
|
|
1
|
+
# vim: tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab
|
1
2
|
module FubuRake
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
3
|
+
class AssemblyInfo
|
4
|
+
def self.create tasks, options
|
5
|
+
if tasks.assembly_info == nil
|
6
|
+
return nil
|
7
|
+
end
|
8
|
+
|
9
|
+
versionTask = Rake::Task.define_task :version do
|
10
|
+
begin
|
11
|
+
commit = `git log -1 --pretty=format:%H`
|
12
|
+
rescue
|
13
|
+
commit = "git unavailable"
|
14
|
+
end
|
15
|
+
puts "##teamcity[buildNumber '#{options[:build_number]}']" unless options[:tc_build_number].nil?
|
16
|
+
puts "Version: #{options[:build_number]}" if options[:tc_build_number].nil?
|
17
|
+
|
18
|
+
options = {
|
19
|
+
:trademark => commit,
|
20
|
+
:product_name => 'CHANGEME',
|
21
|
+
:description => options[:build_number],
|
22
|
+
:version => options[:asm_version],
|
23
|
+
:file_version => options[:build_number],
|
24
|
+
:informational_version => options[:asm_version],
|
25
|
+
:copyright => 'CHANGEME',
|
26
|
+
:output_file => 'src/CommonAssemblyInfo.cs'
|
27
|
+
}
|
27
28
|
|
28
|
-
|
29
|
+
options = options.merge(tasks.assembly_info)
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
File.open(options[:output_file], 'w') do |file|
|
32
|
+
file.write "using System.Reflection;\n"
|
33
|
+
file.write "using System.Runtime.InteropServices;\n"
|
34
|
+
file.write "[assembly: AssemblyDescription(\"#{options[:description]}\")]\n"
|
35
|
+
file.write "[assembly: AssemblyProduct(\"#{options[:product_name]}\")]\n"
|
36
|
+
file.write "[assembly: AssemblyCopyright(\"#{options[:copyright]}\")]\n"
|
37
|
+
file.write "[assembly: AssemblyTrademark(\"#{options[:trademark]}\")]\n"
|
38
|
+
file.write "[assembly: AssemblyVersion(\"#{options[:version]}\")]\n"
|
39
|
+
file.write "[assembly: AssemblyFileVersion(\"#{options[:file_version]}\")]\n"
|
40
|
+
file.write "[assembly: AssemblyInformationalVersion(\"#{options[:informational_version]}\")]\n"
|
41
|
+
end
|
40
42
|
end
|
43
|
+
|
44
|
+
versionTask.add_description "Update the version information for the build"
|
45
|
+
|
46
|
+
return versionTask
|
41
47
|
end
|
42
|
-
|
43
|
-
versionTask.add_description "Update the version information for the build"
|
44
|
-
|
45
|
-
return versionTask
|
46
48
|
end
|
47
|
-
|
48
|
-
end
|
49
|
+
end
|
data/lib/bottles.rb
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
+
# vim: tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab
|
1
2
|
module FubuRake
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
class AssemblyBottle
|
4
|
+
def initialize(project)
|
5
|
+
@project = project
|
6
|
+
end
|
7
|
+
|
8
|
+
def create(options)
|
9
|
+
cleaned_name = @project.gsub('.', '_').downcase
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
name = "bottle_#{cleaned_name}"
|
12
|
+
task = Rake::Task.define_task name do
|
13
|
+
sh "bottles assembly-pak #{options[:source]}/#{@project} -p #{@project}.csproj"
|
13
14
|
|
14
|
-
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
17
|
+
task.add_description "Assembly bottle packing for #{@project}"
|
18
|
+
Rake::Task[:compile].enhance [name]
|
19
|
+
end
|
18
20
|
end
|
19
|
-
|
20
|
-
end
|
21
|
+
end
|
data/lib/fubudocs.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
+
# vim: tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab
|
1
2
|
namespace :docs do
|
2
3
|
desc "Runs a documentation project hosted in FubuWorld"
|
3
4
|
task :run do
|
4
5
|
sh "fubudocs run -o"
|
5
6
|
end
|
6
|
-
|
7
|
+
|
7
8
|
desc "Runs the documentation projects in this solution in a 'watched' mode in Firefox"
|
8
9
|
task :run_firefox do
|
9
10
|
sh "fubudocs run --watched --browser Firefox"
|
10
11
|
end
|
11
|
-
|
12
|
+
|
12
13
|
desc "Runs the documentation projects in this solution in a 'watched' mode in Firefox"
|
13
14
|
task :run_chrome do
|
14
15
|
sh "fubudocs run --watched --browser Chrome"
|
@@ -27,10 +28,10 @@ end
|
|
27
28
|
|
28
29
|
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
class FubuDocs
|
32
|
+
attr_accessor :prefix, :branch, :export_dir
|
33
|
+
|
34
|
+
def initialize(options)
|
34
35
|
# :host, :include, :nested, :dump
|
35
36
|
@branch = options.fetch(:branch, 'gh-pages')
|
36
37
|
@repository = options[:repository]
|
@@ -38,128 +39,126 @@ end
|
|
38
39
|
@export_dir = options.fetch(:dir, 'fubudocs-export')
|
39
40
|
@options = options
|
40
41
|
end
|
41
|
-
|
42
|
+
|
42
43
|
def export
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
44
|
+
cmd = "fubudocs export #{@export_dir}"
|
45
|
+
if (@options[:host] != nil)
|
46
|
+
cmd += " --host #{@options[:host]}"
|
47
|
+
end
|
48
|
+
|
49
|
+
if (@options[:include] != nil)
|
50
|
+
cmd += " -i #{@options[:include]}"
|
51
|
+
end
|
52
|
+
|
53
|
+
if (@options[:nested] == true)
|
54
|
+
cmd += " -m GhPagesChildFolder"
|
55
|
+
elsif (@options[:dump] == true)
|
56
|
+
cmd += " -m HtmlDump"
|
57
|
+
else
|
58
|
+
cmd += ' -m GhPagesRooted'
|
59
|
+
end
|
60
|
+
|
61
|
+
sh cmd
|
61
62
|
end
|
62
|
-
|
63
|
+
|
63
64
|
def clean
|
64
|
-
|
65
|
-
|
65
|
+
cleanDirectory @export_dir
|
66
|
+
Dir.delete @export_dir unless !Dir.exists?(@export_dir)
|
66
67
|
end
|
67
|
-
|
68
|
+
|
68
69
|
def create_branch
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
70
|
+
sh "ripple gitignore #{@export_dir}"
|
71
|
+
|
72
|
+
sh "git clone #{@repository} #{@export_dir}"
|
73
|
+
|
74
|
+
Dir.chdir @export_dir
|
75
|
+
|
76
|
+
sh "git checkout --orphan #{@branch}"
|
77
|
+
sh "git rm -rf ."
|
78
|
+
|
79
|
+
writeNoJekyll
|
80
|
+
|
81
|
+
sh "git add ."
|
82
|
+
sh 'git commit -a -m "initial clean slate"'
|
83
|
+
sh 'git push origin #{@branch}'
|
84
|
+
|
85
|
+
Dir.chdir '..'
|
85
86
|
end
|
86
|
-
|
87
|
+
|
87
88
|
def writeNoJekyll
|
88
|
-
|
89
|
-
|
90
|
-
|
89
|
+
output = File.new( ".nojekyll", "w+" )
|
90
|
+
output << "Just a marker"
|
91
|
+
output.close
|
91
92
|
end
|
92
|
-
|
93
|
+
|
93
94
|
def fetch_existing
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
95
|
+
Dir.mkdir @export_dir
|
96
|
+
|
97
|
+
# fetch the gh-pages branch from the server
|
98
|
+
Dir.chdir @export_dir
|
99
|
+
sh 'git init'
|
100
|
+
sh "git remote add -t #{@branch} -f origin #{@repository}"
|
101
|
+
sh "git checkout #{@branch}"
|
102
|
+
|
103
|
+
# clean the existing content
|
104
|
+
sleep 0.5 # let the file system try to relax its locks
|
105
|
+
content_files = FileList['*.*'].exclude('.nojekyll').exclude('CNAME')
|
106
|
+
content_files.each do |f|
|
107
|
+
FileUtils.rm_r f
|
108
|
+
end
|
109
|
+
|
110
|
+
# do the actual export
|
111
|
+
Dir.chdir '..'
|
111
112
|
end
|
112
|
-
|
113
|
+
|
113
114
|
def commit_new
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
end
|
120
|
-
|
121
|
-
sh "git add ."
|
122
|
-
sh 'git commit -a -m "Doc generation version ' + @options[:version] + '"' do |ok, res|
|
123
|
-
if ok
|
124
|
-
sh "git push origin #{@branch}"
|
125
|
-
puts "Documentation generation and push to #{@repository}/#{@branch} is successful"
|
126
|
-
else
|
127
|
-
puts "commit failed, might be because there are no differences in the content"
|
115
|
+
# commit and push the generated docs
|
116
|
+
Dir.chdir @export_dir
|
117
|
+
|
118
|
+
if !File.exists?('.nojekyll')
|
119
|
+
writeNoJekyll
|
128
120
|
end
|
129
|
-
end
|
130
121
|
|
131
|
-
|
122
|
+
sh "git add ."
|
123
|
+
sh 'git commit -a -m "Doc generation version ' + @options[:version] + '"' do |ok, res|
|
124
|
+
if ok
|
125
|
+
sh "git push origin #{@branch}"
|
126
|
+
puts "Documentation generation and push to #{@repository}/#{@branch} is successful"
|
127
|
+
else
|
128
|
+
puts "commit failed, might be because there are no differences in the content"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
Dir.chdir '..'
|
132
133
|
end
|
133
|
-
|
134
|
+
|
134
135
|
def export_tasks
|
135
136
|
initTask = Rake::Task.define_task "#{@prefix}:init_branch" do
|
136
|
-
|
137
|
-
|
137
|
+
clean
|
138
|
+
create_branch
|
138
139
|
end
|
139
|
-
|
140
|
+
|
140
141
|
initTask.add_description "Initializes the #{@branch} branch in git repository #{@repository}"
|
141
|
-
|
142
|
+
|
142
143
|
exportTaskName = "#{@prefix}:export"
|
143
144
|
exportTask = Rake::Task.define_task exportTaskName do
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
145
|
+
clean
|
146
|
+
fetch_existing
|
147
|
+
export
|
148
|
+
commit_new
|
148
149
|
end
|
149
150
|
exportTask.add_description "Export the generated documentation to #{@repository}/#{@branch}"
|
150
151
|
#exportTask.enhance [:compile]
|
151
|
-
|
152
|
-
|
152
|
+
|
153
153
|
return exportTaskName
|
154
154
|
end
|
155
|
-
|
155
|
+
|
156
156
|
def dump_task
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
157
|
+
dumpTask = Rake::Task.define_task "#{@prefix}:dump" do
|
158
|
+
clean
|
159
|
+
@options[:dump] = true
|
160
|
+
export
|
161
|
+
end
|
162
|
+
dumpTask.add_description "Export the generated documentation to #{@export_dir} for local usage"
|
163
163
|
end
|
164
|
-
|
165
|
-
|
164
|
+
end
|
data/lib/fuburake.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# vim: tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab
|
1
2
|
include FileUtils
|
2
3
|
include FileTest
|
3
4
|
|
@@ -8,17 +9,18 @@ require_relative 'platform'
|
|
8
9
|
require_relative 'ripple'
|
9
10
|
require_relative 'assembly_info'
|
10
11
|
require_relative 'bottles'
|
12
|
+
require_relative 'fubudocs'
|
11
13
|
|
12
14
|
if File.exists?("VERSION.txt")
|
13
|
-
|
15
|
+
load "VERSION.txt"
|
14
16
|
elsif ENV["BUILD_VERSION"] != nil
|
15
|
-
|
17
|
+
BUILD_VERSION = ENV["BUILD_VERSION"]
|
16
18
|
else
|
17
|
-
|
19
|
+
BUILD_VERSION = "0.0.1"
|
18
20
|
end
|
19
21
|
|
20
22
|
module FubuRake
|
21
|
-
|
23
|
+
class SolutionTasks
|
22
24
|
attr_accessor :clean,
|
23
25
|
:compile,
|
24
26
|
:assembly_info,
|
@@ -35,15 +37,15 @@ module FubuRake
|
|
35
37
|
:doc_exports
|
36
38
|
|
37
39
|
def initialize
|
38
|
-
|
40
|
+
@options = {}
|
39
41
|
@bottles = []
|
40
42
|
@bottles_enabled = true
|
41
43
|
|
42
44
|
solutions = Dir.glob('**/*.sln')
|
43
45
|
if solutions.count == 1
|
44
|
-
|
46
|
+
solutionfile = solutions[0]
|
45
47
|
|
46
|
-
|
48
|
+
@compile = {:solutionfile => solutionfile}
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
@@ -64,411 +66,411 @@ module FubuRake
|
|
64
66
|
|
65
67
|
@doc_exports << options
|
66
68
|
end
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
end
|
70
|
+
|
71
|
+
class Solution
|
72
|
+
attr_accessor :options, :compilemode, :build_number
|
73
|
+
|
74
|
+
def initialize(&block)
|
75
|
+
tasks = SolutionTasks.new
|
76
|
+
block.call(tasks)
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
# SAMPLE: fuburake-options
|
89
|
-
@options = {
|
90
|
-
:compilemode => ENV['config'].nil? ? "Debug" : ENV['config'],
|
91
|
-
:clrversion => 'v4.0.30319',
|
92
|
-
:platform => ENV['platform'].nil? ? "" : ENV['platform'],
|
93
|
-
:unit_test_list_file => 'TESTS.txt',
|
94
|
-
:unit_test_projects => [],
|
95
|
-
:build_number => @build_number,
|
96
|
-
:asm_version => asm_version,
|
97
|
-
:tc_build_number => tc_build_number,
|
98
|
-
:build_revision => build_revision,
|
99
|
-
:source => 'src'}.merge(options)
|
100
|
-
# ENDSAMPLE
|
101
|
-
|
102
|
-
@compilemode = @options[:compilemode]
|
103
|
-
|
104
|
-
tasks.clean ||= []
|
105
|
-
tasks.defaults ||= []
|
106
|
-
tasks.ci_steps ||= []
|
107
|
-
tasks.precompile ||= []
|
108
|
-
tasks.doc_exports ||= []
|
109
|
-
|
78
|
+
@defaultTask = create_task(:default, "**Default**, compiles and runs tests")
|
79
|
+
@ciTask = create_task(:ci, "Target used for the CI server")
|
80
|
+
@ciTask.enhance [:default]
|
81
|
+
|
82
|
+
options = tasks.options
|
83
|
+
options ||= {}
|
84
|
+
|
85
|
+
tc_build_number = ENV["BUILD_NUMBER"]
|
86
|
+
build_revision = tc_build_number || Time.new.strftime('5%H%M')
|
87
|
+
asm_version = BUILD_VERSION + ".0"
|
88
|
+
@build_number = "#{BUILD_VERSION}.#{build_revision}"
|
110
89
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
90
|
+
# SAMPLE: fuburake-options
|
91
|
+
@options = {
|
92
|
+
:compilemode => ENV['config'].nil? ? "Debug" : ENV['config'],
|
93
|
+
:clrversion => 'v4.0.30319',
|
94
|
+
:platform => ENV['platform'].nil? ? "" : ENV['platform'],
|
95
|
+
:unit_test_list_file => 'TESTS.txt',
|
96
|
+
:unit_test_projects => [],
|
97
|
+
:build_number => @build_number,
|
98
|
+
:asm_version => asm_version,
|
99
|
+
:tc_build_number => tc_build_number,
|
100
|
+
:build_revision => build_revision,
|
101
|
+
:source => 'src'}.merge(options)
|
102
|
+
# ENDSAMPLE
|
103
|
+
|
104
|
+
@compilemode = @options[:compilemode]
|
105
|
+
|
106
|
+
tasks.clean ||= []
|
107
|
+
tasks.defaults ||= []
|
108
|
+
tasks.ci_steps ||= []
|
109
|
+
tasks.precompile ||= []
|
110
|
+
tasks.doc_exports ||= []
|
117
111
|
|
118
|
-
|
112
|
+
enable_docs tasks
|
113
|
+
FubuRake::AssemblyInfo.create tasks, @options
|
114
|
+
FubuRake::Ripple.create tasks, @options
|
115
|
+
make_clean tasks
|
116
|
+
FubuRake::MSBuild.create_task tasks, @options
|
117
|
+
FubuRake::NUnit.create_task tasks, @options
|
119
118
|
|
120
|
-
|
121
|
-
add_dependency :unit_test, :compile
|
122
|
-
add_dependency :default, [:compile, :unit_test]
|
123
|
-
add_dependency :default, :unit_test
|
124
|
-
Rake::Task[:default].enhance tasks.defaults
|
125
|
-
Rake::Task[:ci].enhance tasks.ci_steps
|
126
|
-
add_dependency :ci, tasks.ci_steps
|
127
|
-
add_dependency :ci, ["ripple:history", "ripple:package"]
|
119
|
+
add_dependency :compile, [:clean, :version, 'ripple:restore', 'docs:bottle']
|
128
120
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
Dir.glob('**/.package-manifest').each do |f|
|
138
|
-
dir = File.dirname(f)
|
139
|
-
project = dir.split('/').last
|
140
|
-
if project.index('.Docs') == nil
|
141
|
-
proj_file = "#{dir}/#{project}.csproj"
|
142
|
-
if File.exists?(proj_file)
|
143
|
-
tasks.bottles << FubuRake::AssemblyBottle.new(project)
|
144
|
-
end
|
145
|
-
end
|
121
|
+
Rake::Task[:compile].enhance(tasks.precompile)
|
122
|
+
add_dependency :unit_test, :compile
|
123
|
+
add_dependency :default, [:compile, :unit_test]
|
124
|
+
add_dependency :default, :unit_test
|
125
|
+
Rake::Task[:default].enhance tasks.defaults
|
126
|
+
Rake::Task[:ci].enhance tasks.ci_steps
|
127
|
+
add_dependency :ci, tasks.ci_steps
|
128
|
+
add_dependency :ci, ["ripple:history", "ripple:package"]
|
146
129
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
130
|
+
tasks.compilations ||= []
|
131
|
+
tasks.compilations.each do |c|
|
132
|
+
c.create @options
|
133
|
+
end
|
134
|
+
|
135
|
+
if tasks.bottles.empty? && tasks.bottles_enabled
|
136
|
+
Dir.glob('**/.package-manifest').each do |f|
|
137
|
+
dir = File.dirname(f)
|
138
|
+
project = dir.split('/').last
|
139
|
+
if project.index('.Docs') == nil
|
140
|
+
proj_file = "#{dir}/#{project}.csproj"
|
141
|
+
if File.exists?(proj_file)
|
142
|
+
tasks.assembly_bottle File.basename(project)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
158
147
|
|
159
|
-
|
148
|
+
if !tasks.bottles.empty?
|
149
|
+
tasks.bottles.each do |c|
|
150
|
+
c.create @options
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
tasks.doc_exports.each do |opts|
|
155
|
+
opts[:version] = @build_number
|
160
156
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
157
|
+
docs = FubuDocs.new(opts)
|
158
|
+
|
159
|
+
doc_task_name = docs.export_tasks
|
160
|
+
if opts[:include_in_ci]
|
161
|
+
add_dependency :ci, doc_task_name
|
162
|
+
end
|
163
|
+
end
|
168
164
|
|
169
|
-
def add_dependency(from, to)
|
170
|
-
if to.kind_of?(Array)
|
171
|
-
to.each do |dep|
|
172
|
-
add_dependency from, dep
|
173
165
|
end
|
174
|
-
end
|
175
166
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
end
|
183
|
-
|
184
|
-
Rake::Task[from].enhance [to]
|
185
|
-
end
|
167
|
+
def add_dependency(from, to)
|
168
|
+
if to.kind_of?(Array)
|
169
|
+
to.each do |dep|
|
170
|
+
add_dependency from, dep
|
171
|
+
end
|
172
|
+
end
|
186
173
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
174
|
+
if !Rake::Task.task_defined?(from)
|
175
|
+
return
|
176
|
+
end
|
177
|
+
|
178
|
+
if !Rake::Task.task_defined?(to)
|
179
|
+
return
|
180
|
+
end
|
181
|
+
|
182
|
+
Rake::Task[from].enhance [to]
|
183
|
+
end
|
184
|
+
|
185
|
+
def create_task(name, description)
|
186
|
+
task = Rake::Task.define_task name do
|
187
|
+
|
188
|
+
end
|
189
|
+
task.add_description description
|
190
|
+
|
191
|
+
return task
|
192
|
+
end
|
195
193
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
194
|
+
def make_clean(tasks)
|
195
|
+
if tasks.clean.any?
|
196
|
+
@cleanTask = Rake::Task.define_task :clean do
|
197
|
+
tasks.clean.each do |dir|
|
198
|
+
cleanDirectory dir
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
@cleanTask.add_description "Prepares the working directory for a new build"
|
203
|
+
end
|
202
204
|
end
|
203
|
-
|
204
|
-
@cleanTask.add_description "Prepares the working directory for a new build"
|
205
|
-
end
|
206
|
-
end
|
207
205
|
|
208
206
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
207
|
+
def enable_docs(tasks)
|
208
|
+
if tasks.fubudocs_enabled
|
209
|
+
if Platform.is_nix
|
210
|
+
Dir.glob('**/*.Docs.csproj').each do |f|
|
211
|
+
tasks.assembly_bottle File.basename(f, ".csproj")
|
212
|
+
end
|
213
|
+
else
|
214
|
+
require_relative 'fubudocs'
|
215
|
+
end
|
216
|
+
end
|
217
217
|
end
|
218
|
-
|
219
|
-
|
220
|
-
end
|
221
|
-
end
|
222
218
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
end
|
229
|
-
|
230
|
-
class MvcApp
|
231
|
-
def initialize(options)
|
232
|
-
cleaned_name = options[:name].gsub('.', '_').downcase
|
233
|
-
run_args = "--directory #{options[:directory]}"
|
234
|
-
|
235
|
-
if options.has_key?(:application)
|
236
|
-
run_args += " --application #{options[:application]}
|
237
|
-
end
|
238
|
-
|
239
|
-
if options.has_key?(:build)
|
240
|
-
run_args += " --build #{options[:build]}"
|
241
|
-
end
|
242
|
-
|
243
|
-
task = Rake::Task.define_task "#{cleaned_name}:alias" do
|
244
|
-
sh "bottles alias #{cleaned_name} #{options[:directory]}"
|
245
|
-
end
|
246
|
-
task.add_description "Add the alias for #{options[:directory]}"
|
247
|
-
Rake::Task[:default].enhance ["#{cleaned_name}:alias"]
|
248
|
-
|
249
|
-
|
250
|
-
to_task "#{cleaned_name}:restart", "restart #{cleaned_name}", "touch the web.config file to force ASP.Net hosting to recycle"
|
251
|
-
to_task "#{cleaned_name}:run", "run #{run_args} --open", "run the application with Katana hosting"
|
252
|
-
to_task "#{cleaned_name}:firefox", "run #{run_args} --browser Firefox --watched", "run the application with Katana hosting and 'watch' the application w/ Firefox"
|
253
|
-
to_task "#{cleaned_name}:chrome", "run #{run_args} --browser Chrome --watched", "run the application with Katana hosting and 'watch' the application w/ Chrome"
|
254
|
-
|
219
|
+
def dump_html(options)
|
220
|
+
options[:version] = @build_number
|
221
|
+
docs = FubuDocs.new(options)
|
222
|
+
docs.dump_task
|
223
|
+
end
|
255
224
|
end
|
256
225
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
226
|
+
class MvcApp
|
227
|
+
def initialize(options)
|
228
|
+
cleaned_name = options[:name].gsub('.', '_').downcase
|
229
|
+
run_args = "--directory #{options[:directory]}"
|
230
|
+
|
231
|
+
if options.has_key?(:application)
|
232
|
+
run_args += " --application #{options[:application]}
|
233
|
+
end
|
234
|
+
|
235
|
+
if options.has_key?(:build)
|
236
|
+
run_args += " --build #{options[:build]}"
|
237
|
+
end
|
238
|
+
|
239
|
+
task = Rake::Task.define_task "#{cleaned_name}:alias" do
|
240
|
+
sh "bottles alias #{cleaned_name} #{options[:directory]}"
|
241
|
+
end
|
242
|
+
task.add_description "Add the alias for #{options[:directory]}"
|
243
|
+
Rake::Task[:default].enhance ["#{cleaned_name}:alias"]
|
244
|
+
|
245
|
+
|
246
|
+
to_task "#{cleaned_name}:restart", "restart #{cleaned_name}", "touch the web.config file to force ASP.Net hosting to recycle"
|
247
|
+
to_task "#{cleaned_name}:run", "run #{run_args} --open", "run the application with Katana hosting"
|
248
|
+
to_task "#{cleaned_name}:firefox", "run #{run_args} --browser Firefox --watched", "run the application with Katana hosting and 'watch' the application w/ Firefox"
|
249
|
+
to_task "#{cleaned_name}:chrome", "run #{run_args} --browser Chrome --watched", "run the application with Katana hosting and 'watch' the application w/ Chrome"
|
261
250
|
|
262
|
-
task.add_description description
|
263
|
-
return task
|
264
|
-
end
|
265
|
-
end
|
266
|
-
|
267
|
-
|
268
|
-
class BottleServices
|
269
|
-
def initialize(options)
|
270
|
-
@directory = options[:dir]
|
271
|
-
@prefix = options.fetch(:prefix, 'service')
|
272
|
-
@command = File.join(@directory, 'BottleServiceRunner')
|
273
|
-
|
274
|
-
consoleTask = Rake::Task.define_task "#{@prefix}:console" do
|
275
|
-
sh "start #{@command}"
|
276
|
-
end
|
277
|
-
consoleTask.add_description "Run service in console at #{@directory}"
|
278
|
-
|
279
|
-
to_task 'install', to_install_args(options), "Install the service locally"
|
280
|
-
to_task 'start', to_start_stop_args('start', options), "Start the service locally"
|
281
|
-
to_task 'stop', to_start_stop_args('stop', options), "Stop the service locally"
|
282
|
-
to_task 'uninstall', to_start_stop_args('uninstall', options), "Stop the service locally"
|
283
|
-
|
284
|
-
cleanTask = Rake::Task.define_task "#{@prefix}:clean" do
|
285
|
-
dir = File.join(@directory, 'fubu-content')
|
286
|
-
cleanDirectory dir
|
287
|
-
end
|
288
|
-
cleanTask.add_description "Cleans out any exploded bottle content at fubu-content"
|
289
|
-
end
|
290
|
-
|
291
|
-
def to_start_stop_args(verb, options)
|
292
|
-
args = "#{verb}"
|
293
|
-
|
294
|
-
if (options[:name] != nil)
|
295
|
-
args += " -servicename:#{options[:name]}"
|
296
251
|
end
|
252
|
+
|
253
|
+
def to_task(name, args, description)
|
254
|
+
task = Rake::Task.define_task name do
|
255
|
+
sh "fubu #{args}"
|
256
|
+
end
|
297
257
|
|
298
|
-
|
299
|
-
|
258
|
+
task.add_description description
|
259
|
+
return task
|
300
260
|
end
|
261
|
+
end
|
262
|
+
|
263
|
+
|
264
|
+
class BottleServices
|
265
|
+
def initialize(options)
|
266
|
+
@directory = options[:dir]
|
267
|
+
@prefix = options.fetch(:prefix, 'service')
|
268
|
+
@command = File.join(@directory, 'BottleServiceRunner.exe')
|
301
269
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
args = "install";
|
270
|
+
consoleTask = Rake::Task.define_task "#{@prefix}:console" do
|
271
|
+
sh "#{Platform.start(Platform.runtime(@command))}"
|
272
|
+
end
|
273
|
+
consoleTask.add_description "Run service in console at #{@directory}"
|
307
274
|
|
308
|
-
|
309
|
-
|
310
|
-
|
275
|
+
to_task 'install', to_install_args(options), "Install the service locally"
|
276
|
+
to_task 'start', to_start_stop_args('start', options), "Start the service locally"
|
277
|
+
to_task 'stop', to_start_stop_args('stop', options), "Stop the service locally"
|
278
|
+
to_task 'uninstall', to_start_stop_args('uninstall', options), "Stop the service locally"
|
311
279
|
|
312
|
-
|
313
|
-
|
280
|
+
cleanTask = Rake::Task.define_task "#{@prefix}:clean" do
|
281
|
+
dir = File.join(@directory, 'fubu-content')
|
282
|
+
cleanDirectory dir
|
283
|
+
end
|
284
|
+
cleanTask.add_description "Cleans out any exploded bottle content at fubu-content"
|
314
285
|
end
|
315
286
|
|
316
|
-
|
317
|
-
|
287
|
+
def to_start_stop_args(verb, options)
|
288
|
+
args = "#{verb}"
|
289
|
+
|
290
|
+
if (options[:name] != nil)
|
291
|
+
args += " -servicename:#{options[:name]}"
|
292
|
+
end
|
293
|
+
|
294
|
+
if (options[:instance] != nil)
|
295
|
+
args += " -i:#{options[:instance]}"
|
296
|
+
end
|
297
|
+
|
298
|
+
return args
|
318
299
|
end
|
300
|
+
|
301
|
+
def to_install_args(options)
|
302
|
+
args = "install";
|
303
|
+
|
304
|
+
if (options[:name] != nil)
|
305
|
+
args += " -servicename:#{options[:name]}"
|
306
|
+
end
|
307
|
+
|
308
|
+
if (options[:instance] != nil)
|
309
|
+
args += " -i:#{options[:instance]}"
|
310
|
+
end
|
311
|
+
|
312
|
+
if (options[:user] != nil)
|
313
|
+
args += " -u:#{options[:user]}"
|
314
|
+
end
|
319
315
|
|
320
|
-
|
321
|
-
|
322
|
-
|
316
|
+
if (options[:password] != nil)
|
317
|
+
args += " -p:#{options[:password]}"
|
318
|
+
end
|
323
319
|
|
324
|
-
|
325
|
-
|
326
|
-
|
320
|
+
if (options[:autostart] == true)
|
321
|
+
args += " --autostart"
|
322
|
+
end
|
327
323
|
|
328
|
-
|
329
|
-
|
330
|
-
|
324
|
+
if (options[:manual] == true)
|
325
|
+
args += " --manual"
|
326
|
+
end
|
331
327
|
|
332
|
-
|
333
|
-
|
334
|
-
|
328
|
+
if (options[:disabled] == true)
|
329
|
+
args += " --disabled"
|
330
|
+
end
|
335
331
|
|
336
|
-
|
337
|
-
|
338
|
-
|
332
|
+
if (options[:delayed] == true)
|
333
|
+
args += " --delayed"
|
334
|
+
end
|
339
335
|
|
340
|
-
|
341
|
-
|
342
|
-
|
336
|
+
if (options[:local_service] == true)
|
337
|
+
args += " --localservice"
|
338
|
+
end
|
343
339
|
|
344
|
-
|
345
|
-
|
346
|
-
|
340
|
+
if (options[:network_service] == true)
|
341
|
+
args += " --networkservice"
|
342
|
+
end
|
343
|
+
|
344
|
+
if (options[:interactive] == true)
|
345
|
+
args += " --interactive"
|
346
|
+
end
|
347
|
+
|
348
|
+
if (options[:description] != nil)
|
349
|
+
args += ' -d:"' + options[:description] + "'"
|
350
|
+
end
|
347
351
|
|
348
|
-
|
349
|
-
args += " --interactive"
|
352
|
+
return args
|
350
353
|
end
|
351
354
|
|
352
|
-
|
353
|
-
|
355
|
+
def to_task(name, args, description)
|
356
|
+
task = Rake::Task.define_task "#{@prefix}:#{name}" do
|
357
|
+
sh "#{@command} #{args}"
|
358
|
+
end
|
359
|
+
|
360
|
+
task.add_description description
|
361
|
+
return task
|
354
362
|
end
|
363
|
+
end
|
355
364
|
|
356
|
-
return args
|
357
|
-
end
|
358
|
-
|
359
|
-
def to_task(name, args, description)
|
360
|
-
task = Rake::Task.define_task "#{@prefix}:#{name}" do
|
361
|
-
sh "#{@command} #{args}"
|
362
|
-
end
|
363
|
-
|
364
|
-
task.add_description description
|
365
|
-
return task
|
366
|
-
end
|
367
|
-
end
|
368
|
-
|
369
365
|
|
370
366
|
class Storyteller
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
367
|
+
def initialize(options)
|
368
|
+
# :path
|
369
|
+
# :compilemode -- take it from @solution.compiletarget
|
370
|
+
# :results
|
371
|
+
# :workspace
|
372
|
+
# :profile
|
373
|
+
# :title
|
374
|
+
# :source
|
375
|
+
# :prefix
|
376
|
+
# :st_path
|
377
|
+
# :specs
|
378
|
+
|
379
|
+
@directory = options[:dir]
|
380
|
+
@prefix = options.fetch(:prefix, 'st')
|
381
|
+
@src = options.fetch(:source, 'src')
|
382
|
+
@results = options.fetch(:results, 'results.htm')
|
383
|
+
@st_path = options.fetch(:st_path, "#{@src}/packages/Storyteller2/tools")
|
384
|
+
@title = options.fetch(:title, 'Storyteller Specs')
|
385
|
+
@specs = options.fetch(:specs, 'specs')
|
386
|
+
@suites = options.fetch(:suites, [])
|
391
387
|
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
388
|
+
to_task 'run', 'ST.exe', "run #{to_args(options, @results)}", "Run the Storyteller tests for #{@directory}"
|
389
|
+
to_task 'specs', 'ST.exe', "specs #{to_args(options, @specs)} --title \"#{@title}\"", "dump the specs for Storyteller tests at #{@directory}"
|
390
|
+
|
391
|
+
@suites.each do |s|
|
392
|
+
to_task "run:#{s.downcase}", 'ST.exe', "run #{to_args(options, @results)} -w #{s}", "Run the Storyteller tests for suite #{s}"
|
393
|
+
end
|
394
|
+
|
395
|
+
if !Platform.is_nix
|
396
|
+
# StoryTellerUI.exe is a WPF application which is
|
397
|
+
# not supported on nix and therefore setting up the task
|
398
|
+
# is pointless.
|
399
|
+
openTask = Rake::Task.define_task "#{@prefix}:open" do
|
400
|
+
tool = 'StoryTellerUI.exe'
|
401
|
+
cmd = Platform.runtime("#{File.join(@st_path, tool)}") + " #{to_args(options, @results)}"
|
402
|
+
puts "Opening the Storyteller UI to #{@directory}"
|
403
|
+
sh cmd
|
404
|
+
end
|
405
|
+
openTask.add_description "Open the Storyteller UI for tests at #{@directory}"
|
406
|
+
openTask.enhance [:compile]
|
407
|
+
end
|
397
408
|
end
|
398
409
|
|
399
|
-
openTask = Rake::Task.define_task "#{@prefix}:open" do
|
400
|
-
tool = 'StorytellerUI.exe'
|
401
|
-
cmd = "start #{File.join(@st_path, tool)} #{to_args(options, @results)}"
|
402
|
-
puts "Opening the Storyteller UI to #{@directory}"
|
403
|
-
sh cmd
|
404
|
-
end
|
405
|
-
openTask.add_description "Open the Storyteller UI for tests at #{@directory}"
|
406
|
-
openTask.enhance [:compile]
|
407
|
-
end
|
408
|
-
|
409
|
-
|
410
|
-
def to_task(name, tool, args, description)
|
411
|
-
task = Rake::Task.define_task "#{@prefix}:#{name}" do
|
412
|
-
sh "#{File.join(@st_path, tool)} #{args}"
|
413
|
-
end
|
414
|
-
|
415
|
-
task.add_description description
|
416
|
-
task.enhance [:compile]
|
417
|
-
|
418
|
-
return task
|
419
|
-
end
|
420
|
-
|
421
|
-
def to_args(options, output)
|
422
|
-
args = "#{options[:path]} #{output}"
|
423
|
-
|
424
|
-
if (options[:compilemode] != nil)
|
425
|
-
args += " --compile #{options[:compilemode]}"
|
426
|
-
end
|
427
410
|
|
428
|
-
|
429
|
-
|
430
|
-
|
411
|
+
def to_task(name, tool, args, description)
|
412
|
+
task = Rake::Task.define_task "#{@prefix}:#{name}" do
|
413
|
+
sh Platform.runtime("#{File.join(@st_path, tool)}") + " #{args}"
|
414
|
+
end
|
431
415
|
|
432
|
-
|
433
|
-
|
416
|
+
task.add_description description
|
417
|
+
task.enhance [:compile]
|
418
|
+
|
419
|
+
return task
|
434
420
|
end
|
435
421
|
|
436
|
-
|
437
|
-
|
422
|
+
def to_args(options, output)
|
423
|
+
args = "#{options[:path]} #{output}"
|
424
|
+
|
425
|
+
if (options[:compilemode] != nil)
|
426
|
+
args += " --compile #{options[:compilemode]}"
|
427
|
+
end
|
428
|
+
|
429
|
+
if (options[:workspace] != nil)
|
430
|
+
args += " --workspace #{options[:workspace]}"
|
431
|
+
end
|
432
|
+
|
433
|
+
if (options[:profile] != nil)
|
434
|
+
args += " --profile #{options[:profile]}"
|
435
|
+
end
|
436
|
+
|
437
|
+
return args
|
438
|
+
end
|
438
439
|
end
|
439
440
|
end
|
440
441
|
|
441
442
|
|
442
443
|
|
443
444
|
|
445
|
+
|
444
446
|
def copyOutputFiles(fromDir, filePattern, outDir)
|
445
|
-
|
446
|
-
|
447
|
-
|
447
|
+
Dir.glob(File.join(fromDir, filePattern)){|file|
|
448
|
+
copy(file, outDir) if File.file?(file)
|
449
|
+
}
|
448
450
|
end
|
449
451
|
|
450
452
|
def waitfor(&block)
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
453
|
+
checks = 0
|
454
|
+
until block.call || checks >10
|
455
|
+
sleep 0.5
|
456
|
+
checks += 1
|
457
|
+
end
|
458
|
+
raise 'waitfor timeout expired' if checks > 10
|
457
459
|
end
|
458
460
|
|
459
461
|
def cleanDirectory(dir)
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
462
|
+
if exists?(dir)
|
463
|
+
puts 'Cleaning directory ' + dir
|
464
|
+
FileUtils.rm_rf dir;
|
465
|
+
waitfor { !exists?(dir) }
|
466
|
+
end
|
467
|
+
|
468
|
+
if dir == 'artifacts'
|
469
|
+
Dir.mkdir 'artifacts'
|
470
|
+
end
|
469
471
|
end
|
470
472
|
|
471
473
|
def cleanFile(file)
|
472
|
-
|
474
|
+
File.delete file unless !File.exist?(file)
|
473
475
|
end
|
474
476
|
|