spacevim/bundle/vim-haxe/autoload/vaxe/flow.vim
JIe 2bb7059579
Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
init
2024-08-21 14:17:26 +08:00

110 lines
3.5 KiB
VimL

function! vaxe#flow#Targets(...)
return s:flow_targets
endfunction
function! vaxe#flow#ProjectFlow(...)
if exists('g:vaxe_flow')
unlet g:vaxe_flow
endif
let g:vaxe_working_directory = getcwd()
if a:0 > 0 && a:1 != ''
let g:vaxe_flow = expand(a:1,':p')
else
let flows = split(glob("**/*.flow"),'\n')
if len(flows) == 0
echoerr "No flow/openfl project files found in current working directory"
return
endif
let base_flow = vaxe#util#InputList("Select flow", flows)
if base_flow !~ "^\([a-zA-Z]:\)\=[/\\]"
let base_flow = getcwd() . '/' . base_flow
endif
echomsg 'Project flow selected: ' . base_flow
let g:vaxe_flow = base_flow
endif
if !filereadable(g:vaxe_flow)
echoerr "Project flow file not valid, please create one."
return
endif
call vaxe#flow#BuildFlowHxml(g:vaxe_flow)
call vaxe#SetCompiler()
return g:vaxe_flow
endfunction
function! vaxe#flow#Clean(...)
if (a:0 && a:1 != '')
let target = split(a:1)[0]
else
let target = g:vaxe_flow_target
endif
let command = "flow clean ".target
call vaxe#Log(command)
call s:Sys(command)
endfunction
function! vaxe#flow#RebuildHxml()
if exists("b:vaxe_flow")
call vaxe#flow#BuildFlowHxml(b:vaxe_flow)
endif
endfunction
"A simple system function that first changes directory to the current vaxe
"working directory
function! s:Sys(cmd)
call system("cd ".g:vaxe_working_directory." && ".a:cmd)
endfunction
function! vaxe#flow#BuildFlowHxml(flow)
let base_hxml = a:flow.".hxml"
if !strlen(g:vaxe_flow_target)
call vaxe#flow#Target(a:flow)
endif
let g:vaxe_working_directory = fnamemodify(a:flow, ":p:h")
let cdcmd = 'cd "'.fnameescape(g:vaxe_working_directory).'" && '
"create the flow.hxml if not present
if !filereadable(base_hxml)
" pipe flow display to an hxml for completions
let escape_base = fnameescape(base_hxml)
call s:Sys(" echo '# THIS FILE IS AUTOGENERATED BY VAXE, ANY EDITS ARE DISCARDED' " . " > " . escape_base)
call s:Sys(" haxelib run flow info " . g:vaxe_flow_target . " --hxml "
\. " >> " . escape_base )
endif
let b:vaxe_hxml = base_hxml
" let g:vaxe_hxml = b:vaxe_hxml " don't set a global projet var by default
endfunction
"Sets the target. If target is missing it asks the user. Also updates the
"makeprg compiler command
function! vaxe#flow#Target(flow, ...)
let g:vaxe_flow_target = ''
if a:0 > 1 && a:2 != ''
let g:vaxe_flow_target = a:2
else
let g:vaxe_flow_target = vaxe#util#InputList("Select flow Target", s:flow_targets)
let g:vaxe_flow_target = split(g:vaxe_flow_target, ":")[0]
endif
call vaxe#flow#BuildFlowHxml(a:flow)
call vaxe#SetCompiler()
endfunction
" A list of all the flow targets
let s:flow_targets = [ "android : Create Google Android applications"
\, "web : Create HTML5 webgl applications"
\, "ios : Create Apple iOS applications"
\, "linux --arch 32 : Create Linux 32-bit applications"
\, "linux --arch 64 : Create Linux 64-bit applications"
\, "mac --arch 32 : Create Apple Mac OS X 32-bit applications"
\, "mac --arch 64 : Create Apple Mac OS X 64-bit applications"
\, "windows --arch 32 : Create Microsoft Windows 32-bit applications"
\, "windows --arch 64 : Create Microsoft Windows 64-bit applications"]