Mercurial > vim-unreal
comparison plugin/unreal.vim @ 2:9235d8341a18
Refactor the build system invocation commands.
Now we have proper knowledge of the projects inside a codebase ("branch"). The
plugin should correctly parse configuration names, find the correct module to
build based on the configuration, and so on.
Also, added support for generating the clang compilation database.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 22 Jan 2021 16:38:18 -0800 |
parents | ba03cac1b1c6 |
children | b5040cfea052 |
comparison
equal
deleted
inserted
replaced
1:43d0e448edce | 2:9235d8341a18 |
---|---|
6 if !(has('job') || (has('nvim') && exists('*jobwait'))) | 6 if !(has('job') || (has('nvim') && exists('*jobwait'))) |
7 echoerr "unreal: this plugin requires the job API from Vim8 or Neovim." | 7 echoerr "unreal: this plugin requires the job API from Vim8 or Neovim." |
8 finish | 8 finish |
9 endif | 9 endif |
10 | 10 |
11 let g:unreal_trace = 0 | 11 let g:unreal_trace = get(g:, 'unreal_trace', 0) |
12 | 12 |
13 let g:unreal_project_dir_marker = get(g:, 'unreal_project_dir_marker', '*.uprojectdirs') | 13 let g:unreal_branch_dir_marker = get(g:, 'unreal_branch_dir_marker', '*.uprojectdirs') |
14 let g:unreal_project_dir_finder = get(g:, 'unreal_project_dir_finder', '') | 14 let g:unreal_branch_dir_finder = get(g:, 'unreal_branch_dir_finder', '') |
15 let g:unreal_auto_find_project = get(g:, 'unreal_auto_find_project', 0) | 15 let g:unreal_auto_find_project = get(g:, 'unreal_auto_find_project', 0) |
16 | 16 |
17 let g:unreal_project_dir = get(g:, 'unreal_project_dir', '') | 17 let g:unreal_branch_projects = {} |
18 let g:unreal_project_platform = get(g:, 'unreal_project_platform', '') | 18 |
19 let g:unreal_project_config = get(g:, 'unreal_project_config', '') | 19 let g:unreal_branch_dir = get(g:, 'unreal_branch_dir', '') |
20 let g:unreal_project = get(g:, 'unreal_project', '') | |
21 let g:unreal_platform = get(g:, 'unreal_platform', 'Win64') | |
22 let g:unreal_config_state = get(g:, 'unreal_config_state', 'Development') | |
23 let g:unreal_config_target = get(g:, 'unreal_config_target', 'Editor') | |
20 | 24 |
21 let g:unreal_modules = get(g:, 'unreal_modules', []) | 25 let g:unreal_modules = get(g:, 'unreal_modules', []) |
22 | 26 |
23 let g:unreal_platforms = get(g:, 'unreal_platforms', [ | 27 let g:unreal_platforms = get(g:, 'unreal_platforms', [ |
24 \"Win32", "Win64", "HoloLens", "Mac", "XboxOne", "PS4", "IOS", "Android", | 28 \"Win32", "Win64", "HoloLens", "Mac", "XboxOne", "PS4", "IOS", "Android", |
25 \"HTML5", "Linux", "AllDesktop", "TVOS", "Switch" | 29 \"HTML5", "Linux", "AllDesktop", "TVOS", "Switch" |
26 \]) | 30 \]) |
27 let g:unreal_configurations = get(g:, 'unreal_configurations', [ | 31 let g:unreal_config_states = get(g:, 'unreal_config_states', [ |
28 \"Debug", "DebugGame", "Development", "Shipping", "Test" | 32 \"Debug", "DebugGame", "Development", "Shipping", "Test" |
33 \]) | |
34 let g:unreal_config_targets = get(g:, 'unreal_config_targets', [ | |
35 \"", "Editor", "Client", "Server" | |
29 \]) | 36 \]) |
30 let g:unreal_build_options = get(g:, 'unreal_build_options', [ | 37 let g:unreal_build_options = get(g:, 'unreal_build_options', [ |
31 \"-DisableUnity", "-ForceUnity" | 38 \"-DisableUnity", "-ForceUnity" |
32 \]) | 39 \]) |
40 let g:unreal_auto_build_modules = get(g:, 'unreal_auto_build_modules', { | |
41 \"ShaderCompileWorker": ["-Quiet"] | |
42 \}) | |
33 let g:unreal_auto_build_options = get(g:, 'unreal_auto_build_options', [ | 43 let g:unreal_auto_build_options = get(g:, 'unreal_auto_build_options', [ |
34 \"-WaitMutex" | 44 \"-WaitMutex" |
35 \]) | 45 \]) |
46 | |
47 let g:unreal_auto_generate_compilation_database = get(g:, 'unreal_auto_generate_compilation_database', 0) | |
36 | 48 |
37 " }}} | 49 " }}} |
38 | 50 |
39 " Commands {{{ | 51 " Commands {{{ |
40 | 52 |
41 command! UnrealFindProject :call unreal#find_project_dir() | 53 command! UnrealFindProject :call unreal#find_project() |
42 command! -nargs=1 -complete=dir UnrealSetProject :call unreal#set_project_dir(<f-args>) | 54 command! -nargs=1 -complete=dir UnrealSetBranchDir :call unreal#set_branch_dir(<f-args>) |
55 command! -nargs=1 -complete=customlist,unreal#complete_projects | |
56 \UnrealSetProject :call unreal#set_project(<f-args>) | |
43 command! -nargs=1 -complete=customlist,unreal#complete_platforms | 57 command! -nargs=1 -complete=customlist,unreal#complete_platforms |
44 \UnrealSetPlatform :call unreal#set_platform(<f-args>) | 58 \UnrealSetPlatform :call unreal#set_platform(<f-args>) |
45 command! -nargs=1 -complete=customlist,unreal#complete_config | 59 command! -nargs=1 -complete=customlist,unreal#complete_configs |
46 \UnrealSetConfig :call unreal#set_config(<f-args>) | 60 \UnrealSetConfig :call unreal#set_config(<f-args>) |
47 | 61 |
48 command! UnrealGenerateProjectFiles :call unreal#generate_project_files() | 62 command! UnrealGenerateProjectFiles :call unreal#generate_project_files() |
63 command! UnrealGenerateCompilationDatabase :call unreal#generate_compilation_database() | |
49 | 64 |
50 command! -nargs=+ -complete=customlist,unreal#complete_build_targets | 65 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
51 \UnrealBuild :call unreal#build(<f-args>) | 66 \UnrealBuild :call unreal#build(<bang>0, <f-args>) |
52 command! -nargs=+ -complete=customlist,unreal#complete_build_targets | 67 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
53 \UnrealBuildEditor :call unreal#build_editor(<f-args>) | 68 \UnrealRebuild :call unreal#rebuild(<bang>0, <f-args>) |
69 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args | |
70 \UnrealClean :call unreal#clean(<bang>0, <f-args>) | |
71 | |
72 command! UnrealReloadBranchProjects :call unreal#set_branch_dir(g:unreal_branch_dir) | |
54 | 73 |
55 " }}} | 74 " }}} |
56 | 75 |
57 " Initialization {{{ | 76 " Initialization {{{ |
58 | 77 |