Mercurial Hosting > luan
comparison src/luan/modules/mmake.luan @ 1717:c637a2a1023d
add String.replace
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 25 Jul 2022 11:16:53 -0600 |
parents | b82767112d8e |
children |
comparison
equal
deleted
inserted
replaced
1716:b82767112d8e | 1717:c637a2a1023d |
---|---|
3 local Table = require "luan:Table.luan" | 3 local Table = require "luan:Table.luan" |
4 local Io = require "luan:Io.luan" | 4 local Io = require "luan:Io.luan" |
5 local print = Io.print | 5 local print = Io.print |
6 local output_to = Io.output_to | 6 local output_to = Io.output_to |
7 local String = require "luan:String.luan" | 7 local String = require "luan:String.luan" |
8 local regex = String.regex | 8 local replace = String.replace |
9 local substring = String.sub | 9 local substring = String.sub |
10 local ends_with = String.ends_with | 10 local ends_with = String.ends_with |
11 local Time = require "luan:Time.luan" | 11 local Time = require "luan:Time.luan" |
12 local time_now = Time.now | 12 local time_now = Time.now |
13 local time_format = Time.format | 13 local time_format = Time.format |
44 if #javas == 0 and #dirs == 0 then | 44 if #javas == 0 and #dirs == 0 then |
45 return false; | 45 return false; |
46 end | 46 end |
47 local out = dir.child("Makefile").text_writer() | 47 local out = dir.child("Makefile").text_writer() |
48 output_to(out,header) | 48 output_to(out,header) |
49 local r = regex([[\$]]) | |
50 for _, s in ipairs(javas) do | 49 for _, s in ipairs(javas) do |
51 s = r.gsub(s,[[\$\$]]) | 50 s = replace(s,"$","$$") |
52 out.write( "\\\n\t\t", s , ".class" ) | 51 out.write( "\\\n\t\t", s , ".class" ) |
53 end | 52 end |
54 for _, s in ipairs(dirs) do | 53 for _, s in ipairs(dirs) do |
55 out.write( "\n\tcd ", s, "; make all" ) | 54 out.write( "\n\tcd ", s, "; make all" ) |
56 end | 55 end |