add pcloud
This commit is contained in:
+68
-25
@@ -1,57 +1,100 @@
|
||||
---
|
||||
- name: Check for Eclipse JDT Language Server
|
||||
- name: Check for JDT LS
|
||||
ansible.builtin.stat:
|
||||
path: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
path: "{{ jdtls_install_dir }}/plugins"
|
||||
become: false
|
||||
register: jdtls_binary
|
||||
register: jdtls_installed
|
||||
|
||||
- name: Create JDT LS installation directories
|
||||
- name: Create JDT LS target directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ user_name }}"
|
||||
mode: "0755"
|
||||
become: false
|
||||
loop:
|
||||
- "{{ jdtls_install_dir }}"
|
||||
- "{{ user_home }}/.local/bin"
|
||||
|
||||
- name: Read the JDT LS milestone archive name
|
||||
ansible.builtin.uri:
|
||||
url: "{{ jdtls_base_url }}/latest.txt"
|
||||
return_content: true
|
||||
- "{{ jdtls_bin_dir }}"
|
||||
become: false
|
||||
register: jdtls_latest
|
||||
when: not jdtls_binary.stat.exists
|
||||
|
||||
- name: Download Eclipse JDT Language Server
|
||||
- name: Download Eclipse JDT LS
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ jdtls_base_url }}/{{ jdtls_latest.content | trim }}"
|
||||
url: "{{ jdtls_url }}"
|
||||
dest: "{{ jdtls_archive }}"
|
||||
mode: "0644"
|
||||
checksum: "sha256:{{ jdtls_base_url }}/{{ jdtls_latest.content | trim }}.sha256"
|
||||
become: false
|
||||
when: not jdtls_binary.stat.exists
|
||||
force: "{{ jdtls_force_update }}"
|
||||
timeout: "{{ jdtls_download_timeout }}"
|
||||
register: jdtls_download
|
||||
until: jdtls_download is succeeded
|
||||
retries: "{{ jdtls_download_retries }}"
|
||||
delay: "{{ jdtls_download_delay }}"
|
||||
when: jdtls_force_update or not jdtls_installed.stat.exists
|
||||
|
||||
- name: Extract Eclipse JDT Language Server
|
||||
- name: Remove existing JDT LS install when forced
|
||||
ansible.builtin.file:
|
||||
path: "{{ jdtls_install_dir }}"
|
||||
state: absent
|
||||
become: false
|
||||
when: jdtls_force_update and jdtls_installed.stat.exists
|
||||
|
||||
- name: Recreate JDT LS install directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ jdtls_install_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
become: false
|
||||
when: jdtls_force_update and jdtls_installed.stat.exists
|
||||
|
||||
- name: Extract Eclipse JDT LS
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ jdtls_archive }}"
|
||||
dest: "{{ jdtls_install_dir }}"
|
||||
remote_src: true
|
||||
creates: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
become: false
|
||||
when: not jdtls_binary.stat.exists
|
||||
when: jdtls_force_update or not jdtls_installed.stat.exists
|
||||
|
||||
- name: Link jdtls into the user's PATH
|
||||
- name: Check for bundled JDT LS launcher
|
||||
ansible.builtin.stat:
|
||||
path: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
become: false
|
||||
register: jdtls_bundled_launcher
|
||||
|
||||
- name: Link bundled JDT LS launcher onto the user PATH
|
||||
ansible.builtin.file:
|
||||
src: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
dest: "{{ user_home }}/.local/bin/jdtls"
|
||||
dest: "{{ jdtls_bin_dir }}/jdtls"
|
||||
state: link
|
||||
force: true
|
||||
become: false
|
||||
when: jdtls_bundled_launcher.stat.exists
|
||||
|
||||
- name: Create fallback JDT LS launcher
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ jdtls_bin_dir }}/jdtls"
|
||||
mode: "0755"
|
||||
content: |
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
JDTLS_HOME="{{ jdtls_install_dir }}"
|
||||
LAUNCHER_JAR=$(find "$JDTLS_HOME/plugins" -name "org.eclipse.equinox.launcher_*.jar" | sort | tail -n 1)
|
||||
|
||||
exec java \
|
||||
-Declipse.application=org.eclipse.jdt.ls.core.id1 \
|
||||
-Dosgi.bundles.defaultStartLevel=4 \
|
||||
-Declipse.product=org.eclipse.jdt.ls.core.product \
|
||||
-Dlog.protocol=true \
|
||||
-Dlog.level=ALL \
|
||||
-Xmx1G \
|
||||
--add-modules=ALL-SYSTEM \
|
||||
--add-opens java.base/java.util=ALL-UNNAMED \
|
||||
--add-opens java.base/java.lang=ALL-UNNAMED \
|
||||
-jar "$LAUNCHER_JAR" \
|
||||
-configuration "$JDTLS_HOME/config_linux" \
|
||||
-data "$PWD/.jdtls-workspace" \
|
||||
"$@"
|
||||
become: false
|
||||
when: not jdtls_bundled_launcher.stat.exists
|
||||
|
||||
- name: Remove downloaded JDT LS archive
|
||||
ansible.builtin.file:
|
||||
path: "{{ jdtls_archive }}"
|
||||
state: absent
|
||||
become: false
|
||||
|
||||
Reference in New Issue
Block a user