Kotlin
Installation¶
Dependencies¶
Getting Android SDK using sdkmanager¶
export ANDROID_HOME="$HOME/Android/Sdk"
export PATH="$HOME/Android/Sdk/cmdline-tools/latest/bin:$PATH"
Scroll down to "Command line tools only" in https://developer.android.com/studio. and get the download link.
mkdir -p ~/Android/Sdk/cmdline-tools
cd ~/Android/Sdk/cmdline-tools
aria2c 'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip'
unzip commandlinetools-linux-11076708_latest.zip
mv cmdline-tools latest
Install platform-tools¶
For platform-tools (adb, fastboot), I prefer the arch package.
Install build-tools¶
Install the minimum and maximum platform sdk you want to support. https://developer.android.com/tools/releases/platforms
I want to support from nougat (25) to latest (35).
cd ~/Android/Sdk/cmdline-tools/latest/bin
./sdkmanager 'platforms;android-35'
./sdkmanager 'platforms;android-25'
Install latest build-tools
To update all installed packages
Language Server setup for Neovim and Arch¶
You need to install the language server on archlinux and configure the LSP client on neovim. Before doing that take a look at this: https://github.com/Kotlin/kotlin-lsp/blob/a949438c14cf389bbbe83271c9cbb75e7d74d230/scripts/neovim.md
kotlin-lsp PKGBUILD¶
Check the releases in kotlin-lsp: https://github.com/Kotlin/kotlin-lsp
Neovim¶
~/.config/nvim/lua/config/lspclients/kotlinls.lua | |
---|---|
And activate it by adding an entry in lspclients/init.lua
The whole file (for reference):
~/.config/nvim/lua/config/init.lua | |
---|---|