diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-07-01 23:06:50 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-07-01 23:06:50 +0200 |
| commit | 146f164b219cb1d592b48eff1078c3861087ace6 (patch) | |
| tree | d10d8f810761e2d4b26d449b58371c207e4fd3ef /Rakefile | |
| parent | 44143ee21da8725df24ddf59ed91d7b47b7092c2 (diff) | |
| download | elna-146f164b219cb1d592b48eff1078c3861087ace6.tar.gz | |
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 38 |
1 files changed, 32 insertions, 6 deletions
@@ -19,7 +19,10 @@ end directory 'build' -task default: :boot +task :default do + Rake::Task["build/valid/#{STAGES.last}/cl"].invoke + Rake::Task["boot"].invoke +end desc 'Final stage' task boot: "build/valid/#{STAGES.last}/cl" @@ -34,11 +37,34 @@ task boot: "boot/#{STAGES.last}/cl.elna" do |t| Open3.pipeline(cat_arguments, run(exe), diff_arguments) end -desc 'Convert previous stage language into the current stage language' -task :convert do - File.open('boot/stage25/cl.elna', 'w') do |current_stage| - File.readlines('boot/stage24/cl.elna').each do |line| - current_stage << line +namespace :stage do + stage_number = STAGES.last.delete_prefix('stage').to_i + + desc 'Create a new stabe by duplicating the last one' + task :new do + new_stage = "stage#{stage_number.succ}" + cp_r "boot/stage#{stage_number}", "boot/#{new_stage}" + STAGES << new_stage + Rake::Task['ninja'].invoke + end + + desc 'Delete the last stage' + task :drop do + rm_r "boot/stage#{stage_number}" + STAGES.pop + Rake::Task['ninja'].invoke + end + + desc 'Convert previous stage language into the current stage language' + task :convert do + from = "boot/stage#{stage_number.pred}/cl.elna" + to = "boot/stage#{stage_number}/cl.elna" + puts "Converting #{from} to #{to}." + + File.open(to, 'w') do |current_stage| + File.readlines(from).each do |line| + current_stage << line + end end end end |
