VS Code/ Languages: make it more universial

This commit is contained in:
Jannik Beyerstedt 2019-10-17 09:44:52 +02:00
parent 063a927e01
commit 388f15988a
6 changed files with 22 additions and 11 deletions

View File

@ -24,8 +24,8 @@ The User Setup will change the user shell and global gitconfig. This can be disa
For a GUI/ Desktop machine, you can enable to install and configure VS Code:
- `user_vscode`: Boolean to install and set the basic configuration of VS Code
- `user_vscode_cpp`: Boolean to install C/C++ dev tools and configure VS Code
- `user_vscode_python`: Boolean to install Python dev tools and configure VS Code
- `user_lang_cpp`: Boolean to install C/C++ dev tools and configure VS Code
- `user_lang_python`: Boolean to install Python dev tools and configure VS Code
Dependencies

View File

@ -9,5 +9,5 @@ usersetup_gitconfig: true
# install VS Code and selectively activate different programming languages
user_vscode: false
user_vscode_cpp: false
user_vscode_python: false
user_lang_cpp: false
user_lang_python: false

View File

@ -28,7 +28,7 @@
vars:
packages:
- clang-format
when: user_vscode == true and user_vscode_cpp == true
when: user_lang_cpp == true
# VS Code - Python Development Tools

View File

@ -28,7 +28,7 @@
vars:
packages:
- clang-format
when: user_vscode == true and user_vscode_cpp == true
when: user_lang_cpp == true
# VS Code - Python Development Tools

View File

@ -30,7 +30,7 @@
vars:
packages:
- clang-format
when: user_vscode == true and user_vscode_cpp == true
when: user_lang_cpp == true
# VS Code - Python Development Tools

View File

@ -1,5 +1,15 @@
---
# Common/VSCode: Install and Configure VS Code
# - Installs VS Code, if user_vscode is set
# - Installs development tools, if the corresponding variable is set
# but will not try to configure VS Code, if user_vscode is not set.
# - Also configures VS Code, of user_vscode is set
# Variables:
# - user_vscode: Boolean, if vscode should be installed and configured
# - user_lang_cpp: Boolean for C and C++
# - user_lang_python: Boolean for Python
- name: vscode - Install and configure VS Code
include_tasks: "{{ item }}"
@ -30,20 +40,21 @@
shell: |
PATH=/usr/local/bin:$PATH
code --install-extension ms-vscode.cpptools
when: user_vscode == true and user_vscode_cpp == true
when: user_vscode == true and user_lang_cpp == true
# VS Code - Python Development Tools
- name: vscode - Python
block:
- name: vscode - Python - Install python dev packages
pip:
name:
- autopep8
- pylint
executable: /usr/local/bin/pip3
when: user_lang_python == true
- name: vscode - Python
block:
- name: vscode - Python - Configure VS Code
shell: |
PATH=/usr/local/bin:$PATH
code --install-extension ms-python.python
when: user_vscode == true and user_vscode_python == true
when: user_vscode == true and user_lang_python == true