在您喜欢的编辑器中开发 Apple 软件产品。
An Xcode replacement-ish development environment that aims to be your reliable Xcode alternative to develop exciting new apple software products .
XBase enables you to build, watch, and run xcode products as well as swift packages from within your favorite editor. It supports running products on iOS, watchOS and tvOS simulators, along with real-time logging, and some lsp features such as auto-completion and code navigation. ( Features).
Furthermore, XBase has built-in support for a variety of Xcode project generators, which allow you to avoid launching Xcode or manually editing '*.xcodeproj' anytime you add or remove files. We strongly advise you to use one ... at least till XBase supports adding/removing files and folders, along with other requirements. ( Generators)
Please be aware that XBase is still WIP, so don't hesitate to report bugs, ask questions or suggest new exciting features.
I chose to dive into iOS/macOS app development after purchasing an M1 MacBook. However, coming from vim/shell environment and being extremely keyboard oriented, I couldn't handle the transition to a closed sourced, opinionated, mouse-driven development environment. I've considered alternatives like XVim2 and the built-in vim emulator, however still, I'd catch myself frequently hunting for my mouse.
As a long-time vim user who has previously developed a several lua/nvim plugins, I decided to invest some effort in simplifying my development workflow for producing 'xOS' products.
.build folder doesn't exists, Package.swift file is updated or new files or directories are added or removed.XBase primarily supports two project generators: XcodeGen and Tuist.
XcodeGen is recommended if you are just starting started with xcodeproj generators
since it is considerably simpler with a yml-based configuration language. Having said that,
Tuist is more powerful and packed with features, of which xcodeproj generation is but one.
XBase's support for generators is available in the following forms:
project.yml.With current XBase architecture, it should be pretty easy to add support for yet another awesome xcodeproj generator. feel free to get started with [CONTRIBUTING.md] or open a github issue
TODO
To install XBase on your system you need run make install. This will run cargo build --release and resulting binrary to ~/.local/share/xbase/.
use {
'xbase-lab/xbase',
run = 'make install', -- or "make install && make free_space" (not recommended, longer build time)
requires = {
"neovim/nvim-lspconfig",
-- "nvim-telescope/telescope.nvim", -- optional
-- "nvim-lua/plenary.nvim", -- optional/requirement of telescope.nvim
-- "stevearc/dressing.nvim", -- optional (in case you don't use telescope but something else)
},
config = function()
require'xbase'.setup({}) -- see default configuration bellow
end
}" Plug 'nvim-telescope/telescope.nvim' " optional
" Plug 'nvim-lua/plenary.nvim' " optional/requirement of telescope
" Plug 'stevearc/dressing.nvim' " optional/in case you don't use telescope but use something else
Plug 'neovim/nvim-lspconfig'
Plug 'xbase-lab/xbase', { 'do': 'make install' }
lua require'xbase'.setup()" call dein#add('nvim-telescope/telescope.nvim') " optional
" call dein#add('nvim-lua/plenary.nvim') " optional/requirement of telescope
" call dein#add('stevearc/dressing.nvim') " optional/in case you don't use telescope but use something else
call dein#add('neovim/nvim-lspconfig')
call dein#add('xbase-lab/xbase', { 'build': 'make install' })
lua require'xbase'.setup()NOTE: You need to setup sourcekit-lsp (see sourcekit-setup) and consider adding more file to root patterns
TODO
TLDR:
require'xbase'.setup({ --[[ see default configuration ]] })When you start a neovim instance with a root that contains project.yml, Project.swift, or
*.xcodeproj, the daemon server will auto-start if no instance is running, and register the
project once for recompile-watch. To communicate with your daemon, checkout the configurable
shortcuts.
XBase provide feline provider, other statusline plugins support are welcomed. However,
using vim.g.xbase_watch_build_status you can easily setup statusline indicators.
require("xbase.statusline").feline() -- append to feline setup functionTODO
…TODO
Sometimes xcodebuild acts up and things might break, the first step to find the root cause is to check logs. The following is how you can have a stream of logs in your terminal.
# Daemon logs
tail -f /tmp/xbase.log
# Build Server logs
tail -f /tmp/xbase-build-server.logIn case, you need to manually stop servers:
killall xbase xbase-sourcekit-helper暂无开放 Issues,或尚未同步最近议题。