dev 2.1.153 → 2.1.154
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 +4 -4
- data/lib/apps/git.rb +207 -208
- data/lib/apps/msbuild.rb +90 -90
- data/lib/apps/nbench.rb +2 -1
- data/lib/apps/nuget.rb +57 -59
- data/lib/apps/svn.rb +137 -143
- data/lib/apps/wix.rb +47 -50
- data/lib/apps/xcodebuild.rb +13 -11
- data/lib/apps/zip.rb +25 -25
- data/lib/apps.rb +3 -1
- data/lib/base/array.rb +66 -64
- data/lib/base/command.rb +237 -238
- data/lib/base/dir.rb +73 -76
- data/lib/base/environment.rb +94 -99
- data/lib/base/file.rb +35 -33
- data/lib/base/gemspec.rb +47 -45
- data/lib/base/giturl.rb +88 -90
- data/lib/base/hash.rb +20 -15
- data/lib/base/history.rb +36 -33
- data/lib/base/internet.rb +22 -20
- data/lib/base/project.rb +410 -423
- data/lib/base/projects.rb +231 -246
- data/lib/base/source.rb +22 -20
- data/lib/base/string.rb +6 -4
- data/lib/base/text.rb +16 -14
- data/lib/base/timeout.rb +29 -28
- data/lib/base/timer.rb +23 -19
- data/lib/base/version.rb +68 -72
- data/lib/base.rb +5 -3
- data/lib/commands.rb +47 -43
- data/lib/dev.config.rb +3 -2
- data/lib/dev.rb +65 -66
- data/lib/tasks/add.rb +34 -40
- data/lib/tasks/analyze.rb +17 -15
- data/lib/tasks/build.rb +101 -103
- data/lib/tasks/clean.rb +6 -4
- data/lib/tasks/clobber.rb +20 -18
- data/lib/tasks/commit.rb +42 -44
- data/lib/tasks/default.rb +41 -39
- data/lib/tasks/doc.rb +10 -8
- data/lib/tasks/info.rb +8 -7
- data/lib/tasks/package.rb +23 -20
- data/lib/tasks/publish.rb +20 -25
- data/lib/tasks/pull.rb +9 -9
- data/lib/tasks/push.rb +11 -13
- data/lib/tasks/setup.rb +180 -183
- data/lib/tasks/test.rb +121 -107
- data/lib/tasks/update.rb +13 -11
- data/lib/tasks.rb +38 -42
- metadata +7 -9
- data/bin/dev +0 -3
data/lib/tasks/package.rb
CHANGED
@@ -1,27 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
puts __FILE__ if defined?(DEBUG)
|
2
4
|
|
3
|
-
require_relative(
|
5
|
+
require_relative("../base/environment")
|
4
6
|
|
5
|
-
NUGET_FILES=FileList.new(
|
7
|
+
NUGET_FILES = FileList.new("**/*.nuspec")
|
6
8
|
|
7
|
-
desc
|
8
|
-
task :package do Tasks.execute_task :package;end
|
9
|
+
desc "performs package commands"
|
10
|
+
task :package do Tasks.execute_task :package; end
|
9
11
|
|
10
12
|
class Package < Array
|
11
|
-
|
12
|
-
|
13
|
+
def update
|
14
|
+
update_nuget if Environment.windows?
|
15
|
+
end
|
16
|
+
|
17
|
+
def update_nuget
|
18
|
+
puts "Package scanning for nuget files" if Environment.default.debug?
|
19
|
+
NUGET_FILES.each do |nuget_file|
|
20
|
+
next if nuget_file.include?("/obj/")
|
21
|
+
|
22
|
+
package_commands = Nuget.get_build_commands nuget_file
|
23
|
+
next if package_commands.nil?
|
24
|
+
|
25
|
+
package_commands.each do |c|
|
26
|
+
add_passive(c)
|
27
|
+
end
|
13
28
|
end
|
14
|
-
|
15
|
-
|
16
|
-
NUGET_FILES.each{|nuget_file|
|
17
|
-
if(!nuget_file.include?('/obj/'))
|
18
|
-
package_commands = Nuget.get_build_commands nuget_file
|
19
|
-
if(!package_commands.nil?)
|
20
|
-
package_commands.each{|c|
|
21
|
-
add_passive(c)
|
22
|
-
}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
}
|
26
|
-
end
|
27
|
-
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/tasks/publish.rb
CHANGED
@@ -1,29 +1,24 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../base/array"
|
4
|
+
desc "performs publish commands"
|
3
5
|
task :publish do Tasks.execute_task :publish; end
|
4
6
|
|
5
7
|
class Publish < Array
|
8
|
+
def update
|
9
|
+
add_quiet "<%Git.tag('#{Rake.application.original_dir}','#{VERSION}')%>" if File.exist?(".git") && defined?(VERSION)
|
6
10
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if(`svn info`.include?('/trunk'))
|
22
|
-
Dir.glob('*.gemspec').each{|gemspec_file|
|
23
|
-
add_quiet "gem push #{Gemspec.gemfile(gemspec_file)}" if !Gemspec.published? gemspec_file
|
24
|
-
}
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
11
|
+
if Internet.available?
|
12
|
+
if File.exist?(".git") && `git branch`.include?("* master")
|
13
|
+
Dir.glob("*.gemspec").each do |gemspec_file|
|
14
|
+
add_passive "gem push #{Gemspec.gemfile(gemspec_file)}" unless Gemspec.published? gemspec_file
|
15
|
+
end
|
16
|
+
end
|
17
|
+
if File.exist?(".svn") && `svn info`.include?("/trunk")
|
18
|
+
Dir.glob("*.gemspec").each do |gemspec_file|
|
19
|
+
add_quiet "gem push #{Gemspec.gemfile(gemspec_file)}" unless Gemspec.published? gemspec_file
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/tasks/pull.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
desc "performs a git pull"
|
2
4
|
task :pull do Tasks.execute_task :pull; end
|
3
5
|
|
4
6
|
class Pull < Array
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
12
|
-
end
|
7
|
+
def update
|
8
|
+
if !defined?(NO_PULL) && File.exist?(".git") && `git config --list`.include?("user.name=") && (Git.branch == "master")
|
9
|
+
add_passive("git pull")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/tasks/push.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
desc "performs a git push"
|
4
|
+
task :push do Tasks.execute_task :push; end
|
3
5
|
|
4
6
|
class Push < Array
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
7
|
+
def update
|
8
|
+
if !defined?(NO_PUSH) && (File.exist?(".git") && `git config --list`.include?("user.name=")) && (`git branch`.include?("* master") || `git branch`.include?("* develop"))
|
9
|
+
add_passive "git push"
|
10
|
+
add_passive "git push --tags"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/tasks/setup.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
desc "performs setup commands"
|
4
|
+
task :setup do Tasks.execute_task :setup; end
|
3
5
|
|
4
6
|
#
|
5
7
|
# use the SVN_EXPORTS hash to define svn exports destined for DEV_ROOT/dep
|
@@ -7,185 +9,180 @@ task :setup do Tasks.execute_task :setup;end
|
|
7
9
|
# SVN_EXPORT={ 'System.Data.SQLite/1.0.93.0' => 'https://third-party.googlecode.com/svn/trunk/System.Data.SQLite/1.0.93.0' }
|
8
10
|
#
|
9
11
|
class Setup < Array
|
12
|
+
def initialize(value = nil)
|
13
|
+
env = value if value.is_a? Environment
|
14
|
+
end
|
15
|
+
|
16
|
+
def update
|
17
|
+
env = Environment.new if env.nil?
|
18
|
+
add_quiet "bundle install" if File.exist? "Gemfile"
|
19
|
+
|
20
|
+
Dir.glob("*.gemspec").each do |gemspec_file|
|
21
|
+
add_quiet "<%Gemspec.update('#{gemspec_file}')%>"
|
22
|
+
end
|
23
|
+
|
24
|
+
if Dir.glob("**/packages.config").length.positive?
|
25
|
+
Dir.glob("**/*.sln").each do |sln_file|
|
26
|
+
add_quiet "nuget restore \"#{sln_file}\"" unless sln_file.include?("packages/")
|
27
|
+
end
|
28
|
+
else
|
29
|
+
Dir.glob("**/*.sln").each do |sln_file|
|
30
|
+
add_quiet "dotnet restore \"#{sln_file}\""
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
add_quiet "dotnet restore" if File.exist?("project.json")
|
35
|
+
|
36
|
+
# puts 'Setup checking SVN_EXPORTS...' if env.debug?
|
37
|
+
if defined?(SVN_EXPORTS)
|
38
|
+
SVN_EXPORTS.each do |k, v|
|
39
|
+
dest = "#{Command.dev_root}/dep/#{k}"
|
40
|
+
if !File.exist?(dest)
|
41
|
+
puts "#{Command.dev_root}/dep/#{k} does not exists" if env.debug?
|
42
|
+
FileUtils.mkdir_p(File.dirname(dest)) unless File.exist?(File.dirname(dest))
|
43
|
+
unless 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
|
+
elsif env.debug?
|
54
|
+
puts "#{Command.dev_root}/dep/#{k} exists."
|
55
|
+
end
|
56
|
+
end
|
57
|
+
else
|
58
|
+
# puts 'SVN_EXPORTS is not defined' if env.debug?
|
59
|
+
end
|
60
|
+
|
61
|
+
if defined?(GIT_EXPORTS)
|
62
|
+
GIT_EXPORTS.each do |k, v|
|
63
|
+
directory = "#{Command.dev_root}/dep/#{k}"
|
64
|
+
unless File.exist?(directory)
|
65
|
+
if v.include?("@")
|
66
|
+
puts `git clone #{v.split("@")[0]} #{directory}`
|
67
|
+
Dir.chdir(directory) do
|
68
|
+
puts `git reset --hard #{v.split("@")[1]}`
|
69
|
+
end
|
70
|
+
else
|
71
|
+
add_quiet "git clone #{v} #{directory}"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
if defined?(ZIP_EXPORTS)
|
78
|
+
ZIP_EXPORTS.each do |k, v|
|
79
|
+
# puts "Here: #{k} -> #{v}"
|
80
|
+
directory = "#{Command.dev_root}/dep/#{k}"
|
81
|
+
Zip.export(v, directory) unless Dir.exist?(directory)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
if defined?(VERSION)
|
86
|
+
# puts "updating nuspec files for VERSION #{VERSION}" if env.debug?
|
87
|
+
Dir.glob("*.nuspec").each do |nuspec|
|
88
|
+
# current_version=IO.read(nuspec).scan(/<version>[\d.\w]+<\/version>/)[0]
|
89
|
+
current_version = IO.read(nuspec).scan(%r{<version>[\d.\w-]+</version>})[0]
|
90
|
+
next if current_version.nil?
|
91
|
+
|
92
|
+
tag = ""
|
93
|
+
if current_version.length > 1
|
94
|
+
tag = IO.read(nuspec).scan(%r{<version>([\d.]+)([\w-]+)?</version>})[0][1]
|
95
|
+
puts "pre-release tag #{tag}"
|
96
|
+
else
|
97
|
+
puts "no pre-release tag"
|
98
|
+
end
|
99
|
+
|
100
|
+
puts "#{nuspec} current version=#{current_version}" # if env.debug?
|
101
|
+
next unless current_version.include?("<version>")
|
102
|
+
|
103
|
+
target_version = "<version>#{VERSION}#{tag}</version>"
|
104
|
+
if current_version != target_version
|
105
|
+
add_quiet "<%Text.replace_in_file('#{nuspec}','#{current_version}','#{target_version}')%>"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
Dir.glob("**/AssemblyInfo.cs").each do |assemblyInfo|
|
109
|
+
current_version = IO.read(assemblyInfo).scan(/Version\("[\d.]+"\)/)[0]
|
110
|
+
next if current_version.nil?
|
111
|
+
|
112
|
+
puts "#{assemblyInfo} current version=#{current_version}" if env.debug?
|
113
|
+
next unless current_version.include?("Version(")
|
114
|
+
|
115
|
+
target_version = "Version(\"#{VERSION}\")"
|
116
|
+
if current_version != target_version
|
117
|
+
add_quiet "<%Text.replace_in_file('#{assemblyInfo}','#{current_version}','#{target_version}')%>"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
Dir.glob("*.yml").each do |yml|
|
121
|
+
puts "scanning #{yml} for version..." if defined?(DEBUG)
|
122
|
+
current_version = IO.read(yml).scan(/v:\("[\d.]+"\)/)[0]
|
123
|
+
puts "no version found in #{yml}" if current_version.nil?
|
124
|
+
next if current_version.nil?
|
125
|
+
|
126
|
+
puts "#{yml} current version=#{current_version}" if defined?(DEBUG)
|
127
|
+
next unless current_version.include?("v:")
|
128
|
+
|
129
|
+
target_version = "v:\"#{VERSION}\""
|
130
|
+
if current_version != target_version
|
131
|
+
add "<%Text.replace_in_file('#{yml}','#{current_version}','#{target_version}')%>"
|
132
|
+
end
|
133
|
+
end
|
134
|
+
Dir.glob("**/*.csproj").each do |csproj|
|
135
|
+
current_version = IO.read(csproj).scan(%r{<PackageVersion>[\d.]+</PackageVersion>})[0]
|
136
|
+
unless current_version.nil?
|
137
|
+
puts "#{csproj} current version=#{current_version}" if env.debug?
|
138
|
+
if current_version.include?("<PackageVersion>")
|
139
|
+
target_version = "<PackageVersion>#{VERSION}</PackageVersion>"
|
140
|
+
if current_version != target_version
|
141
|
+
add_quiet "<%Text.replace_in_file('#{csproj}','#{current_version}','#{target_version}')%>"
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
current_version = IO.read(csproj).scan(%r{<Version>[\d.]+</Version>})[0]
|
146
|
+
next if current_version.nil?
|
147
|
+
|
148
|
+
puts "#{csproj} current version=#{current_version}" if env.debug?
|
149
|
+
next unless current_version.include?("<Version>")
|
150
|
+
|
151
|
+
target_version = "<Version>#{VERSION}</Version>"
|
152
|
+
if current_version != target_version
|
153
|
+
add_quiet "<%Text.replace_in_file('#{csproj}','#{current_version}','#{target_version}')%>"
|
154
|
+
end
|
155
|
+
end
|
156
|
+
Dir.glob("**/*.{wxs,_wxs}").each do |wxs|
|
157
|
+
current_version = IO.read(wxs).scan(/\sVersion=["']([\d.]+)["']/)[0][0]
|
158
|
+
puts "#{wxs} current version=#{current_version}" if env.debug?
|
159
|
+
unless current_version.nil? # nclude?('Version='))
|
160
|
+
target_version = VERSION # {}"Version=\"#{VERSION}\")="
|
161
|
+
if current_version != target_version
|
162
|
+
add_quiet "<%Text.replace_in_file('#{wxs}','#{current_version}','#{target_version}')%>"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
rescue StandardError
|
166
|
+
end
|
167
|
+
end
|
168
|
+
log_debug_info("Setup")
|
169
|
+
end
|
10
170
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
add_quiet "dotnet restore \"#{sln_file}\""
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
if(File.exists?('project.json'))
|
34
|
-
add_quiet "dotnet restore"
|
35
|
-
end
|
36
|
-
|
37
|
-
#puts 'Setup checking SVN_EXPORTS...' if env.debug?
|
38
|
-
if(defined?(SVN_EXPORTS))
|
39
|
-
SVN_EXPORTS.each{|k,v|
|
40
|
-
dest="#{Command.dev_root}/dep/#{k}"
|
41
|
-
if(!File.exists?(dest))
|
42
|
-
puts "#{Command.dev_root}/dep/#{k} does not exists" if env.debug?
|
43
|
-
FileUtils.mkdir_p(File.dirname(dest)) if !File.exists?(File.dirname(dest))
|
44
|
-
if(!dest.include?("@"))
|
45
|
-
puts "adding svn export #{v} #{dest}" if env.debug?
|
46
|
-
add_quiet "svn export #{v} #{dest}"
|
47
|
-
end
|
48
|
-
if(dest.include?("@"))
|
49
|
-
puts "adding svn export #{v} #{dest}@" if env.debug?
|
50
|
-
add_quiet "svn export #{v} #{dest}@"
|
51
|
-
end
|
52
|
-
#add "svn export #{v} #{dest}" if !dest.include?("@")
|
53
|
-
#add "svn export #{v} #{dest}@" if dest.include?("@")
|
54
|
-
else
|
55
|
-
puts "#{Command.dev_root}/dep/#{k} exists." if env.debug?
|
56
|
-
end
|
57
|
-
}
|
58
|
-
else
|
59
|
-
#puts 'SVN_EXPORTS is not defined' if env.debug?
|
60
|
-
end
|
61
|
-
|
62
|
-
if(defined?(GIT_EXPORTS))
|
63
|
-
GIT_EXPORTS.each{|k,v|
|
64
|
-
directory = "#{Command.dev_root}/dep/#{k}"
|
65
|
-
if(!File.exists?(directory))
|
66
|
-
if(v.include?('@'))
|
67
|
-
puts `git clone #{v.split('@')[0]} #{directory}`
|
68
|
-
Dir.chdir(directory) do
|
69
|
-
puts `git reset --hard #{v.split('@')[1]}`
|
70
|
-
end
|
71
|
-
else
|
72
|
-
add_quiet "git clone #{v} #{directory}"
|
73
|
-
end
|
74
|
-
end
|
75
|
-
}
|
76
|
-
end
|
77
|
-
|
78
|
-
if(defined?(ZIP_EXPORTS))
|
79
|
-
ZIP_EXPORTS.each{|k,v|
|
80
|
-
#puts "Here: #{k} -> #{v}"
|
81
|
-
directory = "#{Command.dev_root}/dep/#{k}"
|
82
|
-
Zip.export(v, directory) unless(Dir.exists?(directory))
|
83
|
-
}
|
84
|
-
end
|
85
|
-
|
86
|
-
if(defined?(VERSION))
|
87
|
-
#puts "updating nuspec files for VERSION #{VERSION}" if env.debug?
|
88
|
-
Dir.glob('*.nuspec').each{|nuspec|
|
89
|
-
#current_version=IO.read(nuspec).scan(/<version>[\d.\w]+<\/version>/)[0]
|
90
|
-
current_version=IO.read(nuspec).scan(/<version>[\d.\w-]+<\/version>/)[0]
|
91
|
-
if(!current_version.nil?)
|
92
|
-
tag=''
|
93
|
-
if(current_version.length > 1)
|
94
|
-
tag=IO.read(nuspec).scan(/<version>([\d.]+)([\w-]+)?<\/version>/)[0][1]
|
95
|
-
puts "pre-release tag #{tag}"
|
96
|
-
else
|
97
|
-
puts 'no pre-release tag'
|
98
|
-
end
|
99
|
-
|
100
|
-
puts "#{nuspec} current version=#{current_version}" #if env.debug?
|
101
|
-
if(current_version.include?('<version>'))
|
102
|
-
target_version="<version>#{VERSION}#{tag}</version>"
|
103
|
-
if(current_version != target_version)
|
104
|
-
add_quiet "<%Text.replace_in_file('#{nuspec}','#{current_version}','#{target_version}')%>"
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
}
|
109
|
-
Dir.glob('**/AssemblyInfo.cs').each{|assemblyInfo|
|
110
|
-
current_version=IO.read(assemblyInfo).scan(/Version\(\"[\d.]+\"\)/)[0]
|
111
|
-
if(!current_version.nil?)
|
112
|
-
puts "#{assemblyInfo} current version=#{current_version}" if env.debug?
|
113
|
-
if(current_version.include?('Version('))
|
114
|
-
target_version="Version(\"#{VERSION}\")"
|
115
|
-
if(current_version != target_version)
|
116
|
-
add_quiet "<%Text.replace_in_file('#{assemblyInfo}','#{current_version}','#{target_version}')%>"
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
}
|
121
|
-
Dir.glob('*.yml').each{|yml|
|
122
|
-
puts "scanning #{yml} for version..." if defined?(DEBUG)
|
123
|
-
current_version=IO.read(yml).scan(/v:\(\"[\d.]+\"\)/)[0]
|
124
|
-
puts "no version found in #{yml}" if current_version.nil?
|
125
|
-
if(!current_version.nil?)
|
126
|
-
puts "#{yml} current version=#{current_version}" if defined?(DEBUG)
|
127
|
-
if(current_version.include?('v:'))
|
128
|
-
target_version="v:\"#{VERSION}\""
|
129
|
-
if(current_version != target_version)
|
130
|
-
add "<%Text.replace_in_file('#{yml}','#{current_version}','#{target_version}')%>"
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
}
|
135
|
-
Dir.glob('**/*.csproj').each{|csproj|
|
136
|
-
current_version=IO.read(csproj).scan(/<PackageVersion>[\d.]+<\/PackageVersion>/)[0]
|
137
|
-
if(!current_version.nil?)
|
138
|
-
puts "#{csproj} current version=#{current_version}" if env.debug?
|
139
|
-
if(current_version.include?('<PackageVersion>'))
|
140
|
-
target_version="<PackageVersion>#{VERSION}</PackageVersion>"
|
141
|
-
if(current_version != target_version)
|
142
|
-
add_quiet "<%Text.replace_in_file('#{csproj}','#{current_version}','#{target_version}')%>"
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
current_version=IO.read(csproj).scan(/<Version>[\d.]+<\/Version>/)[0]
|
147
|
-
if(!current_version.nil?)
|
148
|
-
puts "#{csproj} current version=#{current_version}" if env.debug?
|
149
|
-
if(current_version.include?('<Version>'))
|
150
|
-
target_version="<Version>#{VERSION}</Version>"
|
151
|
-
if(current_version != target_version)
|
152
|
-
add_quiet "<%Text.replace_in_file('#{csproj}','#{current_version}','#{target_version}')%>"
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
}
|
157
|
-
Dir.glob('**/*.{wxs,_wxs}').each{|wxs|
|
158
|
-
begin
|
159
|
-
current_version=IO.read(wxs).scan(/\sVersion=[\"']([\d.]+)[\"']/)[0][0]
|
160
|
-
puts "#{wxs} current version=#{current_version}" if env.debug?
|
161
|
-
if(!current_version.nil?)#nclude?('Version='))
|
162
|
-
target_version=VERSION#{}"Version=\"#{VERSION}\")="
|
163
|
-
if(current_version != target_version)
|
164
|
-
add_quiet "<%Text.replace_in_file('#{wxs}','#{current_version}','#{target_version}')%>"
|
165
|
-
end
|
166
|
-
end
|
167
|
-
rescue
|
168
|
-
end
|
169
|
-
}
|
170
|
-
end
|
171
|
-
log_debug_info("Setup")
|
172
|
-
end
|
173
|
-
|
174
|
-
def self.setupStandardClassLib(name,language)
|
175
|
-
projectExtension="csproj"
|
176
|
-
projectExtension="fsproj" if(language=="F#")
|
177
|
-
FileUtils.mkdir(name)if(!Dir.exists?(name))
|
178
|
-
if(!File.exists?("#{name}/#{name}.#{projectExtension}"))
|
179
|
-
Dir.chdir(name) do
|
180
|
-
puts `dotnet new classlib -lang #{language}`
|
181
|
-
end
|
182
|
-
end
|
183
|
-
FileUtils.mkdir("#{name}.Test")if(!Dir.exists?("#{name}.Test"))
|
184
|
-
if(!File.exists?("#{name}.Test/#{name}.Test.#{projectExtension}"))
|
185
|
-
Dir.chdir("#{name}.Test") do
|
186
|
-
puts `dotnet new nunit -lang #{language}`
|
187
|
-
puts `dotnet add reference ../#{name}/#{name}.#{projectExtension}`
|
188
|
-
end
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|
171
|
+
def self.setupStandardClassLib(name, language)
|
172
|
+
projectExtension = "csproj"
|
173
|
+
projectExtension = "fsproj" if language == "F#"
|
174
|
+
FileUtils.mkdir(name) unless Dir.exist?(name)
|
175
|
+
unless File.exist?("#{name}/#{name}.#{projectExtension}")
|
176
|
+
Dir.chdir(name) do
|
177
|
+
puts `dotnet new classlib -lang #{language}`
|
178
|
+
end
|
179
|
+
end
|
180
|
+
FileUtils.mkdir("#{name}.Test") unless Dir.exist?("#{name}.Test")
|
181
|
+
unless File.exist?("#{name}.Test/#{name}.Test.#{projectExtension}")
|
182
|
+
Dir.chdir("#{name}.Test") do
|
183
|
+
puts `dotnet new nunit -lang #{language}`
|
184
|
+
puts `dotnet add reference ../#{name}/#{name}.#{projectExtension}`
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|