mirror of
https://github.com/natnat-mc/moonbuild
synced 2026-05-24 14:09:40 +02:00
added @in (but not working due to moonscript bug) and @out
This commit is contained in:
+6
-6
@@ -24,13 +24,13 @@ with public target 'install'
|
|||||||
with public target 'install-bin'
|
with public target 'install-bin'
|
||||||
\depends BIN
|
\depends BIN
|
||||||
\produces _.patsubst BIN, 'out/%', '/usr/local/bin/%'
|
\produces _.patsubst BIN, 'out/%', '/usr/local/bin/%'
|
||||||
\fn => _.cmd 'sudo', 'cp', @infile, @outfile
|
\fn => _.cmd 'sudo', 'cp', @infile, @out
|
||||||
\sync!
|
\sync!
|
||||||
|
|
||||||
with public target 'install-lib'
|
with public target 'install-lib'
|
||||||
\depends LIB
|
\depends LIB
|
||||||
\produces "/usr/local/share/lua/#{LUA\gsub 'lua', ''}/moonbuild.lua"
|
\produces "/usr/local/share/lua/#{LUA\gsub 'lua', ''}/moonbuild.lua"
|
||||||
\fn => _.cmd 'sudo', 'cp', @infile, @outfile
|
\fn => _.cmd 'sudo', 'cp', @infile, @out
|
||||||
\sync!
|
\sync!
|
||||||
|
|
||||||
with public target 'clean'
|
with public target 'clean'
|
||||||
@@ -52,16 +52,16 @@ with target BIN, pattern: 'out/%'
|
|||||||
\produces 'out/%'
|
\produces 'out/%'
|
||||||
\mkdirs!
|
\mkdirs!
|
||||||
\fn =>
|
\fn =>
|
||||||
_.writefile @outfile, "#!/usr/bin/env #{LUA}\n#{_.readfile @infile}"
|
_.writefile @out, "#!/usr/bin/env #{LUA}\n#{_.readfile @infile}"
|
||||||
_.cmd 'chmod', '+x', @outfile
|
_.cmd 'chmod', '+x', @out
|
||||||
|
|
||||||
with target LIB
|
with target LIB
|
||||||
\depends 'moonbuild/init.lua'
|
\depends 'moonbuild/init.lua'
|
||||||
\depends LIB_LUA
|
\depends LIB_LUA
|
||||||
\produces '%'
|
\produces '%'
|
||||||
\fn => _.cmd AMALG, '-o', @outfile, '-s', @infile, _.exclude MODULES, 'moonbuild.init'
|
\fn => _.cmd AMALG, '-o', @out, '-s', @infile, _.exclude MODULES, 'moonbuild.init'
|
||||||
|
|
||||||
with target {LIB_LUA, BIN_LUA}, pattern: '%.lua'
|
with target {LIB_LUA, BIN_LUA}, pattern: '%.lua'
|
||||||
\depends '%.moon'
|
\depends '%.moon'
|
||||||
\produces '%.lua'
|
\produces '%.lua'
|
||||||
\fn => _.moonc @infile, @outfile
|
\fn => _.moonc @infile, @out
|
||||||
|
|||||||
@@ -108,12 +108,12 @@ class DepNode
|
|||||||
ctx = setmetatable {},
|
ctx = setmetatable {},
|
||||||
__index: (_, k) ->
|
__index: (_, k) ->
|
||||||
switch k
|
switch k
|
||||||
when 'infile'
|
when 'infile', 'in'
|
||||||
f = first deps
|
f = first deps
|
||||||
f and f.name
|
f and f.name
|
||||||
when 'infiles'
|
when 'infiles'
|
||||||
foreach deps, => @name
|
foreach deps, => @name
|
||||||
when 'outfile'
|
when 'outfile', 'out'
|
||||||
f = first @outs
|
f = first @outs
|
||||||
f and f.name
|
f and f.name
|
||||||
when 'outfiles'
|
when 'outfiles'
|
||||||
@@ -182,9 +182,9 @@ class DepNode
|
|||||||
ctx = setmetatable {},
|
ctx = setmetatable {},
|
||||||
__index: (_, k) ->
|
__index: (_, k) ->
|
||||||
switch k
|
switch k
|
||||||
when 'infile' then @ins[1]
|
when 'infile', 'in' then @ins[1]
|
||||||
when 'infiles' then @ins
|
when 'infiles' then @ins
|
||||||
when 'outfile' then @outs[1]
|
when 'outfile', 'out' then @outs[1]
|
||||||
when 'outfiles' then @outs
|
when 'outfiles' then @outs
|
||||||
when 'name' then @name
|
when 'name' then @name
|
||||||
else error "No such field in TargetContext: #{k}"
|
else error "No such field in TargetContext: #{k}"
|
||||||
|
|||||||
+4
-4
@@ -1952,11 +1952,11 @@ do
|
|||||||
local ctx = setmetatable({ }, {
|
local ctx = setmetatable({ }, {
|
||||||
__index = function(_, k)
|
__index = function(_, k)
|
||||||
local _exp_0 = k
|
local _exp_0 = k
|
||||||
if 'infile' == _exp_0 then
|
if 'infile' == _exp_0 or 'in' == _exp_0 then
|
||||||
return self.ins[1]
|
return self.ins[1]
|
||||||
elseif 'infiles' == _exp_0 then
|
elseif 'infiles' == _exp_0 then
|
||||||
return self.ins
|
return self.ins
|
||||||
elseif 'outfile' == _exp_0 then
|
elseif 'outfile' == _exp_0 or 'out' == _exp_0 then
|
||||||
return self.outs[1]
|
return self.outs[1]
|
||||||
elseif 'outfiles' == _exp_0 then
|
elseif 'outfiles' == _exp_0 then
|
||||||
return self.outs
|
return self.outs
|
||||||
@@ -2010,14 +2010,14 @@ do
|
|||||||
local ctx = setmetatable({ }, {
|
local ctx = setmetatable({ }, {
|
||||||
__index = function(_, k)
|
__index = function(_, k)
|
||||||
local _exp_0 = k
|
local _exp_0 = k
|
||||||
if 'infile' == _exp_0 then
|
if 'infile' == _exp_0 or 'in' == _exp_0 then
|
||||||
local f = first(deps)
|
local f = first(deps)
|
||||||
return f and f.name
|
return f and f.name
|
||||||
elseif 'infiles' == _exp_0 then
|
elseif 'infiles' == _exp_0 then
|
||||||
return foreach(deps, function(self)
|
return foreach(deps, function(self)
|
||||||
return self.name
|
return self.name
|
||||||
end)
|
end)
|
||||||
elseif 'outfile' == _exp_0 then
|
elseif 'outfile' == _exp_0 or 'out' == _exp_0 then
|
||||||
local f = first(self.outs)
|
local f = first(self.outs)
|
||||||
return f and f.name
|
return f and f.name
|
||||||
elseif 'outfiles' == _exp_0 then
|
elseif 'outfiles' == _exp_0 then
|
||||||
|
|||||||
Reference in New Issue
Block a user