delphivm 0.7.7 → 0.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7d2acce55cf3d45e6bd0cf88af6fd8b2812f743
4
- data.tar.gz: 7bfdafdb4536e2a71c6f3953086cd2d741a56d59
3
+ metadata.gz: ffd80d6a4e910ba6228a8d7f2101eb982d039ba8
4
+ data.tar.gz: e6b73cff009b43f837757fca00c3e233013325c4
5
5
  SHA512:
6
- metadata.gz: 021bc9cf2dc28520b3789f2b93bce4c860011dc8b12c3ada9bdc8b6afb5bd0c0aa90b77db726597f06e2dc7f2e32109eebd005decae5ed4d16b599c2de89c043
7
- data.tar.gz: 364539e676ccdd015a8ddbd65039983dea5860c5956066f8c7be87b0e36c0f65d85905a26b19e6bc58e4e6b34c37d1a34633f13c105d75607f486581e23f02c6
6
+ metadata.gz: 8ef751a83859061335a15cf5eeea484b728fd039e97847fa68fc0e4110e744cf26e5934a04836349d8433f0faac440c3784d47e7384ad2b5e0a988bfcc272f40
7
+ data.tar.gz: fd41c76496a2f477846a299cc286ddf90c3c8985a7dff742d00c9e54b7caac997a3adede2b932e4479a237c7ab01db6e562ee1b52d97f69a619fa5fa7093dfda
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gem "version_info"
6
6
  gem "rubyzip", :require => "zip/zip"
7
7
  gem "ruby-progressbar"
8
8
  gem "nokogiri"
9
-
9
+ gem "dnote"
10
10
  group :development do
11
11
  gem "ocra"
12
12
  end
data/Gemfile.lock CHANGED
@@ -1,34 +1,19 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- colorize (0.5.8)
5
- coveralls (0.6.3)
6
- colorize
7
- multi_json (~> 1.3)
8
- rest-client
9
- simplecov (>= 0.7)
10
- thor
11
- mime-types (1.21)
12
- multi_json (1.7.2)
13
- nokogiri (1.5.9)
4
+ dnote (1.7.1)
14
5
  nokogiri (1.5.9-x86-mingw32)
15
- ocra (1.3.0)
16
- rest-client (1.6.7)
17
- mime-types (>= 1.16)
6
+ ocra (1.3.1)
18
7
  ruby-progressbar (1.0.2)
19
8
  rubyzip (0.9.9)
20
- simplecov (0.7.1)
21
- multi_json (~> 1.0)
22
- simplecov-html (~> 0.7.1)
23
- simplecov-html (0.7.1)
24
- thor (0.18.0)
9
+ thor (0.18.1)
25
10
  version_info (1.7.6)
26
11
 
27
12
  PLATFORMS
28
13
  x86-mingw32
29
14
 
30
15
  DEPENDENCIES
31
- coveralls
16
+ dnote
32
17
  nokogiri
33
18
  ocra
34
19
  ruby-progressbar
data/bin/delphivm CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
2
 
4
3
  begin
5
4
  $LOAD_PATH.unshift File.join(File.dirname($0), '..', 'lib')
@@ -27,3 +26,4 @@ rescue Exception => e
27
26
  puts e.backtrace.join("\n") if defined? ::BACKTRACE
28
27
  exit 1
29
28
  end
29
+ exit 0
data/lib/delphivm.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
2
 
4
3
  require 'thor'
5
4
  require 'pathname'
@@ -26,7 +25,7 @@ require 'delphivm/version'
26
25
  require 'delphivm/ide_services'
27
26
  require 'delphivm/dsl'
28
27
 
29
- require 'thor/runner'
28
+ require 'delphivm/runner'
30
29
 
31
30
  if Delphivm::ROOT == Pathname(__FILE__).dirname.parent
32
31
  TARGET = Object.const_get('Delphivm')
@@ -116,17 +115,15 @@ protected
116
115
  def self.publish
117
116
  [:clean, :make, :build].each do |mth|
118
117
  desc "#{mth}", "#{mth} #{self.namespace} products"
119
- method_option :config, type: :array, aliases: '-c', default: 'Debug', desc: "use IDE config(s): Debug, Release, etc"
118
+ method_option :params, type: :hash, aliases: '-p', default: {:Config => 'Debug'}, desc: "more MSBuild params. See MSBuild help"
120
119
  define_method mth do
121
- IDEServices.ideused.each do |idetag|
122
- configs = [options[:config]].flatten
123
- configs.each do |cfg|
124
- self.idetag = idetag
125
- self.config = cfg
126
- self.clear_products
127
- self.class.depends.each { |task| self.invoke "#{task}:#{mth}" }
128
- send("do_#{mth}", idetag, cfg)
129
- end
120
+ msbuild_params = options[:params]
121
+ IDEServices.ideused.each do |idetag|
122
+ self.idetag = idetag
123
+ self.config = msbuild_params
124
+ self.clear_products
125
+ self.class.depends.each { |task| self.invoke "#{task}:#{mth}" }
126
+ send("do_#{mth}", idetag, msbuild_params)
130
127
  end
131
128
  end
132
129
  end
@@ -138,27 +135,3 @@ protected
138
135
  end
139
136
 
140
137
  end
141
-
142
- class Delphivm
143
- EXE_NAME = File.basename($0, '.rb')
144
-
145
- PATH_TO_VENDOR = ROOT + 'vendor'
146
- PATH_TO_VENDOR_CACHE = PATH_TO_VENDOR + 'cache'
147
- PATH_TO_VENDOR_IMPORTS = PATH_TO_VENDOR + 'imports'
148
- DVM_IMPORTS_FILE = PATH_TO_VENDOR + 'imports.dvm'
149
-
150
- class Runner
151
- # remove some tasks not needed
152
- remove_task :install, :installed, :uninstall, :update
153
-
154
- # default version and banner outputs THOR, so redefine it
155
- def self.banner(task, all = false, subcommand = false)
156
- "#{Delphivm::EXE_NAME} " + task.formatted_usage(self, all, subcommand)
157
- end
158
-
159
- desc "version", "Show #{Delphivm::EXE_NAME} version"
160
- def version
161
- say "#{Delphivm::VERSION}"
162
- end
163
- end
164
- end
data/lib/delphivm/dsl.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: UTF-8
1
+
2
2
  class Delphivm
3
3
 
4
4
  module DSL
@@ -42,19 +42,15 @@ class Delphivm
42
42
  full_url = source_uri + '/' + file_name
43
43
  to_here = dowonlad_root_path + file_name
44
44
  pb = nil
45
- puts "Downloading: #{full_url}"
45
+ puts "\nDownloading: #{full_url}"
46
46
  start = lambda do |length, hint=''|
47
- pb = ProgressBar.new("#{file_name}", length);
48
- pb.instance_variable_set "@title_width", file_name.length + 2
49
- pb.format = "\s\s%-s #{hint} %3d%% %s %s"
50
- pb.clear
51
- pb.send :show
47
+ pb = ProgressBar.create(:title => "#{hint}", :format => "%t %E %w");
52
48
  end
53
49
 
54
- progress = lambda {|s| pb.set(s)}
50
+ progress = lambda {|s| pb.progress = s; pb.refresh}
55
51
 
56
52
  if Pathname(to_here).exist?
57
- start.call(0, "(cached)")
53
+ start.call(0, "(cached) ")
58
54
  else
59
55
  begin
60
56
  content = open(full_url, "rb", content_length_proc: start, progress_proc: progress).read
@@ -74,15 +70,12 @@ class Delphivm
74
70
 
75
71
  def unzip(file, destination)
76
72
  Zip::ZipFile.open(file) do |zip_file|
77
- pb = ProgressBar.new("", zip_file.size)
78
- pb.format = "\s\s\s\sextracting: %3d%% %s file: %-34s"
79
- pb.format_arguments = [:percentage, :bar, :title]
73
+ pb = ProgressBar.create(:total => zip_file.size, :format => "extracting %c/%C %B %t")
80
74
  zip_file.each do |f|
81
75
  f_path = destination + f.name
82
76
  next if Pathname(f_path).directory?
83
77
  f_path.dirname.mkpath
84
- pb.instance_variable_set "@title", "#{f_path.basename}"
85
- pb.inc
78
+ pb.title = "#{f_path.basename}"
86
79
  Pathname(f_path).delete if File.exist?(f_path)
87
80
  zip_file.extract(f, f_path)
88
81
  end
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  require 'fiddle'
4
2
  require 'fiddle/import'
5
3
 
@@ -69,8 +67,8 @@ class Delphivm
69
67
 
70
68
  def start
71
69
  set_env
72
- Process.detach(spawn "#{self['App']}", "-r#{prj_slug}")
73
- say "started bds -r#{prj_slug}"
70
+ Process.detach(spawn "#{self['App']}", "-rDelphiVM\\#{prj_slug}")
71
+ say "started bds -rDelphiVM\\#{prj_slug}"
74
72
  end
75
73
 
76
74
  def prj_slug
@@ -82,18 +80,20 @@ class Delphivm
82
80
  ide_number > 140
83
81
  end
84
82
 
85
- def msbuild(config, target)
83
+ def msbuild(target, config)
86
84
  set_env
87
- self.class.winshell(out_filter: ->(line){line =~ /(error)/}) do |i|
88
- Pathname.glob(workdir + "{src,samples}/#{idever}**/*.{#{GROUP_FILE_EXT.join(',')}}") do |f|
85
+ self.class.winshell(out_filter: ->(line){line =~/\b(warning|error)\b/i}) do |i|
86
+ Pathname.glob(workdir + "{src,samples,test}/#{idever}**/*.{#{GROUP_FILE_EXT.join(',')}}") do |f|
89
87
  f_to_show = f.relative_path_from(workdir)
90
- say "#{target} (#{config}) #{f_to_show.win} ...."
91
88
  # paths can contains spaces so we need use quotes
92
89
  if supports_msbuild?(idever)
90
+ msbuild_prms = config.inject([]) {|prms, item| prms << '/p:' + item.join('=')}.join(' ')
91
+ say "[#{idever}] msbuild /t:#{target} #{msbuild_prms} #{f_to_show.win} ...."
93
92
  i.puts %Q["#{self['RootDir'] + 'bin\rsvars.bat'}"]
94
- i.puts %Q[msbuild /nologo /t:#{target} /p:Config=#{config} "#{f.win}"]
93
+ i.puts %Q[msbuild /nologo /consoleloggerparameters:v=quiet /filelogger /flp:v=detailed /t:#{target} #{msbuild_prms} "#{f.win}"]
95
94
  else
96
- i.puts %Q[bds -b "#{f.win}"]
95
+ say "[#{idever}] bds -b #{f_to_show.win} ...."
96
+ i.puts %Q[bds -b "#{f.win}"]
97
97
  end
98
98
  end
99
99
  end
@@ -0,0 +1,25 @@
1
+ require 'thor/runner'
2
+
3
+ class Delphivm
4
+ EXE_NAME = File.basename($0, '.rb')
5
+
6
+ PATH_TO_VENDOR = ROOT + 'vendor'
7
+ PATH_TO_VENDOR_CACHE = PATH_TO_VENDOR + 'cache'
8
+ PATH_TO_VENDOR_IMPORTS = PATH_TO_VENDOR + 'imports'
9
+ DVM_IMPORTS_FILE = PATH_TO_VENDOR + 'imports.dvm'
10
+
11
+ class Runner
12
+ # remove some tasks not needed
13
+ remove_task :install, :installed, :uninstall, :update
14
+
15
+ # default version and banner outputs THOR, so redefine it
16
+ def self.banner(task, all = false, subcommand = false)
17
+ "#{Delphivm::EXE_NAME} " + task.formatted_usage(self, all, subcommand)
18
+ end
19
+
20
+ desc "version", "Show #{Delphivm::EXE_NAME} version"
21
+ def version
22
+ say "#{Delphivm::VERSION}"
23
+ end
24
+ end
25
+ end
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  class Delphivm
3
- VERSION = "0.7.7"
3
+ VERSION = "0.8.0"
4
4
  include(VersionInfo)
5
5
  self.VERSION.file_name = __FILE__
6
6
  end
data/lib/dvm/project.thor CHANGED
@@ -1,12 +1,9 @@
1
- # encoding: UTF-8
2
-
3
-
1
+ 
4
2
  class Project < BuildTarget
5
3
 
6
4
  SHIP_FILE = "#{TARGET}-#{TARGET.VERSION.tag}"
7
5
 
8
6
  desc "clean", "clean #{SHIP_FILE} products", :for => :clean
9
-
10
7
  desc "make", "make #{SHIP_FILE} products", :for => :make
11
8
  desc "build", "build #{SHIP_FILE} products", :for => :build
12
9
 
@@ -14,7 +11,6 @@ class Project < BuildTarget
14
11
  method_option :config, type: :array, aliases: '-c', default: '', desc: "use IDE config(s): Debug, Release, etc"
15
12
  def ship
16
13
  get_idevers.each do |idever|
17
- #ide = IDEServices.new(idever, ROOT)
18
14
  configs = [options[:config]].flatten
19
15
  configs.each do |cfg|
20
16
  build_ship(idever, cfg)
@@ -26,17 +22,17 @@ protected
26
22
 
27
23
  def do_clean(idetag, cfg)
28
24
  ide = IDEServices.new(idetag, ROOT)
29
- ide.msbuild(cfg, 'Clean')
25
+ ide.msbuild('Clean', cfg)
30
26
  end
31
27
 
32
28
  def do_make(idetag, cfg)
33
29
  ide = IDEServices.new(idetag, ROOT)
34
- ide.msbuild(cfg, 'Make')
30
+ ide.msbuild('Make', cfg)
35
31
  end
36
32
 
37
33
  def do_build(idetag, cfg)
38
34
  ide = IDEServices.new(idetag, ROOT)
39
- ide.msbuild(cfg, 'Build')
35
+ ide.msbuild('Build', cfg)
40
36
  end
41
37
 
42
38
  private
@@ -56,7 +52,7 @@ private
56
52
  groups = [
57
53
  ["output", ROOT + 'out' + idever + config, Pathname('.')],
58
54
  ["source", ROOT + 'src', Pathname('src') + SHIP_FILE],
59
- ["sample", ROOT + 'samples', Pathname('samples') + SHIP_FILE],
55
+ ["samples", ROOT + 'samples', Pathname('samples') + SHIP_FILE],
60
56
  ["documentation", ROOT + 'doc', Pathname('doc') + SHIP_FILE]
61
57
  ]
62
58
  puts "Ship file " + zip_fname.to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delphivm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge L. Cangas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-27 00:00:00.000000000 Z
11
+ date: 2013-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,6 +96,7 @@ files:
96
96
  - lib/delphivm.rb
97
97
  - lib/delphivm/dsl.rb
98
98
  - lib/delphivm/ide_services.rb
99
+ - lib/delphivm/runner.rb
99
100
  - lib/delphivm/version.rb
100
101
  - lib/dvm/ide.thor
101
102
  - lib/dvm/project.thor