Also check for first.jai files when building
This commit is contained in:
parent
e759f8c3cd
commit
90c312e954
22
.vimrc
22
.vimrc
|
@ -1213,6 +1213,7 @@ fu! Build(optimized=0, silent=0)
|
||||||
|
|
||||||
let l:is_jai = 0
|
let l:is_jai = 0
|
||||||
let l:has_jai_build_file = 0
|
let l:has_jai_build_file = 0
|
||||||
|
let l:has_jai_first_file = 1
|
||||||
|
|
||||||
let l:ext = tolower(expand('%:e'))
|
let l:ext = tolower(expand('%:e'))
|
||||||
let l:current_dir = expand('%:p:h')
|
let l:current_dir = expand('%:p:h')
|
||||||
|
@ -1225,16 +1226,24 @@ fu! Build(optimized=0, silent=0)
|
||||||
|
|
||||||
" Check for a build file in the current directory or one directory back
|
" Check for a build file in the current directory or one directory back
|
||||||
" (e.g. we're in modules/ or src/, code/, etc)
|
" (e.g. we're in modules/ or src/, code/, etc)
|
||||||
if filereadable(l:current_dir . "/build.jai") || filereadable(l:one_dir_back . "/build.jai")
|
if filereadable(l:current_dir . "/build.jai") || filereadable(l:one_dir_back . "/build.jai") || filereadable(l:current_dir . "/first.jai") || filereadable(l:one_dir_back . "/first.jai")
|
||||||
let l:has_jai_build_file = 1
|
let l:has_jai_build_file = 1
|
||||||
|
|
||||||
if filereadable(l:current_dir . "/build.jai") == 1
|
if filereadable(l:current_dir . "/build.jai") == 1
|
||||||
let l:cmd = "jai ". l:current_dir . "/build.jai"
|
let l:cmd = "jai ". l:current_dir . "/build.jai"
|
||||||
|
elseif filereadable(l:current_dir . "/first.jai") == 1
|
||||||
|
let l:cmd = "jai ". l:current_dir . "/first.jai"
|
||||||
|
let l:has_jai_first_file = 1
|
||||||
else
|
else
|
||||||
" It's one directory back. We don't want to include '../' in
|
" It's one directory back. We don't want to include '../' in
|
||||||
" the cmd because then our reported paths in the program get
|
" the cmd because then our reported paths in the program get
|
||||||
" botched, e.g. path shown in an assert error.
|
" botched, e.g. path shown in an assert error.
|
||||||
let l:cmd = "jai " . l:one_dir_back . "/build.jai"
|
if filereadable(l:one_dir_back . "/build.jai") == 1
|
||||||
|
let l:cmd = "jai " . l:one_dir_back . "/build.jai"
|
||||||
|
else
|
||||||
|
let l:cmd = "jai " . l:one_dir_back . "/first.jai"
|
||||||
|
let l:has_jai_first_file = 1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let l:cmd = "jai % "
|
let l:cmd = "jai % "
|
||||||
|
@ -1251,8 +1260,13 @@ fu! Build(optimized=0, silent=0)
|
||||||
let l:set_metaprogram_args = 0
|
let l:set_metaprogram_args = 0
|
||||||
|
|
||||||
if l:has_jai_build_file
|
if l:has_jai_build_file
|
||||||
|
let l:filename = "build.jai"
|
||||||
|
if l:has_jai_first_file
|
||||||
|
let l:filename = "first.jai"
|
||||||
|
endif
|
||||||
|
|
||||||
if a:optimized == 1
|
if a:optimized == 1
|
||||||
echo "Compiling release build.jai"
|
echo "Compiling release " . l:filename
|
||||||
" @note We pass 'release' as a user metaprogram arg for the
|
" @note We pass 'release' as a user metaprogram arg for the
|
||||||
" build file to parse in case it cares about that. -release is
|
" build file to parse in case it cares about that. -release is
|
||||||
" a compiler arg that we also include because some build
|
" a compiler arg that we also include because some build
|
||||||
|
@ -1262,7 +1276,7 @@ fu! Build(optimized=0, silent=0)
|
||||||
let l:cmd .= " -release - -release"
|
let l:cmd .= " -release - -release"
|
||||||
let l:set_metaprogram_args = 1
|
let l:set_metaprogram_args = 1
|
||||||
else
|
else
|
||||||
echo "Compiling debug build.jai"
|
echo "Compiling debug " . l:filename
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
if a:optimized == 1
|
if a:optimized == 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user