Skip to content

Commit

Permalink
Add combined build tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Jan 12, 2017
1 parent 10caa23 commit 19bb6cb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ The DLL search paths of Ruby processes are extended as soon as rubygems is used,

- Run cmd.exe and add iscc.exe to PATH: ```set PATH=%PATH%;"c:\Program Files (x86)\Inno Setup 5"```

- Then compile and package Ruby:
- Then compile and package RubyInstallers for x86 and x64:
```sh
rake ruby-2.4.0-x64:installer ruby-2.4.0-x86:installer
rake
```

- If everything works well, you will find the final setup files `installer/rubyinstaller-2.4.0-1-x64.exe` and `installer/rubyinstaller-2.4.0-1-x64.exe`
- If everything works well, you will find the final setup files: `installer/rubyinstaller-<VERSION>-<ARCH>.exe`

##Known Issues

Expand Down
27 changes: 17 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,26 @@ task :devkit do
require "devkit"
end

rubies = Dir["compile/ruby-*"]

ENV['RI_ARCHS'] ||= 'x64:x86'
ENV['RI_ARCHS'].split(":").each do |arch|

rubies.each do |compiledir|
pack = RubyPackage.new( compiledir: compiledir, arch: arch, rootdir: __dir__ ).freeze
ruby_packages = Dir["compile/ruby-*"].map do |compiledir|
ENV['RI_ARCHS'].split(":").map do |arch|
RubyPackage.new( compiledir: compiledir, arch: arch, rootdir: __dir__ ).freeze
end
end.flatten

namespace pack.rake_namespace do
ruby_packages.each do |pack|

compile = CompileTask.new( package: pack )
sandbox = SandboxTask.new( package: pack, compile_task: compile )
InstallerTask.new( package: pack, sandbox_task: sandbox )
end
nsp = "ruby-#{pack.rubyver}-#{pack.arch}"
namespace nsp do
compile = CompileTask.new( package: pack )
sandbox = SandboxTask.new( package: pack, compile_task: compile )
InstallerTask.new( package: pack, sandbox_task: sandbox )
end

desc "Build all for #{nsp}"
task nsp => "#{nsp}:installer"

desc "Build installers for all rubies"
task :default => nsp
end
2 changes: 1 addition & 1 deletion compile/task.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class CompileTask < BaseTask
super
self.pkgfile = File.join(package.compiledir, "#{package.pacman_arch}-ruby-#{package.rubyver_pkgrel}-any.pkg.tar.xz")

desc "Build pacman package for ruby-#{package.rubyver}-#{package.arch}"
desc "pacman package for ruby-#{package.rubyver}-#{package.arch}"
task "compile" => [:devkit, pkgfile]

file pkgfile => [package.pkgbuild] do
Expand Down
2 changes: 1 addition & 1 deletion installer/task.rake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class InstallerTask < BaseTask
file path
end

desc "Build installer for ruby-#{package.rubyver}-#{package.arch}"
desc "installer for ruby-#{package.rubyver}-#{package.arch}"
task "installer" => [:devkit, "sandbox", installer_exe]

file File.join(sandboxdirmgw, "bin/rake.cmd") => File.join(sandboxdirmgw, "bin/rake.bat") do |t|
Expand Down
1 change: 0 additions & 1 deletion lib/ruby_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def initialize(*args)
self.pkgrel = $1 or raise("'pkgrel' not defined in #{pkgbuild}")
self.rubyver_pkgrel = "#{rubyver}-#{pkgrel}"

self.rake_namespace = "ruby-#{rubyver}-#{arch}"
self.rubyver2 = rubyver[/^\d+\.\d+/]

case arch
Expand Down
2 changes: 1 addition & 1 deletion sandbox/task.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SandboxTask < BaseTask
self.sandboxdir_abs = File.expand_path(sandboxdir, package.rootdir)
ruby_exe = "#{sandboxdirmgw}/bin/ruby.exe"

desc "Build sandbox for ruby-#{package.rubyver}"
desc "sandbox for ruby-#{package.rubyver}"
task "sandbox" => [:devkit, "compile", ruby_exe]

file ruby_exe => compile_task.pkgfile do
Expand Down

0 comments on commit 19bb6cb

Please sign in to comment.