openMSX-builder 1.6.5 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,8 @@ Currently `build_openmsx` supports the following command-line arguments:
34
34
  * --dont-update => Don't update the SVN repository
35
35
  * --report-build-failure => If an error occurs during build, report failure via e-mail
36
36
  * --version => Return the current VERSION of openMSX-Builder
37
+ * --profiles => Print a list of (hardcoded) profiles to build
38
+ * --profiles name1,name2 => Build just builds with profile name 'name1' and 'name2'
37
39
 
38
40
  By default only fatal errors will be output via STDOUT.
39
41
  However, the following command-line arguments are available to set the verbosity:
@@ -69,6 +71,7 @@ Current list of tasks is:
69
71
  + See if VERSION can be integrated into OpenmsxBuilder instead of just being parsed in the executable.
70
72
  + Make sure all shell commands are output as Debug level logs.
71
73
  + Integrate CBIOS builds.
74
+ + Use the profile names from the YAML config for --profiles instead of hardcoded defaults
72
75
 
73
76
  ## Notes on Patches/Pull Requests
74
77
  ******************************************************************************
@@ -85,7 +88,7 @@ Current list of tasks is:
85
88
 
86
89
  ## Copyright
87
90
  ******************************************************************************
88
- Copyright (c) 2010 Filip H.F. "FiXato" Slagter. See LICENSE for details.
91
+ Copyright (c) 2010-2012 Filip H.F. "FiXato" Slagter. See LICENSE for details.
89
92
 
90
93
 
91
94
  ******************************************************************************
data/Rakefile CHANGED
@@ -18,19 +18,19 @@ begin
18
18
  rescue LoadError
19
19
  puts "Jeweler not available. Install it with: gem install jeweler"
20
20
  end
21
+ if false
22
+ require 'spec/rake/spectask'
23
+ Spec::Rake::SpecTask.new(:spec) do |spec|
24
+ spec.libs << 'lib' << 'spec'
25
+ spec.spec_files = FileList['spec/**/*_spec.rb']
26
+ end
21
27
 
22
- require 'spec/rake/spectask'
23
- Spec::Rake::SpecTask.new(:spec) do |spec|
24
- spec.libs << 'lib' << 'spec'
25
- spec.spec_files = FileList['spec/**/*_spec.rb']
26
- end
27
-
28
- Spec::Rake::SpecTask.new(:rcov) do |spec|
29
- spec.libs << 'lib' << 'spec'
30
- spec.pattern = 'spec/**/*_spec.rb'
31
- spec.rcov = true
28
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
29
+ spec.libs << 'lib' << 'spec'
30
+ spec.pattern = 'spec/**/*_spec.rb'
31
+ spec.rcov = true
32
+ end
32
33
  end
33
-
34
34
  task :spec => :check_dependencies
35
35
 
36
36
  task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.5
1
+ 1.7.0
@@ -14,8 +14,22 @@ log.level = Logger::WARN if ARGV.include?('--warn')
14
14
  log.level = Logger::INFO if ARGV.include?('--verbose')
15
15
  log.level = Logger::DEBUG if ARGV.include?('--debug')
16
16
  log.info('-'*50)
17
- log.info("Starting with openMSX")
18
- OpenmsxBuilder.new(ARGV,:openmsx).run
19
- log.info('-'*50)
20
- log.info("Proceeding with openMSX-Debugger")
21
- OpenmsxBuilder.new(ARGV,:openmsx_debugger).run
17
+
18
+ profiles = [:openmsx_x86_64, :openmsx_x86, :openmsx_ppc, :openmsx_univ, :openmsx_debugger, :openmsx_debugger_x86_64]
19
+ if profile_index = ARGV.index('--profiles')
20
+ unless ARGV[profile_index + 1]
21
+ log.info("The following profiles are available: #{profiles.map{|profile|profile.to_s}.join(', ')}")
22
+ exit
23
+ end
24
+ profiles = ARGV[profile_index + 1].split(',').map{|profile| profile.to_sym}
25
+ end
26
+ log.info("Will build the following profiles: #{profiles.join(', ')}")
27
+ profiles.each_with_index do |profile, index|
28
+ log.info("Starting with #{profile}")
29
+ OpenmsxBuilder.new(ARGV,profile).run
30
+ log.info('-'*50)
31
+
32
+ #Prevent further SVN updates so we continue building the same revision during this round
33
+ ARGV << '--dont-update' if index == 0
34
+ end
35
+ log.info("Build process finished")
@@ -8,12 +8,12 @@ class OpenmsxBuilder
8
8
  CONFIG_FILENAME = File.expand_path('~/.openMSX-builder.yaml')
9
9
  DEFAULTS = {
10
10
  :projects => {
11
- :openmsx => {
11
+ :openmsx_univ => {
12
12
  :source_dir => File.expand_path("~/Development/openMSX"),
13
13
  :builds_subdir => 'derived/univ-darwin-opt-3rd',
14
14
  :report_bcc => [],
15
15
  :report_from => "openMSX auto-builder by FiXato <username@mailhost.example>",
16
- :nice_name => 'openMSX (universal)',
16
+ :nice_name => 'openMSX Universal Mac OS X (ppc/i386/x86_64)',
17
17
  :publish_location => 'ssh_host:path/to/existing/publish/dir',
18
18
  :site_path => 'http://your.host.example/publish/dir',
19
19
  :target_cpu => 'univ',
@@ -23,17 +23,27 @@ class OpenmsxBuilder
23
23
  :builds_subdir => 'derived/x86-darwin-opt-3rd',
24
24
  :report_bcc => [],
25
25
  :report_from => "openMSX auto-builder by FiXato <username@mailhost.example>",
26
- :nice_name => 'openMSX (x86)',
26
+ :nice_name => 'openMSX for 32-bit Mac OS X',
27
27
  :publish_location => 'ssh_host:path/to/existing/publish/dir',
28
28
  :site_path => 'http://your.host.example/publish/dir',
29
29
  :target_cpu => 'x86',
30
30
  },
31
+ :openmsx_x86_64 => {
32
+ :source_dir => File.expand_path("~/Development/openMSX"),
33
+ :builds_subdir => 'derived/x86_64-darwin-opt-3rd',
34
+ :report_bcc => [],
35
+ :report_from => "openMSX auto-builder by FiXato <username@mailhost.example>",
36
+ :nice_name => 'openMSX for 64-bit Mac OS X',
37
+ :publish_location => 'ssh_host:path/to/existing/publish/dir',
38
+ :site_path => 'http://your.host.example/publish/dir',
39
+ :target_cpu => 'x86_64',
40
+ },
31
41
  :openmsx_ppc => {
32
42
  :source_dir => File.expand_path("~/Development/openMSX"),
33
- :builds_subdir => 'derived/ppc-darwin-opt-3rd',
43
+ :builds_subdir => 'derived/ppc-darwin-ppc-3rd',
34
44
  :report_bcc => [],
35
45
  :report_from => "openMSX auto-builder by FiXato <username@mailhost.example>",
36
- :nice_name => 'openMSX (ppc)',
46
+ :nice_name => 'openMSX for PowerPC Mac OS',
37
47
  :publish_location => 'ssh_host:path/to/existing/publish/dir',
38
48
  :site_path => 'http://your.host.example/publish/dir',
39
49
  :target_cpu => 'ppc',
@@ -43,9 +53,30 @@ class OpenmsxBuilder
43
53
  :builds_subdir => 'derived',
44
54
  :report_bcc => [],
45
55
  :report_from => "openMSX auto-builder by FiXato <username@mailhost.example>",
46
- :nice_name => 'openMSX Debugger',
56
+ :nice_name => 'openMSX Debugger, 32-Bit Mac OS X',
47
57
  :publish_location => 'ssh_host:path/to/existing/publish/dir',
48
58
  :site_path => 'http://your.host.example/publish/dir',
59
+ :target_cpu => 'x86',
60
+ },
61
+ :openmsx_debugger_x86 => {
62
+ :source_dir => File.expand_path("~/Development/openmsx-debugger"),
63
+ :builds_subdir => 'derived',
64
+ :report_bcc => [],
65
+ :report_from => "openMSX auto-builder by FiXato <username@mailhost.example>",
66
+ :nice_name => 'openMSX Debugger, 32-Bit Mac OS X',
67
+ :publish_location => 'ssh_host:path/to/existing/publish/dir',
68
+ :site_path => 'http://your.host.example/publish/dir',
69
+ :target_cpu => 'x86',
70
+ },
71
+ :openmsx_debugger_x86_64 => {
72
+ :source_dir => File.expand_path("~/Development/openmsx-debugger"),
73
+ :builds_subdir => 'derived',
74
+ :report_bcc => [],
75
+ :report_from => "openMSX auto-builder by FiXato <username@mailhost.example>",
76
+ :nice_name => 'openMSX Debugger, 64-Bit Mac OS X',
77
+ :publish_location => 'ssh_host:path/to/existing/publish/dir',
78
+ :site_path => 'http://your.host.example/publish/dir',
79
+ :target_cpu => 'x86_64',
49
80
  },
50
81
  },
51
82
  :smtp_settings => {
@@ -60,7 +91,7 @@ class OpenmsxBuilder
60
91
  }
61
92
 
62
93
  attr_accessor :type,:build_outputs
63
- def initialize(options,type=:openmsx)
94
+ def initialize(options,type=:openmsx_univ)
64
95
  @options = options
65
96
  @type = type
66
97
  @log = Logger.new(STDOUT)
@@ -96,9 +127,9 @@ class OpenmsxBuilder
96
127
  def publish_all
97
128
  @log.info "Publishing all #{@type} builds found"
98
129
  if openmsx?
99
- regexp = /openmsx-.+-(\d+)-mac-univ-bin.dmg$/
130
+ regexp = /openmsx-.+-(\d+)-mac-#{setting(:target_cpu)}-bin.dmg$/
100
131
  elsif openmsx_debugger?
101
- regexp = /openMSX-debugger-(\d+)-mac-x86.tbz$/
132
+ regexp = /openMSX-debugger-(\d+)-mac-#{setting(:target_cpu)}.tbz$/
102
133
  end
103
134
  Dir.glob(filemask_for_revision('*')).sort.each do |file|
104
135
  publish_revision($1,file) if file =~ regexp
@@ -114,6 +145,10 @@ class OpenmsxBuilder
114
145
  archive_name = filemask_for_revision(revision)
115
146
  archive(File.join(setting(:source_dir),setting(:builds_subdir),'openMSX_Debugger.app'),File.basename(archive_name))
116
147
  end
148
+ if archive_name.nil?
149
+ @log.error "No archive could be found for revision #{revision} in '#{File.join(setting(:source_dir),setting(:builds_subdir))}' for target_cpu #{setting(:target_cpu)}"
150
+ return nil
151
+ end
117
152
  end
118
153
 
119
154
  destination = File.join(setting(:publish_location),File.basename(archive_name))
@@ -122,7 +157,7 @@ class OpenmsxBuilder
122
157
 
123
158
  return nil unless @options.include?('--tweet')
124
159
  url = File.join(setting(:site_path),File.basename(archive_name))
125
- message = "[#{setting(:nice_name)}] Revision #{revision} is now available:\r\n #{url}"
160
+ message = "[#{setting(:nice_name)}] Revision #{revision} added: \r\n#{url}"
126
161
  tweetmsx.update(message)
127
162
  rescue TweetMsx::NotConfigured => e
128
163
  @log.error e.message
@@ -188,10 +223,13 @@ private
188
223
  if openmsx?
189
224
  build_args+=" staticbindist"
190
225
  build_args+=" OPENMSX_TARGET_CPU=#{setting(:target_cpu)}" if setting(:target_cpu)
226
+ build_args+=" CPU_LIST=\"x86 x86_64 ppc\"" if setting(:target_cpu) == 'univ'
191
227
  elsif openmsx_debugger?
192
- build_args+=" CHANGELOG_REVISION=#{@new_revision}"
228
+ build_args+=" CHANGELOG_REVISION=#{@new_revision} OPENMSX_TARGET_CPU=#{setting(:target_cpu)} CXX=\"g++ -arch #{setting(:target_cpu) == 'x86' ? 'i386' : setting(:target_cpu)}\""
193
229
  end
194
- @build_outputs << `cd #{setting(:source_dir)} && make clean && make#{"#{build_args}"} 2>&1`
230
+ cmd = "cd #{setting(:source_dir)} && make clean && make#{"#{build_args}"} 2>&1"
231
+ puts cmd
232
+ @build_outputs << `#{cmd}`
195
233
  if $?.success?
196
234
  handle_build_success
197
235
  return nil
@@ -206,7 +244,7 @@ private
206
244
 
207
245
  def cleanup_dmg_locks
208
246
  @log.info("Checking for existing filelocks on DMGs.")
209
- locks = `/usr/sbin/lsof | grep #{@new_revision}-mac-univ-bin.dmg`
247
+ locks = `/usr/sbin/lsof | grep #{@new_revision}-mac-#{setting(:target_cpu)}-bin.dmg`
210
248
  @log.debug locks
211
249
  locks.each_line do |lock_line|
212
250
  pid = lock_line.split[1].to_i
@@ -218,9 +256,9 @@ private
218
256
 
219
257
  def filemask_for_revision(revision)
220
258
  if openmsx?
221
- File.join(setting(:source_dir),setting(:builds_subdir),"openmsx-*-#{revision}-mac-univ-bin.dmg")
259
+ File.join(setting(:source_dir),setting(:builds_subdir),"openmsx-*-#{revision}-mac-#{setting(:target_cpu)}-bin.dmg")
222
260
  elsif openmsx_debugger?
223
- File.join(setting(:source_dir),setting(:builds_subdir),"openMSX-debugger-#{revision}-mac-x86.tbz")
261
+ File.join(setting(:source_dir),setting(:builds_subdir),"openMSX-debugger-#{revision}-mac-#{setting(:target_cpu)}.tbz")
224
262
  end
225
263
  end
226
264
 
@@ -240,7 +278,7 @@ private
240
278
 
241
279
  #Capture the weird random build error that seems to be more OSX related than openMSX related.
242
280
  def handle_build_hdiutil_error?
243
- return false unless build_output.include?('hdiutil: create failed - error 49168')
281
+ return false unless build_output.include?('hdiutil: create failed - error 49168') || build_output.include?('hdiutil: create failed - Resource busy')
244
282
  @fails += 1
245
283
  @log.error build_output
246
284
  @log.error "Weird bug (attempt #{@fails}/3)"
@@ -261,11 +299,11 @@ private
261
299
  end
262
300
 
263
301
  def openmsx?
264
- @type == :openmsx
302
+ @type == :openmsx || @type == :openmsx_univ || @type == :openmsx_x86 || @type == :openmsx_x86_64 || @type == :openmsx_ppc
265
303
  end
266
304
 
267
305
  def openmsx_debugger?
268
- @type == :openmsx_debugger
306
+ @type.to_s.include?('openmsx_debugger')
269
307
  end
270
308
 
271
309
  def report_build_failure
@@ -1,16 +1,16 @@
1
1
  require 'logger'
2
2
  require 'twitter_oauth'
3
3
  require 'yaml'
4
- # Patch for Ruby 1.9.2
5
- module Net
6
- module HTTPHeader
7
- alias_method :url_encode_original, :urlencode
8
- def urlencode(str)
9
- str = str.to_s if str.kind_of?(Symbol)
10
- url_encode_original(str)
11
- end
12
- end
13
- end
4
+ # # Patch for Ruby 1.9.2
5
+ # module Net
6
+ # module HTTPHeader
7
+ # alias_method :url_encode_original, :urlencode
8
+ # def urlencode(str)
9
+ # str = str.to_s if str.kind_of?(Symbol)
10
+ # url_encode_original(str)
11
+ # end
12
+ # end
13
+ # end
14
14
  class TweetMsx
15
15
  class NotConfigured < RuntimeError;end
16
16
  CONFIG_FILENAME = File.expand_path('~/.openMSX-builder-TweetMSX.yaml')
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{openMSX-builder}
8
- s.version = "1.6.5"
8
+ s.version = "1.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Filip H.F. \"FiXato\" Slagter"]
12
- s.date = %q{2010-04-02}
12
+ s.date = %q{2012-06-13}
13
13
  s.default_executable = %q{build_openmsx}
14
14
  s.description = %q{openMSX-Builder is used for building the latest SVN checkouts of openMSX and openMSX-Debugger from their sourceforge repository.
15
15
  It also supports publishing the created builds to an external location via scp, announcing successfully published builds via Twitter and reporting build-errors via e-mail.}
@@ -17,37 +17,30 @@ Gem::Specification.new do |s|
17
17
  s.executables = ["build_openmsx"]
18
18
  s.extra_rdoc_files = [
19
19
  "LICENSE",
20
- "README.markdown"
20
+ "README.markdown"
21
21
  ]
22
22
  s.files = [
23
- ".gitignore",
24
- "LICENSE",
25
- "README.markdown",
26
- "Rakefile",
27
- "VERSION",
28
- "bin/build_openmsx",
29
- "lib/openmsx_builder.rb",
30
- "lib/tweet_msx.rb",
31
- "openMSX-builder.gemspec",
32
- "spec/openMSX-builder_spec.rb",
33
- "spec/spec.opts",
34
- "spec/spec_helper.rb"
23
+ "LICENSE",
24
+ "README.markdown",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "bin/build_openmsx",
28
+ "lib/openmsx_builder.rb",
29
+ "lib/tweet_msx.rb",
30
+ "openMSX-builder.gemspec",
31
+ "spec/openMSX-builder_spec.rb",
32
+ "spec/spec.opts",
33
+ "spec/spec_helper.rb"
35
34
  ]
36
35
  s.homepage = %q{http://github.com/FiXato/openMSX-builder}
37
- s.rdoc_options = ["--charset=UTF-8"]
38
36
  s.require_paths = ["lib"]
39
- s.rubygems_version = %q{1.3.6}
37
+ s.rubygems_version = %q{1.6.1}
40
38
  s.summary = %q{Builds the latest openMSX and openMSX-Debugger for Mac OSX from SVN and publishes it via scp while tweeting about the new release.}
41
- s.test_files = [
42
- "spec/openMSX-builder_spec.rb",
43
- "spec/spec_helper.rb"
44
- ]
45
39
 
46
40
  if s.respond_to? :specification_version then
47
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
48
41
  s.specification_version = 3
49
42
 
50
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
43
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
44
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
52
45
  s.add_runtime_dependency(%q<twitter_oauth>, [">= 0.3.3"])
53
46
  s.add_runtime_dependency(%q<mail>, [">= 2.1.3"])
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openMSX-builder
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 6
8
- - 5
9
- version: 1.6.5
4
+ prerelease:
5
+ version: 1.7.0
10
6
  platform: ruby
11
7
  authors:
12
8
  - Filip H.F. "FiXato" Slagter
@@ -14,20 +10,17 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-04-02 00:00:00 +02:00
13
+ date: 2012-06-13 00:00:00 +02:00
18
14
  default_executable: build_openmsx
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
21
17
  name: rspec
22
18
  prerelease: false
23
19
  requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
24
21
  requirements:
25
22
  - - ">="
26
23
  - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 2
30
- - 9
31
24
  version: 1.2.9
32
25
  type: :development
33
26
  version_requirements: *id001
@@ -35,13 +28,10 @@ dependencies:
35
28
  name: twitter_oauth
36
29
  prerelease: false
37
30
  requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
38
32
  requirements:
39
33
  - - ">="
40
34
  - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- - 3
44
- - 3
45
35
  version: 0.3.3
46
36
  type: :runtime
47
37
  version_requirements: *id002
@@ -49,13 +39,10 @@ dependencies:
49
39
  name: mail
50
40
  prerelease: false
51
41
  requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
52
43
  requirements:
53
44
  - - ">="
54
45
  - !ruby/object:Gem::Version
55
- segments:
56
- - 2
57
- - 1
58
- - 3
59
46
  version: 2.1.3
60
47
  type: :runtime
61
48
  version_requirements: *id003
@@ -71,7 +58,6 @@ extra_rdoc_files:
71
58
  - LICENSE
72
59
  - README.markdown
73
60
  files:
74
- - .gitignore
75
61
  - LICENSE
76
62
  - README.markdown
77
63
  - Rakefile
@@ -88,31 +74,28 @@ homepage: http://github.com/FiXato/openMSX-builder
88
74
  licenses: []
89
75
 
90
76
  post_install_message:
91
- rdoc_options:
92
- - --charset=UTF-8
77
+ rdoc_options: []
78
+
93
79
  require_paths:
94
80
  - lib
95
81
  required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
96
83
  requirements:
97
84
  - - ">="
98
85
  - !ruby/object:Gem::Version
99
- segments:
100
- - 0
101
86
  version: "0"
102
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
103
89
  requirements:
104
90
  - - ">="
105
91
  - !ruby/object:Gem::Version
106
- segments:
107
- - 0
108
92
  version: "0"
109
93
  requirements: []
110
94
 
111
95
  rubyforge_project:
112
- rubygems_version: 1.3.6
96
+ rubygems_version: 1.6.1
113
97
  signing_key:
114
98
  specification_version: 3
115
99
  summary: Builds the latest openMSX and openMSX-Debugger for Mac OSX from SVN and publishes it via scp while tweeting about the new release.
116
- test_files:
117
- - spec/openMSX-builder_spec.rb
118
- - spec/spec_helper.rb
100
+ test_files: []
101
+
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- pkg/