mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-23 10:31:24 -08:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f56209ca9 | ||
|
|
a3e50cdc02 | ||
|
|
b7c43d8373 | ||
|
|
cadc13f2e0 | ||
|
|
7965d2e081 | ||
|
|
b829a20169 | ||
|
|
653b8b4014 | ||
|
|
a891203204 | ||
|
|
0236a05f26 |
No files matched your search
@@ -1,102 +0,0 @@
|
||||
name: Build GUI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .github/workflows/build-gui.yml
|
||||
- gui/**
|
||||
- package*.json
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/build-gui.yml
|
||||
- gui/**
|
||||
- package*.json
|
||||
workflow_dispatch:
|
||||
create:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
pnpm i
|
||||
cd gui
|
||||
pnpm run lint
|
||||
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
ubuntu-22.04-arm,
|
||||
windows-11-arm,
|
||||
]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
env:
|
||||
CI: false
|
||||
BUILD_ARCH: ${{ endsWith(matrix.os, 'arm') && 'aarch64' || 'amd64' }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm i
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
NODE_OPTIONS: ${{ matrix.os == 'macos-latest' && '--max-old-space-size=4096' || '' }}
|
||||
run: cd gui && pnpm run build
|
||||
|
||||
- if: startsWith(matrix.os, 'windows')
|
||||
name: Upload a Build Artifact (Windows)
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-Windows-{0}', env.BUILD_ARCH) }}
|
||||
path: gui/out/renderer/**/*
|
||||
|
||||
- if: startsWith(matrix.os, 'ubuntu')
|
||||
name: Upload a Build Artifact (Linux)
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-Linux-{0}', env.BUILD_ARCH) }}
|
||||
path: gui/out/renderer/**/*
|
||||
|
||||
- if: matrix.os == 'macos-latest'
|
||||
name: Upload a Build Artifact (macOS)
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: SlimeVR-GUI-macOS
|
||||
path: gui/out/renderer/**/*
|
||||
@@ -0,0 +1,261 @@
|
||||
name: SlimeVR Full Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["v*"]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
setup-matrix:
|
||||
name: Configure Build Matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- id: set-matrix
|
||||
shell: bash
|
||||
run: |
|
||||
BASE='[{"os":"ubuntu-22.04","platform":"linux"},{"os":"windows-latest","platform":"windows"},{"os":"macos-latest","platform":"macos"}]'
|
||||
EXTRA='[{"os":"ubuntu-22.04-arm","platform":"linux"},{"os":"windows-11-arm","platform":"windows"}]'
|
||||
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* || "${{ github.ref }}" == refs/heads/main || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
RESULT=$(echo "$BASE $EXTRA" | jq -c -s 'add')
|
||||
else
|
||||
RESULT=$(echo "$BASE" | jq -c '.')
|
||||
fi
|
||||
echo "matrix={\"include\":$RESULT}" >> "$GITHUB_OUTPUT"
|
||||
gui-checks:
|
||||
name: Gui Checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
- name: GUI Lint
|
||||
run: pnpm i && cd gui && pnpm run lint
|
||||
|
||||
java-checks:
|
||||
name: Java Checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'adopt'
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
- name: Java Spotless Check
|
||||
run: ./gradlew spotlessCheck --build-cache
|
||||
|
||||
|
||||
build-server-jar:
|
||||
name: Build Desktop Server
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'adopt'
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
- name: Build ShadowJar
|
||||
run: ./gradlew :server:desktop:shadowJar --build-cache
|
||||
- name: Test with Gradle
|
||||
run: ./gradlew :server:desktop:test
|
||||
- name: Upload Server Jar
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: server-jar
|
||||
path: server/desktop/build/libs/slimevr.jar
|
||||
|
||||
build-gui-frontend:
|
||||
name: Build GUI Assets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
- name: Build JS
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
run: pnpm i && cd gui && pnpm run build
|
||||
- name: Tar GUI Dist
|
||||
run: tar -czf slimevr-gui-dist.tar.gz -C gui/out .
|
||||
- name: Upload GUI Dist
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: gui-dist
|
||||
path: slimevr-gui-dist.tar.gz
|
||||
|
||||
package-desktop:
|
||||
name: Package Desktop (${{ matrix.platform }} - ${{ matrix.os }})
|
||||
needs: [setup-matrix, build-server-jar, build-gui-frontend]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
- name: Download Server Jar
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: server-jar
|
||||
path: server/desktop/build/libs/
|
||||
- name: Download GUI Dist
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: gui-dist
|
||||
- name: Extract GUI for Electron
|
||||
shell: bash
|
||||
run: mkdir -p gui/out && tar -xzf slimevr-gui-dist.tar.gz -C gui/out
|
||||
- name: Run Electron Builder
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
run: |
|
||||
mkdir -p gui/dist/artifacts/linux/ \
|
||||
gui/dist/artifacts/win \
|
||||
gui/dist/artifacts/mac
|
||||
cd gui
|
||||
pnpm i
|
||||
pnpm exec electron-builder --${{ matrix.platform }} \
|
||||
${{ matrix.platform == 'macos' && '--universal' || '' }} \
|
||||
${{ matrix.platform == 'windows' && '-c.win.target=zip' || '' }} \
|
||||
--publish never
|
||||
- name: Collect and Rename Artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
SRC_DIR="${{ github.workspace }}/gui/dist/artifacts"
|
||||
DEST_DIR="${{ github.workspace }}/release-out"
|
||||
mkdir -p "$DEST_DIR"
|
||||
|
||||
if [ "${{ matrix.platform }}" == "windows" ]; then
|
||||
[[ "${{ matrix.os }}" == *"arm"* ]] && SUFFIX="win-aarch64" || SUFFIX="win64"
|
||||
cp "$SRC_DIR"/win/*.exe "$DEST_DIR/SlimeVR-$SUFFIX.zip"
|
||||
|
||||
elif [ "${{ matrix.platform }}" == "linux" ]; then
|
||||
for f in "$SRC_DIR"/linux/*; do
|
||||
[ -d "$f" ] && continue
|
||||
BASE=$(basename "$f")
|
||||
NEW_NAME=$(echo "$BASE" | sed -e 's/x86_64/amd64/g' -e 's/arm64/aarch64/g')
|
||||
cp "$f" "$DEST_DIR/$NEW_NAME"
|
||||
done
|
||||
|
||||
elif [ "${{ matrix.platform }}" == "macos" ]; then
|
||||
cp "$SRC_DIR"/mac/*.dmg "$DEST_DIR/SlimeVR-mac.dmg"
|
||||
fi
|
||||
|
||||
echo "Collected files:"
|
||||
ls -lh "$DEST_DIR"
|
||||
- name: Upload For Release
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: release-${{ matrix.platform }}-${{ matrix.os }}
|
||||
path: release-out/*
|
||||
|
||||
bundle-android:
|
||||
name: Build Android APK
|
||||
needs: [build-gui-frontend]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'adopt'
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
- name: Download GUI Dist
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: gui-dist
|
||||
- name: Extract GUI for Android
|
||||
run: mkdir -p gui/out && tar -xzf slimevr-gui-dist.tar.gz -C gui/out
|
||||
- name: Build APK
|
||||
run: ./gradlew :server:android:build --build-cache
|
||||
env:
|
||||
ANDROID_STORE_FILE: ${{ secrets.ANDROID_STORE_FILE }}
|
||||
ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_STORE_PASSWD }}
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_KEY_PASSWD }}
|
||||
- name: Test with Gradle
|
||||
run: ./gradlew test
|
||||
- name: Prepare APK
|
||||
run: cp server/android/build/outputs/apk/release/*.apk ./SlimeVR-android.apk
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: release-android
|
||||
path: SlimeVR-android.apk
|
||||
|
||||
create-release:
|
||||
name: Finalize Release Draft
|
||||
needs: [package-desktop, bundle-android, build-server-jar, build-gui-frontend]
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download All Release Artifacts
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
pattern: release-*
|
||||
path: release-out
|
||||
merge-multiple: true
|
||||
- name: Download Server Jar
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: server-jar
|
||||
- name: Download GUI Dist
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: gui-dist
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
release-out/*
|
||||
slimevr.jar
|
||||
slimevr-gui-dist.tar.gz
|
||||
@@ -1,378 +0,0 @@
|
||||
# This workflow will build a Java project with Gradle
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: SlimeVR Server
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
create:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Get tags
|
||||
run: git fetch --tags origin --recurse-submodules=no --force
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'adopt'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
|
||||
- run: mkdir -p ./gui/out/renderer && touch ./gui/out/renderer/somefile
|
||||
shell: bash
|
||||
|
||||
- name: Check code formatting
|
||||
run: ./gradlew spotlessCheck
|
||||
|
||||
- name: Test with Gradle
|
||||
run: ./gradlew test
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Get tags
|
||||
run: git fetch --tags origin --recurse-submodules=no --force
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'adopt'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew :server:desktop:shadowJar
|
||||
|
||||
- name: Upload the Server JAR as a Build Artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
# Artifact name
|
||||
name: 'SlimeVR-Server' # optional, default is artifact
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
path: server/desktop/build/libs/slimevr.jar
|
||||
|
||||
- name: Upload to draft release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
server/desktop/build/libs/slimevr.jar
|
||||
|
||||
bundle-android:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Get tags
|
||||
run: git fetch --tags origin --recurse-submodules=no --force
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'adopt'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
|
||||
- name: Build GUI
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
run: cd gui && pnpm run build
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew :server:android:build
|
||||
env:
|
||||
ANDROID_STORE_FILE: ${{ secrets.ANDROID_STORE_FILE }}
|
||||
ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_STORE_PASSWD }}
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_KEY_PASSWD }}
|
||||
|
||||
- name: Upload the Android build artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
# Artifact name
|
||||
name: 'SlimeVR-Android' # optional, default is artifact
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
path: server/android/build/outputs/apk/*
|
||||
|
||||
- name: Prepare for release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
cp server/android/build/outputs/apk/release/android-release.apk ./SlimeVR-android.apk
|
||||
|
||||
- name: Upload to draft release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
./SlimeVR-android.apk
|
||||
|
||||
- name: Build Google Play release bundle
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: ./gradlew :server:android:bundleRelease
|
||||
env:
|
||||
ANDROID_STORE_FILE: ${{ secrets.ANDROID_GPLAY_STORE_FILE }}
|
||||
ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_GPLAY_STORE_PASSWD }}
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_GPLAY_KEY_ALIAS }}
|
||||
ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_GPLAY_KEY_PASSWD }}
|
||||
|
||||
- name: Upload the Google Play artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
# Artifact name
|
||||
name: 'SlimeVR-Android-GPDev' # optional, default is artifact
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
path: server/android/build/outputs/bundle/release/*
|
||||
|
||||
bundle-linux:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, ubuntu-24.04-arm]
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [build, test]
|
||||
if: contains(fromJSON('["workflow_dispatch", "create"]'), github.event_name)
|
||||
|
||||
env:
|
||||
BUILD_ARCH: ${{ endsWith(matrix.os, 'arm') && 'aarch64' || 'amd64' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: 'SlimeVR-Server'
|
||||
path: server/desktop/build/libs/
|
||||
|
||||
- name: Set up Linux dependencies
|
||||
uses: awalsh128/[email protected]
|
||||
with:
|
||||
packages: |
|
||||
build-essential curl wget file libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev xdg-utils patchelf
|
||||
# Increment to invalidate the cache
|
||||
version: ${{ format('v2.0-electron-{0}', env.BUILD_ARCH) }}
|
||||
# Enables a workaround to attempt to run pre and post install scripts
|
||||
execute_install_scripts: true
|
||||
# Disables uploading logs as a build artifact
|
||||
debug: false
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
run: |
|
||||
cd gui
|
||||
pnpm run build
|
||||
pnpm exec electron-builder --linux --publish never
|
||||
|
||||
- name: Make GUI tarball
|
||||
run: |
|
||||
tar czf slimevr-gui-dist.tar.gz -C gui/out/renderer/ .
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
name: SlimeVR-GUI-Dist
|
||||
path: ./slimevr-gui-dist.tar.gz
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-Deb-{0}', env.BUILD_ARCH) }}
|
||||
path: gui/dist/artifacts/*.deb
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-AppImage-{0}', env.BUILD_ARCH) }}
|
||||
path: gui/dist/artifacts/*.AppImage
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-RPM-{0}', env.BUILD_ARCH) }}
|
||||
path: gui/dist/artifacts/*.rpm
|
||||
|
||||
- name: Prepare for release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
cp gui/dist/artifacts/*.AppImage "./SlimeVR-$BUILD_ARCH.appimage"
|
||||
cp gui/dist/artifacts/*.deb "./SlimeVR-$BUILD_ARCH.deb"
|
||||
cp gui/dist/artifacts/*.rpm "./SlimeVR-$BUILD_ARCH.rpm"
|
||||
|
||||
- name: Upload to draft release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
./slimevr-gui-dist.tar.gz
|
||||
./SlimeVR-*.appimage
|
||||
./SlimeVR-*.deb
|
||||
./SlimeVR-*.rpm
|
||||
|
||||
bundle-mac:
|
||||
runs-on: macos-latest
|
||||
needs: [build, test]
|
||||
if: contains(fromJSON('["workflow_dispatch", "create"]'), github.event_name)
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: 'SlimeVR-Server'
|
||||
path: server/desktop/build/libs/
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pnpm i
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
NODE_OPTIONS: --max-old-space-size=4096
|
||||
run: |
|
||||
cd gui
|
||||
pnpm run build
|
||||
pnpm exec electron-builder --mac --universal --publish never
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: SlimeVR-GUI-MacDmg
|
||||
path: gui/dist/artifacts/*.dmg
|
||||
|
||||
- name: Prepare for release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
cp gui/dist/artifacts/*.dmg ./SlimeVR-mac.dmg
|
||||
|
||||
- name: Upload to draft release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
./SlimeVR-mac.dmg
|
||||
|
||||
bundle-windows:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, windows-11-arm]
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [build, test]
|
||||
if: contains(fromJSON('["workflow_dispatch", "create"]'), github.event_name)
|
||||
|
||||
env:
|
||||
BUILD_ARCH: ${{ endsWith(matrix.os, 'arm') && 'win-aarch64' || 'win64' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: 'SlimeVR-Server'
|
||||
path: server/desktop/build/libs/
|
||||
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm i
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
run: |
|
||||
cd gui
|
||||
pnpm run build
|
||||
pnpm exec electron-builder --win portable --publish never
|
||||
|
||||
- name: Bundle to zips
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir SlimeVR
|
||||
cp gui/dist/artifacts/*.exe ./SlimeVR/slimevr.exe
|
||||
cp gui/electron/resources/icons/icon.ico ./SlimeVR/run.ico
|
||||
cp server/desktop/build/libs/slimevr.jar ./SlimeVR/slimevr.jar
|
||||
cp server/core/resources/* ./SlimeVR/
|
||||
7z a -tzip "SlimeVR-$BUILD_ARCH.zip" ./SlimeVR/
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-Windows-{0}', env.BUILD_ARCH) }}
|
||||
path: ./SlimeVR*.zip
|
||||
|
||||
- name: Upload to draft release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
files: ./SlimeVR-*.zip
|
||||
+2
-1
@@ -35,7 +35,8 @@ be at `server/build/libs/slimevr.jar` (you can ignore `server.jar`).
|
||||
- Activate corepack (included with Node.JS) via `corepack enable` (might require administrator permissions)
|
||||
- Run `pnpm i` in your IDE's terminal to download and install dependencies.
|
||||
- To launch the GUI in dev mode, run `pnpm gui`.
|
||||
- Finally, to compile for production, run `pnpm build`. The result
|
||||
- Finally, to compile for production, run `pnpm package:build`. The result
|
||||
will be at `dist/artifacts/` content will change depending of the platform.
|
||||
|
||||
## Code style
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
wine
|
||||
zlib squashfsTools fakeroot libarchive icu
|
||||
nodejs_22 pnpm pkg-config python3 gcc gnumake binutils git
|
||||
pkgs.nodePackages.node-gyp-build
|
||||
]);
|
||||
|
||||
slimeShell = pkgs.buildFHSEnv {
|
||||
|
||||
+7
-6
@@ -13,9 +13,10 @@ android.useAndroidX=true
|
||||
android.nonTransitiveRClass=true
|
||||
org.gradle.unsafe.configuration-cache=false
|
||||
|
||||
kotlinVersion=2.0.20
|
||||
spotlessVersion=8.0.0
|
||||
shadowJarVersion=8.3.2
|
||||
buildconfigVersion=5.5.0
|
||||
grgitVersion=5.2.2
|
||||
ktor_version=3.0.3
|
||||
kotlinVersion=2.3.10
|
||||
spotlessVersion=8.2.1
|
||||
shadowJarVersion=9.3.1
|
||||
buildconfigVersion=6.0.7
|
||||
# We should probably stop using grgit, see:
|
||||
# https://andrewoberstar.com/posts/2024-04-02-dont-commit-to-grgit/
|
||||
grgitVersion=5.3.3
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
|
||||
distributionSha256Sum=f1771298a70f6db5a29daf62378c4e18a17fc33c9ba6b14362e0cdf40610380d
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+19
-12
@@ -1,7 +1,10 @@
|
||||
appId: dev.slimevr.SlimeVR
|
||||
productName: SlimeVR
|
||||
# Global naming pattern
|
||||
artifactName: "${productName}-${version}-${os}-${arch}.${ext}"
|
||||
|
||||
directories:
|
||||
output: dist/artifacts
|
||||
output: dist/artifacts/${os}
|
||||
|
||||
asar: true
|
||||
asarUnpack:
|
||||
@@ -15,15 +18,16 @@ files:
|
||||
- index.html
|
||||
- package.json
|
||||
- node_modules/**
|
||||
# Exclude unnecessary files from node_modules to reduce size
|
||||
- "!node_modules/*/{README,readme,README.md,readme.md,CHANGELOG,CHANGELOG.md,changelog.md}"
|
||||
- "!node_modules/*/{test,tests,__tests__,docs,doc,example,examples}"
|
||||
- "!node_modules/*/.{git,github,vscode,editorconfig,eslintrc,prettierrc}"
|
||||
- "!node_modules/**/*.{map,ts,tsx,d.ts}"
|
||||
- "!**/.DS_Store"
|
||||
|
||||
|
||||
linux:
|
||||
category: Game
|
||||
artifactName: "${productName}-${arch}.${ext}"
|
||||
target:
|
||||
- target: AppImage
|
||||
- target: deb
|
||||
@@ -36,22 +40,25 @@ linux:
|
||||
icon: "./electron/resources/icons"
|
||||
|
||||
deb:
|
||||
depends:
|
||||
- openjdk-17-jre-headless
|
||||
- udev
|
||||
depends: [openjdk-17-jre-headless, udev]
|
||||
afterInstall: "./electron/resources/scripts/postinstall.sh"
|
||||
afterRemove: "./electron/resources/scripts/postremove.sh"
|
||||
|
||||
rpm:
|
||||
depends:
|
||||
- java-latest-openjdk
|
||||
- udev
|
||||
depends: [java-latest-openjdk, udev]
|
||||
afterInstall: "./electron/resources/scripts/postinstall.sh"
|
||||
afterRemove: "./electron/resources/scripts/postremove.sh"
|
||||
|
||||
win:
|
||||
target:
|
||||
- target: portable
|
||||
artifactName: "${productName}-${os}-${arch}.${ext}"
|
||||
target: [target: portable]
|
||||
icon: "./electron/resources/icons/icon.ico"
|
||||
|
||||
mac:
|
||||
target: dmg
|
||||
artifactName: "SlimeVR-mac.${ext}"
|
||||
x64ArchFiles: "**/register-protocol-handler.node"
|
||||
icon: "./electron/resources/icons/icon.icns"
|
||||
extraFiles:
|
||||
- from: "../server/desktop/build/libs/slimevr.jar"
|
||||
to: "."
|
||||
icon: "./electron/resources/icons/icon.icns"
|
||||
to: "Resources/slimevr.jar"
|
||||
+45
-26
@@ -22,7 +22,6 @@ import {
|
||||
findSystemJRE,
|
||||
getGuiDataFolder,
|
||||
getLogsFolder,
|
||||
getExeFolder,
|
||||
getServerDataFolder,
|
||||
getWindowStateFile,
|
||||
} from './paths';
|
||||
@@ -34,6 +33,8 @@ import { spawn } from 'node:child_process';
|
||||
import { discordPresence } from './presence';
|
||||
import { options } from './cli';
|
||||
import { ServerStatusEvent } from 'electron/preload/interface';
|
||||
import { mkdir } from 'node:fs/promises';
|
||||
import { MenuItem } from 'electron/main';
|
||||
|
||||
// Register custom protocol to handle asset paths with leading slashes
|
||||
protocol.registerSchemesAsPrivileged([
|
||||
@@ -112,15 +113,15 @@ handleIpc(IPC_CHANNELS.LOG, (e, type, ...args) => {
|
||||
});
|
||||
|
||||
handleIpc(IPC_CHANNELS.OPEN_URL, (e, url) => {
|
||||
const allowsd_urls = [
|
||||
const allowed_urls = [
|
||||
/steam:\/\/.*/,
|
||||
/ms-settings:network$/,
|
||||
/https:\/\/.*\.slimevr\.dev.*/,
|
||||
/https:\/\/github\.com\/.*/,
|
||||
/https:\/\/discord\.gg\/slimevr$/,
|
||||
];
|
||||
if (allowsd_urls.find((a) => url.match(a))) open(url);
|
||||
else logger.error({ url }, 'trying to open non allowed url');
|
||||
if (allowed_urls.find((a) => url.match(a))) open(url);
|
||||
else logger.error({ url }, 'attempted to open non-whitelisted URL');
|
||||
});
|
||||
|
||||
handleIpc(IPC_CHANNELS.STORAGE, async (e, { type, method, key, value }) => {
|
||||
@@ -172,8 +173,6 @@ handleIpc(IPC_CHANNELS.GET_FOLDER, (e, folder) => {
|
||||
return getGuiDataFolder();
|
||||
case 'logs':
|
||||
return getLogsFolder();
|
||||
case 'exe':
|
||||
return getExeFolder();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -186,13 +185,11 @@ const defaultWindowState: {
|
||||
height: number;
|
||||
x?: number;
|
||||
y?: number;
|
||||
minimized: boolean;
|
||||
} = {
|
||||
width: 1289.0,
|
||||
height: 709.0,
|
||||
x: undefined,
|
||||
y: undefined,
|
||||
minimized: false,
|
||||
};
|
||||
const windowState = windowStateFile ? JSON.parse(windowStateFile) : defaultWindowState;
|
||||
|
||||
@@ -225,6 +222,11 @@ function validateWindowState(state: typeof defaultWindowState) {
|
||||
return state;
|
||||
}
|
||||
|
||||
const saveWindowState = async () => {
|
||||
await mkdir(dirname(getWindowStateFile()), { recursive: true });
|
||||
writeFileSync(getWindowStateFile(), JSON.stringify(windowState));
|
||||
};
|
||||
|
||||
function createWindow() {
|
||||
const validatedState = validateWindowState(windowState);
|
||||
|
||||
@@ -242,13 +244,10 @@ function createWindow() {
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
devTools: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (windowState.minimized) {
|
||||
mainWindow.minimize();
|
||||
}
|
||||
|
||||
if (process.env.ELECTRON_RENDERER_URL) {
|
||||
mainWindow.loadURL(process.env.ELECTRON_RENDERER_URL);
|
||||
mainWindow.webContents.openDevTools();
|
||||
@@ -319,6 +318,26 @@ function createWindow() {
|
||||
mainWindow.on('resize', updateWindowState);
|
||||
mainWindow.on('minimize', updateWindowState);
|
||||
mainWindow.on('maximize', updateWindowState);
|
||||
|
||||
mainWindow.webContents.on('context-menu', (event, params) => {
|
||||
const menu = new Menu();
|
||||
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: 'Inspect Element',
|
||||
click: () => {
|
||||
mainWindow?.webContents.inspectElement(params.x, params.y);
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
menu.append(new MenuItem({ type: 'separator' }));
|
||||
menu.append(new MenuItem({ label: 'Copy', role: 'copy' }));
|
||||
menu.append(new MenuItem({ label: 'Paste', role: 'paste' }));
|
||||
|
||||
if (mainWindow)
|
||||
menu.popup({ window: mainWindow });
|
||||
});
|
||||
}
|
||||
|
||||
const checkEnvironmentVariables = () => {
|
||||
@@ -331,15 +350,17 @@ const checkEnvironmentVariables = () => {
|
||||
`You have environment variables ${set.join(', ')} set, which may cause the SlimeVR Server to fail to launch properly.`
|
||||
);
|
||||
app.exit(0);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const isServerRunning = async () => !await isPortAvailable(21110)
|
||||
const isServerRunning = async () => !(await isPortAvailable(21110));
|
||||
|
||||
const spawnServer = async () => {
|
||||
if (options.skipServerIfRunning && await isServerRunning()) {
|
||||
logger.info({ skipServerIfRunning: options.skipServerIfRunning }, 'Server alredy running, skipping');
|
||||
if (options.skipServerIfRunning && (await isServerRunning())) {
|
||||
logger.info(
|
||||
{ skipServerIfRunning: options.skipServerIfRunning },
|
||||
'Server is already running, skipping server start'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -359,23 +380,22 @@ const spawnServer = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
logger.info({ serverJar }, 'found server jar');
|
||||
|
||||
logger.info({ javaBin, serverJar }, 'Found Java and server jar');
|
||||
|
||||
const process = spawn(javaBin, ['-Xmx128M', '-jar', serverJar, 'run']);
|
||||
|
||||
process.stdout?.on('data', (message) => {
|
||||
mainWindow?.webContents.send(IPC_CHANNELS.SERVER_STATUS, {
|
||||
message: message.toString(),
|
||||
type: 'stdout'
|
||||
} satisfies ServerStatusEvent)
|
||||
type: 'stdout',
|
||||
} satisfies ServerStatusEvent);
|
||||
});
|
||||
|
||||
process.stderr?.on('data', (message) => {
|
||||
mainWindow?.webContents.send(IPC_CHANNELS.SERVER_STATUS, {
|
||||
message: message.toString(),
|
||||
type: 'stderr'
|
||||
} satisfies ServerStatusEvent)
|
||||
type: 'stderr',
|
||||
} satisfies ServerStatusEvent);
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -395,7 +415,6 @@ app.whenReady().then(async () => {
|
||||
});
|
||||
|
||||
checkEnvironmentVariables();
|
||||
|
||||
const server = await spawnServer();
|
||||
|
||||
createWindow();
|
||||
@@ -410,9 +429,9 @@ app.whenReady().then(async () => {
|
||||
|
||||
process.on('exit', () => {
|
||||
server?.close();
|
||||
})
|
||||
});
|
||||
|
||||
app.on('before-quit', () => {
|
||||
app.on('before-quit', async () => {
|
||||
logger.info('App quitting, saving...');
|
||||
server?.close();
|
||||
stores.settings.save();
|
||||
@@ -420,6 +439,6 @@ app.whenReady().then(async () => {
|
||||
|
||||
discordPresence.destroy();
|
||||
|
||||
writeFileSync(getWindowStateFile(), JSON.stringify(windowState));
|
||||
await saveWindowState();
|
||||
});
|
||||
});
|
||||
@@ -48,12 +48,8 @@ export const getLogsFolder = () => {
|
||||
return join(getGuiDataFolder(), 'logs');
|
||||
};
|
||||
|
||||
export const getExeFolder = () => {
|
||||
return path.dirname(app.getPath('exe'));
|
||||
}
|
||||
|
||||
export const getWindowStateFile = () =>
|
||||
join(getGuiDataFolder(), '.window-state.json');
|
||||
join(getServerDataFolder(), '.window-state.json');
|
||||
|
||||
const localJavaBin = (sharedDir: string) => {
|
||||
const jre = join(sharedDir, 'jre/bin', javaBin);
|
||||
@@ -64,7 +60,6 @@ const javaHomeBin = () => {
|
||||
const javaHome = process.env['JAVA_HOME'];
|
||||
if (!javaHome) return null;
|
||||
const javaHomeJre = join(javaHome, 'bin', javaBin);
|
||||
console.log(javaHomeJre);
|
||||
return javaHomeJre;
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,5 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
openLogsFolder: async () => ipcRenderer.invoke(IPC_CHANNELS.OPEN_FILE, await ipcRenderer.invoke(IPC_CHANNELS.GET_FOLDER, 'logs')),
|
||||
openFile: (path) => ipcRenderer.invoke(IPC_CHANNELS.OPEN_FILE, path),
|
||||
ghGet: (req) => ipcRenderer.invoke(IPC_CHANNELS.GH_FETCH, req),
|
||||
setPresence: (options) => ipcRenderer.invoke(IPC_CHANNELS.DISCORD_PRESENCE, options),
|
||||
getInstallDir: () => ipcRenderer.invoke(IPC_CHANNELS.GET_FOLDER, 'exe')
|
||||
setPresence: (options) => ipcRenderer.invoke(IPC_CHANNELS.DISCORD_PRESENCE, options)
|
||||
} satisfies IElectronAPI);
|
||||
Vendored
-1
@@ -55,7 +55,6 @@ export interface IElectronAPI {
|
||||
openFile: (path: string) => void;
|
||||
ghGet: <T extends GHGet>(options: T) => Promise<GHReturn[T['type']]>;
|
||||
setPresence: (options: DiscordPresence) => void;
|
||||
getInstallDir: () => Promise<string>;
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC="/opt/SlimeVR/69-slimevr-devices.rules"
|
||||
DESTDIRS=("/lib" "/usr/lib")
|
||||
|
||||
if [[ ! -f "$SRC" ]]; then
|
||||
echo "SlimeVR udev rules not found, serial console and dongles may not work" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Configuring SlimeVR udev rules..."
|
||||
|
||||
for DIR in "${DESTDIRS[@]}"; do
|
||||
if [[ -d "$DIR" && ! -h "$DIR" ]]; then
|
||||
echo "Copying rules to $DIR"
|
||||
install -Dm644 "$SRC" "$DIR/udev/rules.d/69-slimevr-devices.rules"
|
||||
|
||||
if command -v udevadm >/dev/null 2>&1; then
|
||||
udevadm control --reload-rules
|
||||
udevadm trigger
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Couldn't copy SlimeVR udev rules, serial console and dongles may not work" >&2
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
echo "Removing SlimeVR udev rules..."
|
||||
rm -f "/lib/udev/rules.d/69-slimevr-devices.rules"
|
||||
rm -f "/usr/lib/udev/rules.d/69-slimevr-devices.rules"
|
||||
|
||||
if command -v udevadm >/dev/null 2>&1; then
|
||||
udevadm control --reload-rules
|
||||
fi
|
||||
@@ -41,7 +41,7 @@ export interface IpcInvokeMap {
|
||||
value?: unknown;
|
||||
}) => Promise<unknown>;
|
||||
[IPC_CHANNELS.OPEN_FILE]: (path: string) => void;
|
||||
[IPC_CHANNELS.GET_FOLDER]: (folder: 'config' | 'logs' | 'exe') => string;
|
||||
[IPC_CHANNELS.GET_FOLDER]: (folder: 'config' | 'logs') => string;
|
||||
[IPC_CHANNELS.GH_FETCH]: <T extends GHGet>(
|
||||
options: T
|
||||
) => Promise<GHReturn[T['type']]>;
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
"start": "vite --force",
|
||||
"gui": "electron-vite dev --config electron.vite.config.ts --watch",
|
||||
"build": "electron-vite build --config electron.vite.config.ts",
|
||||
"package": "pnpm run build && electron-builder",
|
||||
"package": "electron-builder",
|
||||
"package:build": "pnpm build && pnpm package",
|
||||
"preview": "electron-vite preview --config electron.vite.config.ts",
|
||||
"skipbundler": "vite build",
|
||||
"lint": "tsc --noEmit && eslint --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && prettier --check \"src/**/*.{js,jsx,ts,tsx,css,scss,md,json}\"",
|
||||
|
||||
@@ -980,10 +980,6 @@ onboarding-reset_tutorial-2 = Tap the highlighted tracker { $taps } times to tri
|
||||
|
||||
You need to be in a pose like you are skiing as shown in the Automatic Mounting wizard, and you have a 3 second delay (configurable) before it gets triggered.
|
||||
|
||||
## Install info
|
||||
install-info_udev-rules_modal_title = UDEV Rules not found
|
||||
install-info_udev-rules_warning = Please make sure your udev rules are setup correctly. So you can connect trackers and dongle to USB
|
||||
install-info_udev-rules_modal_button = Close
|
||||
## Setup start
|
||||
onboarding-home = Welcome to SlimeVR
|
||||
onboarding-home-start = Let's get set up!
|
||||
|
||||
@@ -17,7 +17,6 @@ import { AutomaticProportionsPage } from './components/onboarding/pages/body-pro
|
||||
import { ManualProportionsPage } from './components/onboarding/pages/body-proportions/ManualProportions';
|
||||
import { ConnectTrackersPage } from './components/onboarding/pages/ConnectTracker';
|
||||
import { HomePage } from './components/onboarding/pages/Home';
|
||||
import { ErrorCollectingConsentPage } from './components/onboarding/pages/ErrorCollectingConstent';
|
||||
import { AutomaticMountingPage } from './components/onboarding/pages/mounting/AutomaticMounting';
|
||||
import { ManualMountingPage } from './components/onboarding/pages/mounting/ManualMounting';
|
||||
import { TrackersAssignPage } from './components/onboarding/pages/trackers-assign/TrackerAssignment';
|
||||
@@ -54,8 +53,6 @@ import { ChecklistPage } from './components/tracking-checklist/TrackingChecklist
|
||||
import { ElectronContextC, provideElectron } from './hooks/electron';
|
||||
import { AppLocalizationProvider } from './i18n/config';
|
||||
import { openUrl } from './hooks/crossplatform';
|
||||
import { UdevRulesModal } from './components/onboarding/UdevRulesModal';
|
||||
import { Updates } from './components/settings/pages/Updates';
|
||||
|
||||
export const GH_REPO = 'SlimeVR/SlimeVR-Server';
|
||||
export const VersionContext = createContext('');
|
||||
@@ -73,7 +70,6 @@ function Layout() {
|
||||
<SerialDetectionModal />
|
||||
<VersionUpdateModal />
|
||||
<UnknownDeviceModal />
|
||||
<UdevRulesModal />
|
||||
<SentryRoutes>
|
||||
<Route element={<AppLayout />}>
|
||||
<Route
|
||||
@@ -141,7 +137,6 @@ function Layout() {
|
||||
<Route path="interface" element={<InterfaceSettings />} />
|
||||
<Route path="interface/home" element={<HomeScreenSettings />} />
|
||||
<Route path="advanced" element={<AdvancedSettings />} />
|
||||
<Route path="updates" element={<Updates />} />
|
||||
</Route>
|
||||
<Route
|
||||
path="/onboarding"
|
||||
@@ -152,10 +147,6 @@ function Layout() {
|
||||
}
|
||||
>
|
||||
<Route path="home" element={<HomePage />} />
|
||||
<Route
|
||||
path="error-collecting-consent"
|
||||
element={<ErrorCollectingConsentPage />}
|
||||
/>
|
||||
<Route path="wifi-creds" element={<WifiCredsPage />} />
|
||||
<Route path="connect-trackers" element={<ConnectTrackersPage />} />
|
||||
<Route path="trackers-assign" element={<TrackersAssignPage />} />
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { useLayoutEffect } from 'react';
|
||||
import { useConfig } from './hooks/config';
|
||||
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { Outlet, useNavigate } from 'react-router-dom';
|
||||
|
||||
export function AppLayout() {
|
||||
const { config } = useConfig();
|
||||
const { pathname } = useLocation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useLayoutEffect(() => {
|
||||
@@ -29,14 +28,10 @@ export function AppLayout() {
|
||||
}, [config]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (
|
||||
config &&
|
||||
!config.doneOnboarding &&
|
||||
!pathname.startsWith('/onboarding/')
|
||||
) {
|
||||
if (config && !config.doneOnboarding) {
|
||||
navigate('/onboarding/home');
|
||||
}
|
||||
}, [config]);
|
||||
}, [config?.doneOnboarding]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -22,6 +22,7 @@ import { GearIcon } from './commons/icon/GearIcon';
|
||||
import { TrackersStillOnModal } from './TrackersStillOnModal';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { TrayOrExitModal } from './TrayOrExitModal';
|
||||
import { ErrorConsentModal } from './ErrorConsentModal';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { connectedIMUTrackersAtom } from '@/store/app-store';
|
||||
import { useElectron } from '@/hooks/electron';
|
||||
@@ -285,6 +286,11 @@ export function TopBar({
|
||||
setConnectedTrackerWarning(false);
|
||||
}}
|
||||
/>
|
||||
<ErrorConsentModal
|
||||
isOpen={config?.errorTracking === null}
|
||||
accept={() => setConfig({ errorTracking: true })}
|
||||
cancel={() => setConfig({ errorTracking: false })}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { BaseModal } from '@/components/commons/BaseModal';
|
||||
import { CheckboxInternal } from '@/components/commons/Checkbox';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useElectron } from '@/hooks/electron';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { RpcMessage, InstalledInfoResponseT } from 'solarxr-protocol';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
|
||||
export function UdevRulesModal() {
|
||||
const { config, setConfig } = useConfig();
|
||||
const { useRPCPacket, sendRPCPacket } = useWebsocketAPI();
|
||||
const electron = useElectron();
|
||||
const [udevContent, setUdevContent] = useState('');
|
||||
const [isUdevInstalledResponse, setIsUdevInstalledResponse] = useState(false);
|
||||
const [showUdevWarning, setShowUdevWarning] = useState(false);
|
||||
const [dontShowThisSession, setDontShowThisSession] = useState(false);
|
||||
const [dontShowAgain, setDontShowAgain] = useState(false);
|
||||
const [exeDir, setExeDir] = useState('');
|
||||
|
||||
const handleUdevContent = async () => {
|
||||
if (electron.isElectron) {
|
||||
const dir = await electron.api.getInstallDir();
|
||||
setExeDir(dir);
|
||||
const rulesDir = `${exeDir}/69-slimevr-devices.rules`;
|
||||
setUdevContent(
|
||||
`cat ${rulesDir} | sudo tee /etc/udev/rules.d/69-slimevr-devices.rules pn>/dev/null`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
handleUdevContent();
|
||||
}, [exeDir]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!config) throw 'Invalid state!';
|
||||
if (electron.isElectron) {
|
||||
const isLinux = electron.data().os.type === 'linux';
|
||||
const udevMissing = !isUdevInstalledResponse;
|
||||
const notHiddenGlobally = !config.dontShowUdevModal;
|
||||
const notHiddenThisSession = !dontShowThisSession;
|
||||
const shouldShow =
|
||||
isLinux && udevMissing && notHiddenGlobally && notHiddenThisSession;
|
||||
if (shouldShow) {
|
||||
setShowUdevWarning(true);
|
||||
} else {
|
||||
setShowUdevWarning(false);
|
||||
}
|
||||
}
|
||||
}, [config, isUdevInstalledResponse, dontShowThisSession]);
|
||||
|
||||
useEffect(() => {
|
||||
sendRPCPacket(
|
||||
RpcMessage.InstalledInfoRequest,
|
||||
new InstalledInfoResponseT()
|
||||
);
|
||||
}, []);
|
||||
|
||||
useRPCPacket(
|
||||
RpcMessage.InstalledInfoResponse,
|
||||
({ isUdevInstalled }: InstalledInfoResponseT) => {
|
||||
setIsUdevInstalledResponse(isUdevInstalled);
|
||||
}
|
||||
);
|
||||
|
||||
const handleModalCose = () => {
|
||||
if (!config) throw 'Invalid State!';
|
||||
setConfig({ dontShowUdevModal: dontShowAgain });
|
||||
setDontShowThisSession(true);
|
||||
};
|
||||
|
||||
const copyToClipboard = () => {
|
||||
navigator.clipboard.writeText(udevContent);
|
||||
};
|
||||
|
||||
return (
|
||||
<BaseModal isOpen={showUdevWarning} appendClasses={'w-full max-w-2xl'}>
|
||||
<div className="flex w-full h-full flex-col gap-4">
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-col gap-2">
|
||||
<Typography
|
||||
variant="main-title"
|
||||
id="install-info_udev-rules_modal_title"
|
||||
/>
|
||||
<Typography id="install-info_udev-rules_warning" />
|
||||
</div>
|
||||
<div className="relative w-full max-w-2xl">
|
||||
<div className="absolute right-2 top-2">
|
||||
<Button variant="secondary" onClick={copyToClipboard}>
|
||||
Copy
|
||||
</Button>
|
||||
</div>
|
||||
<div className="bg-background-80 rounded-lg overflow-auto p-2 w-full h-[300px]">
|
||||
<pre className="text-wrap">{udevContent}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2">
|
||||
<CheckboxInternal
|
||||
label="Don't show this again"
|
||||
outlined={false}
|
||||
name={'dismiss-udev-rules-checkbox'}
|
||||
loading={false}
|
||||
disabled={false}
|
||||
onChange={(e) => setDontShowAgain(e.currentTarget.checked)}
|
||||
/>
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={handleModalCose}
|
||||
id="install-info_udev-rules_modal_button"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</BaseModal>
|
||||
);
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
import { Localized, useLocalization } from '@fluent/react';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
|
||||
export function ErrorCollectingConsentPage() {
|
||||
const { setConfig } = useConfig();
|
||||
|
||||
const accept = () => {
|
||||
setConfig({ errorTracking: true });
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
setConfig({ errorTracking: false });
|
||||
};
|
||||
|
||||
const { l10n } = useLocalization();
|
||||
return (
|
||||
<div className="flex items-center justify-center h-full flex-col gap-3 p-4">
|
||||
<div className="max-w-2xl flex flex-col gap-4">
|
||||
<div className="flex flex-col w-full gap-4">
|
||||
<Typography variant="main-title" id="error_collection_modal-title" />
|
||||
<Localized
|
||||
id={'error_collection_modal-description_v2'}
|
||||
elems={{
|
||||
b: <b />,
|
||||
h1: <span className="text-md font-bold" />,
|
||||
}}
|
||||
>
|
||||
<Typography variant="standard" whitespace="whitespace-pre-line" />
|
||||
</Localized>
|
||||
</div>
|
||||
<div className={'flex flex-row gap-2 justify-between'}>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
to="/onboarding/wifi-creds"
|
||||
onClick={cancel}
|
||||
id="error_collection_modal-cancel"
|
||||
/>
|
||||
<Button
|
||||
variant="primary"
|
||||
to="/onboarding/wifi-creds"
|
||||
onClick={accept}
|
||||
>
|
||||
{l10n.getString('error_collection_modal-confirm')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export function HomePage() {
|
||||
<Typography variant="mobile-title">
|
||||
{l10n.getString('onboarding-home')}
|
||||
</Typography>
|
||||
<Button variant="primary" to="/onboarding/error-collecting-consent">
|
||||
<Button variant="primary" to="/onboarding/wifi-creds">
|
||||
{l10n.getString('onboarding-home-start')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -73,10 +73,6 @@ export function SettingsSidebar() {
|
||||
scrollTo="gestureControl"
|
||||
id="settings-sidebar-gesture_control"
|
||||
/>
|
||||
<SettingsLink
|
||||
to="/settings/updates"
|
||||
id="settings-updates"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-3">
|
||||
|
||||
@@ -48,7 +48,6 @@ export interface Config {
|
||||
homeLayout: 'default' | 'table';
|
||||
skeletonPreview: boolean;
|
||||
lastUsedProportions: 'manual' | 'autobone' | 'scaled' | null;
|
||||
dontShowUdevModal: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigContext {
|
||||
@@ -80,7 +79,6 @@ export const defaultConfig: Config = {
|
||||
homeLayout: 'default',
|
||||
skeletonPreview: true,
|
||||
lastUsedProportions: null,
|
||||
dontShowUdevModal: false,
|
||||
};
|
||||
|
||||
const localStore: CrossStorage = {
|
||||
|
||||
@@ -130,9 +130,6 @@ export function checkForUpdate(
|
||||
|
||||
if (
|
||||
!device.hardwareInfo?.officialBoardType ||
|
||||
![BoardType.SLIMEVR, BoardType.SLIMEVR_V1_2].includes(
|
||||
device.hardwareInfo.officialBoardType
|
||||
) ||
|
||||
!semver.valid(currentFirmwareRelease.version) ||
|
||||
!semver.valid(device.hardwareInfo.firmwareVersion?.toString() ?? 'none')
|
||||
) {
|
||||
@@ -144,6 +141,14 @@ export function checkForUpdate(
|
||||
currentFirmwareRelease.version
|
||||
);
|
||||
|
||||
if (
|
||||
![BoardType.SLIMEVR, BoardType.SLIMEVR_V1_2].includes(
|
||||
device.hardwareInfo.officialBoardType
|
||||
)
|
||||
) {
|
||||
return canUpdate ? 'unavailable' : 'updated';
|
||||
}
|
||||
|
||||
if (
|
||||
canUpdate &&
|
||||
device.hardwareStatus?.batteryPctEstimate != null &&
|
||||
|
||||
@@ -11,12 +11,8 @@ import { DeviceDataT } from 'solarxr-protocol';
|
||||
|
||||
export function getSentryOrCompute(enabled = false, uuid: string) {
|
||||
Sentry.setUser({ id: uuid });
|
||||
|
||||
// if sentry is already initialized - SKIP
|
||||
if (enabled && Sentry.isInitialized()) {
|
||||
log('Sentry already enabled, skipping initialization');
|
||||
return;
|
||||
}
|
||||
if (enabled && Sentry.isInitialized()) return;
|
||||
|
||||
const client = Sentry.getClient();
|
||||
if (client) {
|
||||
|
||||
Generated
+1
@@ -5172,6 +5172,7 @@ packages:
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==}
|
||||
engines: {node: '>=18'}
|
||||
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==}
|
||||
|
||||
@@ -16,7 +16,7 @@ plugins {
|
||||
kotlin("plugin.serialization")
|
||||
id("com.github.gmazzo.buildconfig")
|
||||
|
||||
id("com.android.application") version "8.13.1"
|
||||
id("com.android.application") version "8.13.2"
|
||||
id("org.ajoberstar.grgit")
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ repositories {
|
||||
dependencies {
|
||||
implementation(project(":server:core"))
|
||||
|
||||
implementation("commons-cli:commons-cli:1.8.0")
|
||||
implementation("org.apache.commons:commons-lang3:3.15.0")
|
||||
implementation("commons-cli:commons-cli:1.11.0")
|
||||
implementation("org.apache.commons:commons-lang3:3.20.0")
|
||||
|
||||
// Android stuff
|
||||
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||
@@ -220,8 +220,4 @@ android {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ configure<com.diffplug.gradle.spotless.SpotlessExtension> {
|
||||
",solarxr_protocol.rpc.*,kotlinx.coroutines.*,com.illposed.osc.*,android.app.*",
|
||||
"ij_kotlin_allow_trailing_comma" to true,
|
||||
)
|
||||
val ktlintVersion = "1.7.1"
|
||||
val ktlintVersion = "1.8.0"
|
||||
kotlinGradle {
|
||||
target("**/*.gradle.kts") // default target for kotlinGradle
|
||||
ktlint(ktlintVersion)
|
||||
@@ -61,7 +61,7 @@ configure<com.diffplug.gradle.spotless.SpotlessExtension> {
|
||||
|
||||
removeUnusedImports()
|
||||
// Use eclipse JDT formatter
|
||||
eclipse("4.36")
|
||||
eclipse("4.38")
|
||||
.configFile("spotless.xml")
|
||||
// .withP2Mirrors(mapOf("https://download.eclipse.org/" to "https://mirror.umd.edu/eclipse/"))
|
||||
}
|
||||
|
||||
@@ -63,21 +63,21 @@ dependencies {
|
||||
// This dependency is used internally,
|
||||
// and not exposed to consumers on their own compile classpath.
|
||||
implementation("com.google.flatbuffers:flatbuffers-java:22.10.26")
|
||||
implementation("commons-cli:commons-cli:1.8.0")
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.1")
|
||||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.1")
|
||||
implementation("commons-cli:commons-cli:1.11.0")
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind:2.21.0")
|
||||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.21.0")
|
||||
|
||||
implementation("com.github.jonpeterson:jackson-module-model-versioning:1.2.2")
|
||||
implementation("org.apache.commons:commons-math3:3.6.1")
|
||||
implementation("org.apache.commons:commons-lang3:3.15.0")
|
||||
implementation("org.apache.commons:commons-collections4:4.4")
|
||||
implementation("org.apache.commons:commons-lang3:3.20.0")
|
||||
implementation("org.apache.commons:commons-collections4:4.5.0")
|
||||
|
||||
implementation("com.illposed.osc:javaosc-core:0.8")
|
||||
implementation("com.illposed.osc:javaosc-core:0.9")
|
||||
implementation("org.java-websocket:Java-WebSocket:1.+")
|
||||
implementation("com.melloware:jintellitype:1.+")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
|
||||
implementation("com.mayakapps.kache:kache:2.1.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
implementation("com.mayakapps.kache:kache:2.1.1")
|
||||
|
||||
api("com.github.loucass003:EspflashKotlin:v0.11.0")
|
||||
|
||||
@@ -89,7 +89,7 @@ dependencies {
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
// Use JUnit test framework
|
||||
testImplementation(platform("org.junit:junit-bom:5.10.3"))
|
||||
testImplementation(platform("org.junit:junit-bom:6.0.2"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
testImplementation("org.junit.platform:junit-platform-launcher")
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ class VRCOSCHandler(
|
||||
try {
|
||||
val addr = InetAddress.getByName(ip)
|
||||
oscSender = OSCPortOut(InetSocketAddress(addr, portOut))
|
||||
if (oscPortOut != portOut && oscIp != addr || !wasConnected) {
|
||||
if ((oscPortOut != portOut && oscIp != addr) || !wasConnected) {
|
||||
LogManager.info("[VRCOSCHandler] Sending to port $portOut at address $ip")
|
||||
}
|
||||
oscPortOut = portOut
|
||||
|
||||
@@ -10,7 +10,6 @@ import dev.slimevr.protocol.datafeed.createTrackerId
|
||||
import dev.slimevr.protocol.rpc.autobone.RPCAutoBoneHandler
|
||||
import dev.slimevr.protocol.rpc.firmware.RPCFirmwareUpdateHandler
|
||||
import dev.slimevr.protocol.rpc.games.vrchat.RPCVRChatHandler
|
||||
import dev.slimevr.protocol.rpc.installinfo.RPCInstallInfoHandler
|
||||
import dev.slimevr.protocol.rpc.reset.RPCResetHandler
|
||||
import dev.slimevr.protocol.rpc.serial.RPCProvisioningHandler
|
||||
import dev.slimevr.protocol.rpc.serial.RPCSerialHandler
|
||||
@@ -53,7 +52,6 @@ class RPCHandler(private val api: ProtocolAPI) : ProtocolHandler<RpcMessageHeade
|
||||
RPCVRChatHandler(this, api)
|
||||
RPCTrackingChecklistHandler(this, api)
|
||||
RPCUserHeightCalibration(this, api)
|
||||
RPCInstallInfoHandler(this, api)
|
||||
|
||||
registerPacketListener(
|
||||
RpcMessage.AssignTrackerRequest,
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
package dev.slimevr.protocol.rpc.installinfo
|
||||
|
||||
import com.google.flatbuffers.FlatBufferBuilder
|
||||
import dev.slimevr.protocol.GenericConnection
|
||||
import dev.slimevr.protocol.ProtocolAPI
|
||||
import dev.slimevr.protocol.rpc.RPCHandler
|
||||
import io.eiren.util.logging.LogManager
|
||||
import solarxr_protocol.rpc.InstalledInfoResponse.createInstalledInfoResponse
|
||||
import solarxr_protocol.rpc.RpcMessage
|
||||
import solarxr_protocol.rpc.RpcMessageHeader
|
||||
import java.io.IOException
|
||||
|
||||
class RPCInstallInfoHandler(var rpcHandler: RPCHandler, var api: ProtocolAPI){
|
||||
init {
|
||||
rpcHandler.registerPacketListener(RpcMessage.InstalledInfoRequest, ::onInstalledInfoRequest)
|
||||
}
|
||||
|
||||
fun onInstalledInfoRequest(conn: GenericConnection, messageHeader: RpcMessageHeader?) {
|
||||
val udevResponse = executeShellCommand("udevadm", "cat")
|
||||
var response = false
|
||||
if (udevResponse.contains("slime")) {
|
||||
response = true
|
||||
}
|
||||
else {
|
||||
response = false
|
||||
}
|
||||
|
||||
val fbb = FlatBufferBuilder(1024)
|
||||
val outbound = this.rpcHandler.createRPCMessage(
|
||||
fbb,
|
||||
RpcMessage.InstalledInfoResponse,
|
||||
createInstalledInfoResponse(fbb, response),
|
||||
)
|
||||
fbb.finish(outbound)
|
||||
conn.send(fbb.dataBuffer())
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun executeShellCommand(vararg command: String): String = try {
|
||||
val process = ProcessBuilder(*command)
|
||||
.redirectErrorStream(true)
|
||||
.start()
|
||||
process.inputStream.bufferedReader().readText().also {
|
||||
process.waitFor()
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
LogManager.warning("Error executing shell command: ${e.message}")
|
||||
"Error executing shell command: ${e.message}"
|
||||
}
|
||||
}
|
||||
@@ -1230,8 +1230,10 @@ class HumanSkeleton(
|
||||
}
|
||||
// If trackingArmFromController, reverse
|
||||
if (((boneType == BoneType.LEFT_LOWER_ARM || boneType == BoneType.LEFT_HAND) && isTrackingLeftArmFromController) ||
|
||||
(boneType == BoneType.RIGHT_LOWER_ARM || boneType == BoneType.RIGHT_HAND) &&
|
||||
isTrackingRightArmFromController
|
||||
(
|
||||
(boneType == BoneType.RIGHT_LOWER_ARM || boneType == BoneType.RIGHT_HAND) &&
|
||||
isTrackingRightArmFromController
|
||||
)
|
||||
) {
|
||||
transOffset = -transOffset
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ class Localizer(humanSkeleton: HumanSkeleton) {
|
||||
if (rightKnee.y * SITTING_KNEE_THRESHOLD < rightKnee.x + rightKnee.z) {
|
||||
right = true
|
||||
}
|
||||
return !bufCur.isStanding || left && right
|
||||
return !bufCur.isStanding || (left && right)
|
||||
}
|
||||
|
||||
// get the combined accel of the Torso trackers
|
||||
|
||||
@@ -654,12 +654,10 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
|
||||
private val SENSOR_OFFSET_CORRECTION = Quaternion.rotationAroundZAxis(-FastMath.HALF_PI)
|
||||
private const val RESET_SOURCE_NAME = "TrackerServer"
|
||||
|
||||
@ExperimentalStdlibApi
|
||||
private val hexFormat = HexFormat {
|
||||
bytes.byteSeparator = ","
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
private fun packetToString(packet: DatagramPacket?): String {
|
||||
val sb = StringBuilder()
|
||||
sb.append("DatagramPacket{")
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.serialization") version "2.3.10"
|
||||
application
|
||||
id("com.gradleup.shadow")
|
||||
id("com.github.gmazzo.buildconfig")
|
||||
@@ -59,8 +58,8 @@ dependencies {
|
||||
implementation(project(":server:core"))
|
||||
implementation(project(":solarxr-protocol"))
|
||||
|
||||
implementation("commons-cli:commons-cli:1.8.0")
|
||||
implementation("org.apache.commons:commons-lang3:3.15.0")
|
||||
implementation("commons-cli:commons-cli:1.11.0")
|
||||
implementation("org.apache.commons:commons-lang3:3.20.0")
|
||||
implementation("com.google.protobuf:protobuf-java:4.31.1")
|
||||
implementation("net.java.dev.jna:jna:5.+")
|
||||
implementation("net.java.dev.jna:jna-platform:5.+")
|
||||
@@ -68,10 +67,6 @@ dependencies {
|
||||
exclude(group = "com.fazecast", module = "android")
|
||||
}
|
||||
implementation("org.hid4java:hid4java:0.8.0")
|
||||
implementation("io.ktor:ktor-client-core:3.0.3")
|
||||
implementation("io.ktor:ktor-client-cio:3.0.3")
|
||||
implementation("io.ktor:ktor-client-content-negotiation:3.0.3")
|
||||
implementation("io.ktor:ktor-serialization-kotlinx-json:3.0.3")
|
||||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
|
||||
@@ -9,7 +9,6 @@ import dev.slimevr.bridge.Bridge
|
||||
import dev.slimevr.config.ConfigManager
|
||||
import dev.slimevr.desktop.firmware.DesktopSerialFlashingHandler
|
||||
import dev.slimevr.desktop.games.vrchat.DesktopVRCConfigHandler
|
||||
import dev.slimevr.desktop.install.drivers.InstallDrivers
|
||||
import dev.slimevr.desktop.platform.SteamVRBridge
|
||||
import dev.slimevr.desktop.platform.linux.UnixSocketBridge
|
||||
import dev.slimevr.desktop.platform.linux.UnixSocketRpcBridge
|
||||
@@ -100,9 +99,6 @@ fun main(args: Array<String>) {
|
||||
return
|
||||
}
|
||||
|
||||
val installDrivers = InstallDrivers()
|
||||
installDrivers.runUpdater()
|
||||
|
||||
val configDir = resolveConfig()
|
||||
LogManager.info("Using config dir: $configDir")
|
||||
|
||||
|
||||
@@ -86,7 +86,6 @@ class RegEditLinux : AbstractRegEdit() {
|
||||
}
|
||||
lateinit var registry: Map<String, String>
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
override fun getQwordValue(path: String, key: String): Double? {
|
||||
val value = registry[key] ?: return null
|
||||
if (!value.startsWith("hex(4):")) {
|
||||
@@ -152,7 +151,6 @@ class RegEditLinux : AbstractRegEdit() {
|
||||
}
|
||||
val KEY_VALUE_PATTERN = Regex(""""(.+)"=(.+)""")
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
val HEX_FORMAT = HexFormat {
|
||||
upperCase = false
|
||||
bytes.byteSeparator = ","
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package dev.slimevr.desktop.install.drivers
|
||||
|
||||
class InstallDrivers {
|
||||
|
||||
val os = System.getProperty("os.name").lowercase()
|
||||
|
||||
fun runUpdater() {
|
||||
|
||||
if (os.contains("linux")) {
|
||||
val linuxUpdater = Linux()
|
||||
val linuxFlavour = executeShellCommand("uname", "-n")
|
||||
linuxUpdater.updateLinux()
|
||||
} else if (os.contains("windows")) {
|
||||
println("Running windows updater")
|
||||
val windowsUpdater = Windows()
|
||||
windowsUpdater.updateWindows()
|
||||
} else if (os.contains("darwin")) {
|
||||
println("I dunno")
|
||||
} else {
|
||||
println("guess I'll die")
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package dev.slimevr.desktop.install.drivers
|
||||
|
||||
import io.eiren.util.logging.LogManager
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.call.body
|
||||
import io.ktor.client.engine.cio.CIO
|
||||
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
|
||||
import io.ktor.client.plugins.onDownload
|
||||
import io.ktor.client.plugins.timeout
|
||||
import io.ktor.client.request.get
|
||||
import io.ktor.client.request.prepareGet
|
||||
import io.ktor.client.statement.bodyAsChannel
|
||||
import io.ktor.http.contentLength
|
||||
import io.ktor.serialization.kotlinx.json.json
|
||||
import io.ktor.utils.io.jvm.javaio.copyTo
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.sync.Semaphore
|
||||
import kotlinx.coroutines.sync.withPermit
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
import java.lang.Exception
|
||||
import java.math.BigInteger
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.security.MessageDigest
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipFile
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
fun executeShellCommand(vararg command: String): String = try {
|
||||
val process = ProcessBuilder(*command)
|
||||
.redirectErrorStream(true)
|
||||
.start()
|
||||
process.inputStream.bufferedReader().readText().also {
|
||||
process.waitFor()
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
LogManager.warning("Error executing shell command: ${e.message}")
|
||||
"Error executing shell command: ${e.message}"
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package dev.slimevr.desktop.install.drivers
|
||||
|
||||
import io.eiren.util.logging.LogManager
|
||||
import java.nio.file.Paths
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.exists
|
||||
|
||||
class Linux {
|
||||
|
||||
val path = Paths.get("").toAbsolutePath().toString()
|
||||
|
||||
fun updateLinux() {
|
||||
updateLinuxSteamVRDriver()
|
||||
feeder()
|
||||
updateUdev()
|
||||
}
|
||||
|
||||
fun updateLinuxSteamVRDriver() {
|
||||
val vrPathRegContents = executeShellCommand("${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh")
|
||||
val isDriverRegistered = vrPathRegContents.contains("slimevr")
|
||||
if (!isDriverRegistered) {
|
||||
executeShellCommand(
|
||||
"${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh",
|
||||
"adddriver",
|
||||
"$path/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr",
|
||||
)
|
||||
} else {
|
||||
LogManager.info("steamVR driver is already registered. Skipping...")
|
||||
}
|
||||
}
|
||||
|
||||
fun feeder() {
|
||||
executeShellCommand("chmod", "+x", "$path/$LINUXFEEDERDIRECTORY/SlimeVR-Feeder-App")
|
||||
executeShellCommand("$path/$LINUXFEEDERDIRECTORY/SlimeVR-Feeder-App", "--install")
|
||||
LogManager.info("feeder is registered.")
|
||||
}
|
||||
|
||||
fun updateUdev() {
|
||||
val file = Path("/etc/udev/rules.d/69-slimevr-devices.rules")
|
||||
if (file.exists()) {
|
||||
LogManager.info("Udev rules already exist")
|
||||
return
|
||||
}
|
||||
val res = executeShellCommand("pkexec", "cp", "$path/69-slimevr-devices.rules", "/etc/udev/rules.d/69-slimevr-devices.rules")
|
||||
if (res.contains("Error")) {
|
||||
LogManager.warning("Error installing udev rules")
|
||||
} else {
|
||||
LogManager.info("Successfully installed udev rules")
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
// Linux URLs
|
||||
private const val LINUXSTEAMVRDRIVERDIRECTORY = "slimevr-openvr-driver-x64-linux"
|
||||
private const val LINUXFEEDERDIRECTORY = "SlimeVR-Feeder-App-Linux"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package dev.slimevr.desktop.install.drivers
|
||||
|
||||
import io.eiren.util.logging.LogManager
|
||||
|
||||
|
||||
class Updater {
|
||||
|
||||
val os = System.getProperty("os.name").lowercase()
|
||||
|
||||
fun runUpdater() {
|
||||
if (os.contains("linux")) {
|
||||
LogManager.info("Running linux updater")
|
||||
val linuxUpdater = Linux()
|
||||
val linuxFlavour = executeShellCommand("uname", "-n")
|
||||
linuxUpdater.updateLinux()
|
||||
} else if (os.contains("windows")) {
|
||||
LogManager.info("Running windows updater")
|
||||
val windowsUpdater = Windows()
|
||||
windowsUpdater.updateWindows()
|
||||
} else if (os.contains("darwin")) {
|
||||
LogManager.info("I dunno")
|
||||
} else {
|
||||
LogManager.info("guess I'll die")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package dev.slimevr.desktop.install.drivers
|
||||
|
||||
import io.eiren.util.logging.LogManager
|
||||
import java.nio.file.Paths
|
||||
|
||||
class Windows {
|
||||
|
||||
val path = Paths.get("").toAbsolutePath().toString()
|
||||
|
||||
fun updateWindows() {
|
||||
// First check if everything is already installed. Install it if it isn't
|
||||
usbDrivers()
|
||||
steamVRDriver()
|
||||
feeder()
|
||||
}
|
||||
|
||||
fun usbDrivers() {
|
||||
|
||||
val installedDriversList = executeShellCommand("powershell.exe", "pnputil /enum-drivers")
|
||||
val ch341ser = installedDriversList.contains("ch341ser.inf")
|
||||
val ch343ser = installedDriversList.contains("ch343ser.inf")
|
||||
val silabser = installedDriversList.contains("silabser.inf")
|
||||
|
||||
if (ch341ser && ch343ser && silabser) {
|
||||
LogManager.info("drivers already installed!")
|
||||
return
|
||||
}
|
||||
LogManager.info("Cannot find one of the drivers, installing drivers")
|
||||
val driverinstallOutput = executeShellCommand("$path\\installusbdrivers.bat")
|
||||
LogManager.info(driverinstallOutput)
|
||||
}
|
||||
|
||||
|
||||
fun feeder() {
|
||||
executeShellCommand("${path}\\${WINDOWSFEEDERDIRECTORY}\\SlimeVR-Feeder-App.exe", "--install")
|
||||
}
|
||||
|
||||
fun steamVRDriver() {
|
||||
val steamVRLocation = executeShellCommand("powershell.exe", "-Command", "(Get-ItemProperty \'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 250820\').InstallLocation").trim()
|
||||
if (!steamVRLocation.contains("SteamVR")) {
|
||||
LogManager.warning("SteamVR not installed, cannot install SlimeVR Steam driver.")
|
||||
return
|
||||
}
|
||||
val vrPathRegContents = executeShellCommand("${steamVRLocation}\\bin\\win64\\vrpathreg.exe", "finddriver", "slimevr")
|
||||
val isDriverRegistered = vrPathRegContents.contains("WINDOWSSTEAMVRDRIVERDIRECTORY")
|
||||
if (isDriverRegistered) {
|
||||
LogManager.info("steamVR driver is already registered. Skipping...")
|
||||
return
|
||||
}
|
||||
executeShellCommand(
|
||||
"${steamVRLocation}\\bin\\win64\\vrpathreg.exe",
|
||||
"adddriver",
|
||||
"${
|
||||
Paths.get(
|
||||
"",
|
||||
).toAbsolutePath()
|
||||
}\\${WINDOWSSTEAMVRDRIVERDIRECTORY}\\slimevr",
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val WINDOWSSTEAMVRDRIVERDIRECTORY = "slimevr-openvr-driver-win64"
|
||||
private const val WINDOWSFEEDERDIRECTORY = "SlimeVR-Feeder-App-win64"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import dev.slimevr.desktop.platform.ProtobufMessages.*
|
||||
import dev.slimevr.tracking.trackers.Tracker
|
||||
import dev.slimevr.tracking.trackers.TrackerStatus
|
||||
import dev.slimevr.tracking.trackers.TrackerStatus.Companion.getById
|
||||
import dev.slimevr.tracking.trackers.TrackerUtils
|
||||
import dev.slimevr.util.ann.VRServerThread
|
||||
import io.eiren.util.ann.Synchronize
|
||||
import io.eiren.util.ann.ThreadSafe
|
||||
@@ -218,6 +219,11 @@ abstract class ProtobufBridge(@JvmField protected val bridgeName: String) : ISte
|
||||
|
||||
"mounting_reset" -> instance.resetTrackersMounting(resetSourceName)
|
||||
|
||||
"feet_mounting_reset" -> instance.resetTrackersMounting(
|
||||
resetSourceName,
|
||||
TrackerUtils.feetsBodyParts,
|
||||
)
|
||||
|
||||
"pause_tracking" ->
|
||||
instance
|
||||
.togglePauseTracking(resetSourceName)
|
||||
|
||||
@@ -3558,6 +3558,20 @@ public final class ProtobufMessages {
|
||||
* @return The trackerRole.
|
||||
*/
|
||||
int getTrackerRole();
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @return The manufacturer.
|
||||
*/
|
||||
java.lang.String getManufacturer();
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @return The bytes for manufacturer.
|
||||
*/
|
||||
com.google.protobuf.ByteString getManufacturerBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3588,6 +3602,7 @@ public final class ProtobufMessages {
|
||||
private TrackerAdded() {
|
||||
trackerSerial_ = "";
|
||||
trackerName_ = "";
|
||||
manufacturer_ = "";
|
||||
}
|
||||
|
||||
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
|
||||
@@ -3713,6 +3728,48 @@ public final class ProtobufMessages {
|
||||
return trackerRole_;
|
||||
}
|
||||
|
||||
public static final int MANUFACTURER_FIELD_NUMBER = 5;
|
||||
@SuppressWarnings("serial")
|
||||
private volatile java.lang.Object manufacturer_ = "";
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @return The manufacturer.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public java.lang.String getManufacturer() {
|
||||
java.lang.Object ref = manufacturer_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
manufacturer_ = s;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @return The bytes for manufacturer.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.ByteString getManufacturerBytes() {
|
||||
java.lang.Object ref = manufacturer_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b = com.google.protobuf.ByteString
|
||||
.copyFromUtf8(
|
||||
(java.lang.String) ref
|
||||
);
|
||||
manufacturer_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
|
||||
@java.lang.Override
|
||||
@@ -3742,6 +3799,9 @@ public final class ProtobufMessages {
|
||||
if (trackerRole_ != 0) {
|
||||
output.writeInt32(4, trackerRole_);
|
||||
}
|
||||
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(manufacturer_)) {
|
||||
com.google.protobuf.GeneratedMessage.writeString(output, 5, manufacturer_);
|
||||
}
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
@@ -3766,6 +3826,9 @@ public final class ProtobufMessages {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeInt32Size(4, trackerRole_);
|
||||
}
|
||||
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(manufacturer_)) {
|
||||
size += com.google.protobuf.GeneratedMessage.computeStringSize(5, manufacturer_);
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
@@ -3801,6 +3864,11 @@ public final class ProtobufMessages {
|
||||
!= other.getTrackerRole()
|
||||
)
|
||||
return false;
|
||||
if (
|
||||
!getManufacturer()
|
||||
.equals(other.getManufacturer())
|
||||
)
|
||||
return false;
|
||||
if (!getUnknownFields().equals(other.getUnknownFields()))
|
||||
return false;
|
||||
return true;
|
||||
@@ -3821,6 +3889,8 @@ public final class ProtobufMessages {
|
||||
hash = (53 * hash) + getTrackerName().hashCode();
|
||||
hash = (37 * hash) + TRACKER_ROLE_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getTrackerRole();
|
||||
hash = (37 * hash) + MANUFACTURER_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getManufacturer().hashCode();
|
||||
hash = (29 * hash) + getUnknownFields().hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
@@ -3993,6 +4063,7 @@ public final class ProtobufMessages {
|
||||
trackerSerial_ = "";
|
||||
trackerName_ = "";
|
||||
trackerRole_ = 0;
|
||||
manufacturer_ = "";
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -4044,6 +4115,9 @@ public final class ProtobufMessages {
|
||||
if (((from_bitField0_ & 0x00000008) != 0)) {
|
||||
result.trackerRole_ = trackerRole_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000010) != 0)) {
|
||||
result.manufacturer_ = manufacturer_;
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@@ -4083,6 +4157,11 @@ public final class ProtobufMessages {
|
||||
if (other.getTrackerRole() != 0) {
|
||||
setTrackerRole(other.getTrackerRole());
|
||||
}
|
||||
if (!other.getManufacturer().isEmpty()) {
|
||||
manufacturer_ = other.manufacturer_;
|
||||
bitField0_ |= 0x00000010;
|
||||
onChanged();
|
||||
}
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
onChanged();
|
||||
return this;
|
||||
@@ -4130,6 +4209,11 @@ public final class ProtobufMessages {
|
||||
bitField0_ |= 0x00000008;
|
||||
break;
|
||||
} // case 32
|
||||
case 42: {
|
||||
manufacturer_ = input.readStringRequireUtf8();
|
||||
bitField0_ |= 0x00000010;
|
||||
break;
|
||||
} // case 42
|
||||
default: {
|
||||
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
|
||||
done = true; // was an endgroup tag
|
||||
@@ -4398,6 +4482,93 @@ public final class ProtobufMessages {
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.lang.Object manufacturer_ = "";
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @return The manufacturer.
|
||||
*/
|
||||
public java.lang.String getManufacturer() {
|
||||
java.lang.Object ref = manufacturer_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
manufacturer_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @return The bytes for manufacturer.
|
||||
*/
|
||||
public com.google.protobuf.ByteString getManufacturerBytes() {
|
||||
java.lang.Object ref = manufacturer_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b = com.google.protobuf.ByteString
|
||||
.copyFromUtf8(
|
||||
(java.lang.String) ref
|
||||
);
|
||||
manufacturer_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @param value The manufacturer to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setManufacturer(
|
||||
java.lang.String value
|
||||
) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
manufacturer_ = value;
|
||||
bitField0_ |= 0x00000010;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearManufacturer() {
|
||||
manufacturer_ = getDefaultInstance().getManufacturer();
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>string manufacturer = 5;</code>
|
||||
*
|
||||
* @param value The bytes for manufacturer to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setManufacturerBytes(
|
||||
com.google.protobuf.ByteString value
|
||||
) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
manufacturer_ = value;
|
||||
bitField0_ |= 0x00000010;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:messages.TrackerAdded)
|
||||
}
|
||||
|
||||
@@ -8872,53 +9043,55 @@ public final class ProtobufMessages {
|
||||
+
|
||||
"ctionArgumentsEntry\0326\n\024ActionArgumentsEn"
|
||||
+
|
||||
"try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"f\n\014T"
|
||||
"try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"|\n\014T"
|
||||
+
|
||||
"rackerAdded\022\022\n\ntracker_id\030\001 \001(\005\022\026\n\016track"
|
||||
+
|
||||
"er_serial\030\002 \001(\t\022\024\n\014tracker_name\030\003 \001(\t\022\024\n"
|
||||
+
|
||||
"\014tracker_role\030\004 \001(\005\"\374\002\n\rTrackerStatus\022\022\n"
|
||||
"\014tracker_role\030\004 \001(\005\022\024\n\014manufacturer\030\005 \001("
|
||||
+
|
||||
"\ntracker_id\030\001 \001(\005\022.\n\006status\030\002 \001(\0162\036.mess"
|
||||
"\t\"\374\002\n\rTrackerStatus\022\022\n\ntracker_id\030\001 \001(\005\022"
|
||||
+
|
||||
"ages.TrackerStatus.Status\0221\n\005extra\030\003 \003(\013"
|
||||
".\n\006status\030\002 \001(\0162\036.messages.TrackerStatus"
|
||||
+
|
||||
"2\".messages.TrackerStatus.ExtraEntry\022;\n\n"
|
||||
".Status\0221\n\005extra\030\003 \003(\0132\".messages.Tracke"
|
||||
+
|
||||
"confidence\030\004 \001(\0162\".messages.TrackerStatu"
|
||||
"rStatus.ExtraEntry\022;\n\nconfidence\030\004 \001(\0162\""
|
||||
+
|
||||
"s.ConfidenceH\000\210\001\001\032,\n\nExtraEntry\022\013\n\003key\030\001"
|
||||
".messages.TrackerStatus.ConfidenceH\000\210\001\001\032"
|
||||
+
|
||||
" \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"E\n\006Status\022\020\n\014DIS"
|
||||
",\n\nExtraEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001("
|
||||
+
|
||||
"CONNECTED\020\000\022\006\n\002OK\020\001\022\010\n\004BUSY\020\002\022\t\n\005ERROR\020\003"
|
||||
"\t:\0028\001\"E\n\006Status\022\020\n\014DISCONNECTED\020\000\022\006\n\002OK\020"
|
||||
+
|
||||
"\022\014\n\010OCCLUDED\020\004\"3\n\nConfidence\022\006\n\002NO\020\000\022\007\n\003"
|
||||
"\001\022\010\n\004BUSY\020\002\022\t\n\005ERROR\020\003\022\014\n\010OCCLUDED\020\004\"3\n\n"
|
||||
+
|
||||
"LOW\020\001\022\n\n\006MEDIUM\020\005\022\010\n\004HIGH\020\nB\r\n\013_confiden"
|
||||
"Confidence\022\006\n\002NO\020\000\022\007\n\003LOW\020\001\022\n\n\006MEDIUM\020\005\022"
|
||||
+
|
||||
"ce\"I\n\007Battery\022\022\n\ntracker_id\030\001 \001(\005\022\025\n\rbat"
|
||||
"\010\n\004HIGH\020\nB\r\n\013_confidence\"I\n\007Battery\022\022\n\nt"
|
||||
+
|
||||
"tery_level\030\002 \001(\002\022\023\n\013is_charging\030\003 \001(\010\"\241\002"
|
||||
"racker_id\030\001 \001(\005\022\025\n\rbattery_level\030\002 \001(\002\022\023"
|
||||
+
|
||||
"\n\017ProtobufMessage\022&\n\010position\030\001 \001(\0132\022.me"
|
||||
"\n\013is_charging\030\003 \001(\010\"\241\002\n\017ProtobufMessage\022"
|
||||
+
|
||||
"ssages.PositionH\000\022+\n\013user_action\030\002 \001(\0132\024"
|
||||
"&\n\010position\030\001 \001(\0132\022.messages.PositionH\000\022"
|
||||
+
|
||||
".messages.UserActionH\000\022/\n\rtracker_added\030"
|
||||
"+\n\013user_action\030\002 \001(\0132\024.messages.UserActi"
|
||||
+
|
||||
"\003 \001(\0132\026.messages.TrackerAddedH\000\0221\n\016track"
|
||||
"onH\000\022/\n\rtracker_added\030\003 \001(\0132\026.messages.T"
|
||||
+
|
||||
"er_status\030\004 \001(\0132\027.messages.TrackerStatus"
|
||||
"rackerAddedH\000\0221\n\016tracker_status\030\004 \001(\0132\027."
|
||||
+
|
||||
"H\000\022$\n\007battery\030\005 \001(\0132\021.messages.BatteryH\000"
|
||||
"messages.TrackerStatusH\000\022$\n\007battery\030\005 \001("
|
||||
+
|
||||
"\022$\n\007version\030\006 \001(\0132\021.messages.VersionH\000B\t"
|
||||
"\0132\021.messages.BatteryH\000\022$\n\007version\030\006 \001(\0132"
|
||||
+
|
||||
"\n\007messageB2\n\034dev.slimevr.desktop.platfor"
|
||||
"\021.messages.VersionH\000B\t\n\007messageB2\n\034dev.s"
|
||||
+
|
||||
"mB\020ProtobufMessagesH\003b\006proto3"
|
||||
"limevr.desktop.platformB\020ProtobufMessage"
|
||||
+
|
||||
"sH\003b\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(
|
||||
@@ -8957,7 +9130,8 @@ public final class ProtobufMessages {
|
||||
internal_static_messages_TrackerAdded_descriptor = getDescriptor().getMessageTypes().get(4);
|
||||
internal_static_messages_TrackerAdded_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_messages_TrackerAdded_descriptor,
|
||||
new java.lang.String[] { "TrackerId", "TrackerSerial", "TrackerName", "TrackerRole", }
|
||||
new java.lang.String[] { "TrackerId", "TrackerSerial", "TrackerName", "TrackerRole",
|
||||
"Manufacturer", }
|
||||
);
|
||||
internal_static_messages_TrackerStatus_descriptor = getDescriptor()
|
||||
.getMessageTypes()
|
||||
|
||||
@@ -147,23 +147,13 @@ abstract class SteamVRBridge(
|
||||
val device = instance.deviceManager
|
||||
.createDevice(
|
||||
trackerAdded.trackerName,
|
||||
trackerAdded.trackerSerial,
|
||||
"OpenVR", // TODO : We need the manufacturer
|
||||
null,
|
||||
trackerAdded.manufacturer.ifEmpty { "OpenVR" },
|
||||
)
|
||||
|
||||
// Display name, needsReset and isHmd
|
||||
val displayName: String
|
||||
val isHmd = if (trackerAdded.trackerId == 0) {
|
||||
displayName = if (trackerAdded.trackerName == "HMD") {
|
||||
"SteamVR Driver HMD"
|
||||
} else {
|
||||
"Feeder App HMD"
|
||||
}
|
||||
true
|
||||
} else {
|
||||
displayName = trackerAdded.trackerName
|
||||
false
|
||||
}
|
||||
val displayName: String = trackerAdded.trackerName
|
||||
val isHmd = trackerAdded.trackerId == 0
|
||||
|
||||
// trackerPosition
|
||||
val role = getById(trackerAdded.trackerRole)
|
||||
@@ -385,12 +375,9 @@ abstract class SteamVRBridge(
|
||||
// External battery reporting anything > 0V.
|
||||
// The following should catch internal battery reporting and erroneous
|
||||
// readings.
|
||||
if (((lowestLevel >= 200) || (lowestLevel < 0)) ||
|
||||
(
|
||||
(trackerVoltage < 3.2) &&
|
||||
(lowestLevel <= 0) ||
|
||||
((trackerVoltage >= 5) && (lowestLevel > 150))
|
||||
)
|
||||
if ((lowestLevel >= 200 || lowestLevel < 0) ||
|
||||
(trackerVoltage < 3.2 && lowestLevel <= 0) ||
|
||||
(trackerVoltage >= 5 && lowestLevel > 150)
|
||||
) {
|
||||
return
|
||||
} else {
|
||||
|
||||
@@ -40,7 +40,3 @@ project(":server").projectDir = File("server")
|
||||
include(":server:core")
|
||||
include(":server:desktop")
|
||||
include(":server:android")
|
||||
|
||||
include(":updater")
|
||||
project(":updater").projectDir = File("updater")
|
||||
include("updater:desktop")
|
||||
+1
-1
Submodule solarxr-protocol updated: f5ab1bb214...fa2895b19a.
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# https://help.github.com/articles/dealing-with-line-endings/
|
||||
#
|
||||
# These are explicitly windows files and should use crlf
|
||||
*.bat text eol=crlf
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Ignore Gradle build output directory
|
||||
build
|
||||
|
||||
/bin/
|
||||
*/bin/
|
||||
|
||||
MagnetoLib.dll
|
||||
vrconfig.yml
|
||||
|
||||
# BVH
|
||||
BVH Recordings
|
||||
|
||||
# AutoBone
|
||||
Recordings
|
||||
AutoBone Recordings
|
||||
Load AutoBone Recordings
|
||||
|
||||
# Logs
|
||||
*.log.*
|
||||
*.log.lck
|
||||
*.log
|
||||
logs/
|
||||
|
||||
android/release
|
||||
android/debug
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
This directory and all subdirectories is licensed under the MIT License ([LICENSE-MIT]).
|
||||
|
||||
New contributions still must be dual licensed under both [LICENSE-MIT] and [LICENSE-APACHE].
|
||||
|
||||
[LICENSE-MIT]: /LICENSE-MIT
|
||||
[LICENSE-APACHE]: /LICENSE-APACHE
|
||||
@@ -1,68 +0,0 @@
|
||||
plugins {
|
||||
id("com.diffplug.spotless")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
|
||||
// optional: limit format enforcement to just the files changed by this feature branch
|
||||
// ratchetFrom "origin/main"
|
||||
|
||||
format("misc") {
|
||||
// define the files to apply `misc` to
|
||||
target("*.gradle", "*.md", ".gitignore")
|
||||
|
||||
// define the steps to apply to those files
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
leadingSpacesToTabs()
|
||||
}
|
||||
// format "yaml", {
|
||||
// target "*.yml", "*.yaml",
|
||||
|
||||
// trimTrailingWhitespace()
|
||||
// endWithNewline()
|
||||
// indentWithSpaces(2) // YAML cannot contain tabs: https://yaml.org/faq.html
|
||||
// }
|
||||
|
||||
val editorConfig =
|
||||
mapOf(
|
||||
"max_line_length" to "off",
|
||||
"ktlint_experimental" to "enabled",
|
||||
"ktlint_standard_condition-wrapping" to "disabled",
|
||||
"ktlint_standard_property-naming" to "disabled",
|
||||
"ij_kotlin_packages_to_use_import_on_demand" to
|
||||
"java.util.*,kotlin.math.*,dev.slimevr.autobone.errors.*" +
|
||||
",io.github.axisangles.ktmath.*,kotlinx.atomicfu.*,kotlinx.coroutines.*" +
|
||||
",dev.slimevr.tracking.trackers.*,dev.slimevr.desktop.platform.ProtobufMessages.*" +
|
||||
",solarxr_protocol.rpc.*,kotlinx.coroutines.*,com.illposed.osc.*,android.app.*",
|
||||
"ij_kotlin_allow_trailing_comma" to true,
|
||||
)
|
||||
val ktlintVersion = "1.7.1"
|
||||
kotlinGradle {
|
||||
target("**/*.gradle.kts") // default target for kotlinGradle
|
||||
ktlint(ktlintVersion)
|
||||
.editorConfigOverride(editorConfig)
|
||||
}
|
||||
kotlin {
|
||||
target("**/*.kt")
|
||||
targetExclude("**/build/**/**.kt", "bin/")
|
||||
ktlint(ktlintVersion)
|
||||
.editorConfigOverride(editorConfig)
|
||||
}
|
||||
java {
|
||||
target("**/*.java")
|
||||
targetExclude("**/BuildConfig.java")
|
||||
|
||||
removeUnusedImports()
|
||||
// Use eclipse JDT formatter
|
||||
eclipse("4.36")
|
||||
.configFile("spotless.xml")
|
||||
// .withP2Mirrors(mapOf("https://download.eclipse.org/" to "https://mirror.umd.edu/eclipse/"))
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
# Copyright 2025 Eiren Rain and SlimeVR Contributors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
## QinHeng
|
||||
# CH340
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7522", MODE="0660", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7523", MODE="0660", TAG+="uaccess"
|
||||
# CH341
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="5523", MODE="0660", TAG+="uaccess"
|
||||
# CH343
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D3", MODE="0660", TAG+="uaccess"
|
||||
# CH9102x
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D4", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## Silabs
|
||||
# CP210x
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10C4", ATTRS{idProduct}=="EA60", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## Espressif
|
||||
# ESP32-S3 / ESP32-C3 / ESP32-C5 / ESP32-C6 / ESP32-C61 / ESP32-H2 / ESP32-P4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess"
|
||||
# ESP32-S2
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="0002", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## FTDI
|
||||
# FT232BM/L/Q, FT245BM/L/Q
|
||||
# FT232RL/Q, FT245RL/Q
|
||||
# VNC1L with VDPS Firmware
|
||||
# VNC2 with FT232Slave
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## SlimeVR
|
||||
# smol slime dongle
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="7690", MODE="0660", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="7690", MODE="0660", TAG+="uaccess"
|
||||
@@ -1,101 +0,0 @@
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.serialization") version "2.3.10"
|
||||
application
|
||||
id("com.gradleup.shadow")
|
||||
id("com.github.gmazzo.buildconfig")
|
||||
id("org.ajoberstar.grgit")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
tasks.withType<KotlinCompile> {
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_17)
|
||||
freeCompilerArgs.set(listOf("-Xvalue-classes"))
|
||||
}
|
||||
}
|
||||
|
||||
// Set compiler to use UTF-8
|
||||
tasks.withType<JavaCompile> {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
tasks.withType<Test> {
|
||||
systemProperty("file.encoding", "UTF-8")
|
||||
}
|
||||
tasks.withType<Javadoc> {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
group = "org.example"
|
||||
version = "unspecified"
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
// Use jcenter for resolving dependencies.
|
||||
// You can declare any Maven/Ivy/file repository here.
|
||||
mavenCentral()
|
||||
maven(url = "https://jitpack.io")
|
||||
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":server:core"))
|
||||
implementation("io.ktor:ktor-client-core:3.0.3")
|
||||
implementation("io.ktor:ktor-client-cio:3.0.3")
|
||||
implementation("io.ktor:ktor-client-content-negotiation:3.0.3")
|
||||
implementation("io.ktor:ktor-serialization-kotlinx-json:3.0.3")
|
||||
implementation("commons-cli:commons-cli:1.8.0")
|
||||
implementation("org.apache.commons:commons-lang3:3.15.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
minimize {
|
||||
exclude(dependency("com.fazecast:jSerialComm:.*"))
|
||||
exclude(dependency("net.java.dev.jna:.*:.*"))
|
||||
exclude(dependency("com.google.flatbuffers:flatbuffers-java:.*"))
|
||||
|
||||
exclude(project(":solarxr-protocol"))
|
||||
}
|
||||
archiveBaseName.set("updater")
|
||||
archiveClassifier.set("")
|
||||
archiveVersion.set("")
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("dev.slimevr.updater.Main")
|
||||
}
|
||||
|
||||
buildConfig {
|
||||
useKotlinOutput { topLevelConstants = true }
|
||||
packageName("dev.slimevr.updater")
|
||||
|
||||
val gitVersionTag = providers.exec {
|
||||
commandLine("git", "--no-pager", "tag", "--sort", "-taggerdate", "--points-at", "HEAD")
|
||||
}.standardOutput.asText.get().split('\n').first()
|
||||
buildConfigField("String", "GIT_COMMIT_HASH", "\"${grgit.head().abbreviatedId}\"")
|
||||
buildConfigField("String", "GIT_VERSION_TAG", "\"${gitVersionTag.trim()}\"")
|
||||
buildConfigField("boolean", "GIT_CLEAN", grgit.status().isClean.toString())
|
||||
}
|
||||
|
||||
tasks.run<JavaExec> {
|
||||
standardInput = System.`in` // this is not working
|
||||
args = listOf("run")
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.8 KiB |
@@ -1,15 +0,0 @@
|
||||
@echo off
|
||||
:: Driver installation doesn't work w/o admin, slimes will be sad.
|
||||
net session >nul 2>&1
|
||||
if %errorlevel% == 0 (
|
||||
echo Running with administrative privileges! - Needed for firewall modification!
|
||||
) else (
|
||||
echo Requesting administrative privileges - Needed for Driver installation!
|
||||
:: Temp script to request admin... Works and doesn't leave a mess.
|
||||
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
|
||||
echo UAC.ShellExecute "%~s0", "", "%~dp0", "runas", 1 >> "%temp%\getadmin.vbs"
|
||||
"%temp%\getadmin.vbs"
|
||||
exit /B
|
||||
)
|
||||
|
||||
pnputil /add-driver *.inf /install /subdirs
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
@@ -1,16 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
class Downloader {
|
||||
|
||||
fun downloadServer() {
|
||||
|
||||
}
|
||||
|
||||
fun downloadFeeder() {
|
||||
|
||||
}
|
||||
|
||||
fun downloadDriver() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
class FeatureFlags {
|
||||
var version: String? = null
|
||||
var listChannels: Boolean = false
|
||||
var listVersions: Boolean = false
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
import java.nio.file.Paths
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.exists
|
||||
|
||||
class Linux {
|
||||
|
||||
val sendMainProgress: (Int) -> Unit = { progress -> updaterGui.mainProgressBar.setProgress(progress) }
|
||||
val path = Paths.get("").toAbsolutePath().toString()
|
||||
|
||||
suspend fun updateLinux() {
|
||||
updateLinuxSteamVRDriver()
|
||||
updateUdev()
|
||||
feeder()
|
||||
}
|
||||
|
||||
suspend fun updateFrame() {
|
||||
updateLinuxSteamVRDriver()
|
||||
}
|
||||
|
||||
// TODO: tell user in gui to add steamvr launch arguments
|
||||
suspend fun updateLinuxSteamVRDriver() {
|
||||
updaterGui.subLabel.text = "Updating SteamVR Driver"
|
||||
val vrPathRegContents = executeShellCommand("${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh")
|
||||
val isDriverRegistered = vrPathRegContents.contains("slimevr")
|
||||
if (isDriverRegistered) {
|
||||
updaterGui.subLabel.text = "Downloading SteamVR Driver"
|
||||
downloadFile(LINUXSTEAMVRDRIVERURL, LINUXSTEAMVRDRIVERNAME)
|
||||
updaterGui.subLabel.text = "Unzipping SteamVR Driver"
|
||||
unzip(LINUXSTEAMVRDRIVERNAME, LINUXSTEAMVRDRIVERDIRECTORY)
|
||||
println("${Paths.get("").toAbsolutePath()}/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr")
|
||||
executeShellCommand(
|
||||
"${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh",
|
||||
"adddriver",
|
||||
"$path/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr",
|
||||
)
|
||||
} else {
|
||||
println("steamVR driver is already registered. Skipping...")
|
||||
}
|
||||
updaterGui.subLabel.text = "SteamVR Driver done"
|
||||
sendMainProgress(33)
|
||||
}
|
||||
|
||||
fun removeLinuxSteamVRDriver() {
|
||||
val vrPathRegContents = executeShellCommand("${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh")
|
||||
val isDriverRegistered = vrPathRegContents.contains("slimevr")
|
||||
if (isDriverRegistered) {
|
||||
println("Removing driver from steamvr")
|
||||
executeShellCommand(
|
||||
"${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh",
|
||||
"removedriver",
|
||||
"$path/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr",
|
||||
)
|
||||
} else {
|
||||
println("steamVR driver isn't registered. Skipping...")
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun feeder() {
|
||||
updaterGui.subLabel.text = "Downloading Feeder App"
|
||||
downloadFile(LINUXFEEDERURL, LINUXFEEDERNAME)
|
||||
updaterGui.subLabel.text = "Unzipping Feeder App"
|
||||
unzip(LINUXFEEDERNAME, LINUXFEEDERDIRECTORY)
|
||||
updaterGui.subLabel.text = "Registering Feeder App"
|
||||
executeShellCommand("chmod", "+x", "$path/$LINUXFEEDERDIRECTORY/SlimeVR-Feeder-App")
|
||||
executeShellCommand("$path/$LINUXFEEDERDIRECTORY/SlimeVR-Feeder-App", "--install")
|
||||
sendMainProgress(100)
|
||||
updaterGui.subLabel.text = "Feeder App Done"
|
||||
}
|
||||
|
||||
// TODO: Find a way to do version checking on udev rules
|
||||
fun updateUdev() {
|
||||
updaterGui.subLabel.text = "Setting udev"
|
||||
val file = Path("/etc/udev/rules.d/69-slimevr-devices.rules")
|
||||
if (file.exists()) {
|
||||
updaterGui.subLabel.text = "Udev rules already installed"
|
||||
return
|
||||
}
|
||||
updaterGui.subLabel.text = "Asking for privileges"
|
||||
val res = executeShellCommand("pkexec", "cp", "$path/69-slimevr-devices.rules", "/etc/udev/rules.d/69-slimevr-devices.rules")
|
||||
if (res.contains("Error")) {
|
||||
println("Error installing udev rules")
|
||||
} else {
|
||||
println("Successfully installed udev rules")
|
||||
}
|
||||
sendMainProgress(66)
|
||||
updaterGui.subLabel.text = "Udev done"
|
||||
}
|
||||
|
||||
companion object {
|
||||
// Linux URLs
|
||||
private const val LINUXSTEAMVRDRIVERURL = "https://github.com/SlimeVR/SlimeVR-OpenVR-Driver/releases/latest/download/slimevr-openvr-driver-x64-linux.zip"
|
||||
private const val LINUXSTEAMVRDRIVERNAME = "slimevr-openvr-driver-x64-linux.zip"
|
||||
private const val LINUXSTEAMVRDRIVERDIRECTORY = "slimevr-openvr-driver-x64-linux"
|
||||
private const val LINUXFEEDERURL = "https://github.com/SlimeVR/SlimeVR-Feeder-App/releases/latest/download/SlimeVR-Feeder-App-Linux.zip"
|
||||
private const val LINUXFEEDERNAME = "SlimeVR-Feeder-App-Linux.zip"
|
||||
private const val LINUXFEEDERDIRECTORY = "SlimeVR-Feeder-App-Linux"
|
||||
private const val LINUXSERVERURL = "https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-amd64.appimage"
|
||||
private const val LINUXSERVERNAME = "SlimeVR-amd64.appimage"
|
||||
private const val LINUXSERVERDIRECTORY = "slimevr-linux"
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
@file:JvmName("Main")
|
||||
|
||||
package dev.slimevr.updater
|
||||
|
||||
import dev.slimevr.updater.ManifestUtils.Companion.listChannels
|
||||
import dev.slimevr.updater.ManifestUtils.Companion.listVersions
|
||||
import org.apache.commons.cli.CommandLine
|
||||
import org.apache.commons.cli.CommandLineParser
|
||||
import org.apache.commons.cli.DefaultParser
|
||||
import org.apache.commons.cli.HelpFormatter
|
||||
import org.apache.commons.cli.Options
|
||||
import kotlin.system.exitProcess
|
||||
import kotlin.text.ifEmpty
|
||||
|
||||
val VERSION =
|
||||
(GIT_VERSION_TAG.ifEmpty { GIT_COMMIT_HASH }) +
|
||||
if (GIT_CLEAN) "" else "-dirty"
|
||||
val updaterGui = UpdaterGui()
|
||||
|
||||
val featureFlags = FeatureFlags()
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val parser: CommandLineParser = DefaultParser()
|
||||
val formatter = HelpFormatter()
|
||||
val options = Options()
|
||||
options.addOption("h", "help", false, "Show help")
|
||||
options.addOption("i", "install", false, "Specify version to update to")
|
||||
options.addOption("c", "channels", false, "List all release channels")
|
||||
options.addOption("l", "list", false, "List all versions")
|
||||
val cmd: CommandLine = try {
|
||||
parser.parse(options, args, true)
|
||||
} catch (e: org.apache.commons.cli.ParseException) {
|
||||
formatter.printHelp("updater.jar", options)
|
||||
exitProcess(1)
|
||||
}
|
||||
if (cmd.hasOption("help")) {
|
||||
formatter.printHelp("updater.jar", options)
|
||||
exitProcess(0)
|
||||
}
|
||||
if (cmd.hasOption("install")) {
|
||||
featureFlags.version = cmd.getOptionValue("install")
|
||||
}
|
||||
if (cmd.hasOption("channels")) {
|
||||
featureFlags.listChannels = true
|
||||
val manifest = Manifest().getManifest()
|
||||
listChannels(manifest)
|
||||
exitProcess(0)
|
||||
}
|
||||
if (cmd.hasOption("list")) {
|
||||
featureFlags.listVersions = true
|
||||
val manifest = Manifest().getManifest()
|
||||
listVersions(manifest, cmd.getOptionValue("list"))
|
||||
exitProcess(0)
|
||||
}
|
||||
|
||||
val manifest = Manifest()
|
||||
|
||||
val updater = Updater()
|
||||
updater.runUpdater()
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import java.io.File
|
||||
|
||||
class Manifest {
|
||||
private val json: Json = Json { ignoreUnknownKeys = true }
|
||||
private val manifest: ManifestObject
|
||||
|
||||
init {
|
||||
val file = File("update-manifest.json").readText()
|
||||
manifest = Json.decodeFromString<ManifestObject>(file)
|
||||
val json = Json {
|
||||
ignoreUnknownKeys = true
|
||||
}
|
||||
}
|
||||
|
||||
fun getManifest(): ManifestObject {
|
||||
return manifest
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class Release(
|
||||
val url: String,
|
||||
val run: List<String>
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Versions(
|
||||
@SerialName("release_notes")
|
||||
val releaseNotes: String,
|
||||
val builds: Map<String, Map<String, Release>>
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Channel(
|
||||
val description: String,
|
||||
@SerialName("current_version")
|
||||
val currentVersion: String,
|
||||
val versions: Map<String, Versions>
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ManifestObject(
|
||||
@SerialName("default_channel")
|
||||
val defaultChannel: String,
|
||||
val channels: Map<String, Channel>
|
||||
)
|
||||
|
||||
class ChannelDisplayObject(
|
||||
val channelName: String,
|
||||
val Description: String
|
||||
)
|
||||
|
||||
class VersionDisplayObject(
|
||||
val version: String,
|
||||
val Description: String,
|
||||
val Url: String
|
||||
)
|
||||
@@ -1,26 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
class ManifestUtils {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun listChannels(manifest: ManifestObject) {
|
||||
manifest.channels.forEach { channel ->
|
||||
println(channel.key)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun listVersions(manifest: ManifestObject, channel: String) {
|
||||
manifest.channels[channel]?.versions?.forEach { version ->
|
||||
println(version)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getRelease(manifest: ManifestObject, channel: String, version: String, platform: String, release: String): Release? {
|
||||
val res = manifest.channels[channel]?.versions[version]?.builds[platform]?.get(release)
|
||||
return res
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
|
||||
class Updater {
|
||||
|
||||
@Serializable
|
||||
data class GHResponse(
|
||||
val tag_name: String,
|
||||
val assets: JsonArray
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ReleaseInfo(
|
||||
val url: String,
|
||||
val id: Long,
|
||||
val name: String,
|
||||
val digest: String
|
||||
)
|
||||
|
||||
|
||||
val os = System.getProperty("os.name").lowercase()
|
||||
|
||||
fun runUpdater() {
|
||||
|
||||
val manifest = Manifest()
|
||||
|
||||
|
||||
|
||||
//channels.getChannels("Server")
|
||||
|
||||
/*
|
||||
val shouldUpdate: Boolean = shouldUpdate()
|
||||
println("Should update $shouldUpdate")
|
||||
|
||||
/*
|
||||
if (!shouldUpdate) {
|
||||
println("Updater didn't find any new version")
|
||||
return
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
if (os.contains("linux")) {
|
||||
val linuxUpdater = Linux()
|
||||
val linuxFlavour = executeShellCommand("uname", "-n")
|
||||
|
||||
// Skip some install stuff if running on frame
|
||||
// if (linuxFlavour.contains("amos")) {
|
||||
// linuxUpdater.updateFrame()
|
||||
// }
|
||||
// else {
|
||||
linuxUpdater.updateLinux()
|
||||
// }
|
||||
} else if (os.contains("windows")) {
|
||||
println("Running windows updater")
|
||||
val windowsUpdater = Windows()
|
||||
windowsUpdater.updateWindows()
|
||||
} else if (os.contains("darwin")) {
|
||||
println("I dunno")
|
||||
} else {
|
||||
println("guess I'll die")
|
||||
}
|
||||
updaterGui.mainLabel.text = "Done Installing"
|
||||
updaterGui.mainLabel.isVisible = false
|
||||
|
||||
Thread.sleep(1000)
|
||||
return
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
val CDN = "http://127.0.0.1:8080"
|
||||
}
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
import java.awt.*
|
||||
import java.awt.event.MouseAdapter
|
||||
import java.awt.event.MouseEvent
|
||||
|
||||
|
||||
class UpdaterGui : Frame() {
|
||||
|
||||
val mainLabel = Label("Installing SlimeVR Drivers", Label.CENTER)
|
||||
val subLabel = Label("", Label.CENTER)
|
||||
val mainProgressBar: ProgressBar = ProgressBar()
|
||||
val subProgressBar: ProgressBar = ProgressBar()
|
||||
|
||||
init {
|
||||
isUndecorated = true
|
||||
|
||||
val frameDragListener: FrameDragListener = FrameDragListener(this)
|
||||
addMouseListener(frameDragListener)
|
||||
addMouseMotionListener(frameDragListener)
|
||||
pack()
|
||||
setLocationRelativeTo(null)
|
||||
|
||||
setBackground(Color(17, 45, 67))
|
||||
setSize(400, 450)
|
||||
|
||||
val dim = Toolkit.getDefaultToolkit().screenSize
|
||||
this.setLocation(
|
||||
dim.width / 2 - this.size.width / 2,
|
||||
dim.height / 2 - this.size.height / 2,
|
||||
)
|
||||
|
||||
mainLabel.foreground = Color.WHITE
|
||||
mainLabel.setFont(Font("Poppins", Font.PLAIN, 16))
|
||||
subLabel.foreground = Color.WHITE
|
||||
|
||||
setLayout(GridBagLayout())
|
||||
val gbc = GridBagConstraints()
|
||||
gbc.gridx = 0
|
||||
gbc.insets = Insets(0, 10, 5, 10)
|
||||
|
||||
val gifLabel = Label("Loading Animation...", Label.CENTER)
|
||||
gifLabel.setForeground(Color.WHITE)
|
||||
|
||||
val animatedGif = GifCanvas("jumping-slime.gif")
|
||||
|
||||
gbc.gridy = 0
|
||||
add(mainLabel, gbc)
|
||||
gbc.gridy = 1
|
||||
add(animatedGif, gbc)
|
||||
gbc.gridy = 2
|
||||
gbc.fill = GridBagConstraints.HORIZONTAL
|
||||
add(mainProgressBar, gbc)
|
||||
gbc.gridy = 3
|
||||
add(subLabel, gbc)
|
||||
gbc.gridy = 4
|
||||
add(subProgressBar, gbc)
|
||||
|
||||
isVisible = true
|
||||
}
|
||||
}
|
||||
|
||||
class FrameDragListener(private val frame: UpdaterGui) : MouseAdapter() {
|
||||
private var mouseDownCompCoords: Point? = null
|
||||
|
||||
override fun mouseReleased(e: MouseEvent?) {
|
||||
mouseDownCompCoords = null
|
||||
}
|
||||
|
||||
override fun mousePressed(e: MouseEvent) {
|
||||
mouseDownCompCoords = e.getPoint()
|
||||
}
|
||||
|
||||
override fun mouseDragged(e: MouseEvent) {
|
||||
val currCoords: Point = e.locationOnScreen
|
||||
frame.setLocation(
|
||||
currCoords.x - mouseDownCompCoords!!.x,
|
||||
currCoords.y - mouseDownCompCoords!!.y
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class GifCanvas(path: String?) : Canvas() {
|
||||
private val img: Image? = Toolkit.getDefaultToolkit().getImage(path)
|
||||
private val scaledImage: Image? = img?.getScaledInstance(150, 150, Image.SCALE_DEFAULT)
|
||||
private var offscreen: Image? = null
|
||||
private var offscreenG: Graphics? = null
|
||||
|
||||
init {
|
||||
prepareImage(img, this)
|
||||
val tracker = MediaTracker(this)
|
||||
tracker.addImage(img, 0)
|
||||
try {
|
||||
tracker.waitForID(0)
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun update(g: Graphics) {
|
||||
paint(g)
|
||||
}
|
||||
|
||||
override fun paint(g: Graphics) {
|
||||
val w = getWidth()
|
||||
val h = getHeight()
|
||||
offscreen = createImage(width, height)
|
||||
offscreenG = offscreen?.graphics
|
||||
|
||||
offscreenG?.color = Color(17, 45, 67, 255)
|
||||
offscreenG?.fillRect(0, 0, w, h)
|
||||
|
||||
if (scaledImage != null) {
|
||||
val iw = scaledImage.getWidth(this)
|
||||
val ih = scaledImage.getHeight(this)
|
||||
if (iw > 0 && ih > 0) {
|
||||
offscreenG?.drawImage(scaledImage, (w - iw) / 2, (h - ih) / 2, this)
|
||||
}
|
||||
}
|
||||
|
||||
g.drawImage(offscreen, 0, 0, this)
|
||||
}
|
||||
|
||||
override fun imageUpdate(
|
||||
img: Image?,
|
||||
infoflags: Int,
|
||||
x: Int,
|
||||
y: Int,
|
||||
w: Int,
|
||||
h: Int,
|
||||
): Boolean {
|
||||
if ((infoflags and (FRAMEBITS or ALLBITS)) != 0) {
|
||||
repaint()
|
||||
}
|
||||
return (infoflags and (ALLBITS or ABORT or ERROR)) == 0
|
||||
}
|
||||
|
||||
override fun getPreferredSize(): Dimension = Dimension(200, 200)
|
||||
}
|
||||
|
||||
class ProgressBar() : Canvas() {
|
||||
var currentProgress: Int = 0
|
||||
val progressBarWidth = 200
|
||||
|
||||
fun setProgress(newProgress: Int) {
|
||||
currentProgress = ((newProgress) * (progressBarWidth) / 100)
|
||||
repaint()
|
||||
}
|
||||
init {
|
||||
setSize(200, 15)
|
||||
}
|
||||
|
||||
override fun paint(g: Graphics) {
|
||||
// Background
|
||||
g.color = Color(8, 30, 48)
|
||||
g.fillRoundRect(0, 0, progressBarWidth, 10, 5, 5)
|
||||
|
||||
// Progress
|
||||
g.color = Color(101, 69, 154)
|
||||
g.fillRoundRect(0, 0, currentProgress, 10, 5, 5) // Static 60% for now
|
||||
}
|
||||
}
|
||||
@@ -1,211 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.call.body
|
||||
import io.ktor.client.engine.cio.CIO
|
||||
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
|
||||
import io.ktor.client.plugins.onDownload
|
||||
import io.ktor.client.plugins.timeout
|
||||
import io.ktor.client.request.get
|
||||
import io.ktor.client.request.prepareGet
|
||||
import io.ktor.client.statement.bodyAsChannel
|
||||
import io.ktor.http.contentLength
|
||||
import io.ktor.serialization.kotlinx.json.json
|
||||
import io.ktor.utils.io.jvm.javaio.copyTo
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.sync.Semaphore
|
||||
import kotlinx.coroutines.sync.withPermit
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
import java.lang.Exception
|
||||
import java.math.BigInteger
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.security.MessageDigest
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipFile
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
fun executeShellCommand(vararg command: String): String = try {
|
||||
val process = ProcessBuilder(*command)
|
||||
.redirectErrorStream(true)
|
||||
.start()
|
||||
process.inputStream.bufferedReader().readText().also {
|
||||
process.waitFor()
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
"Error executing shell command: ${e.message}"
|
||||
}
|
||||
|
||||
val sendSubProgress: (Float) -> Unit = { progress -> updaterGui.subProgressBar.setProgress(progress.toInt()) }
|
||||
|
||||
fun downloadFile(
|
||||
fileUrl: String,
|
||||
fileName: String,
|
||||
onProgress: (Float) -> Unit = sendSubProgress,
|
||||
) {
|
||||
onProgress(0f)
|
||||
val client = HttpClient(CIO)
|
||||
val outputStream = FileOutputStream(fileName)
|
||||
|
||||
runBlocking {
|
||||
client.prepareGet(
|
||||
fileUrl,
|
||||
block = {
|
||||
val timeout = 30.seconds.inWholeMilliseconds
|
||||
timeout {
|
||||
requestTimeoutMillis = timeout
|
||||
connectTimeoutMillis = timeout
|
||||
socketTimeoutMillis = timeout
|
||||
}
|
||||
onDownload { bytesSentTotal, contentLength ->
|
||||
val progress = bytesSentTotal.toFloat() / (contentLength?.toFloat() ?: 1f)
|
||||
onProgress(progress * 100)
|
||||
}
|
||||
},
|
||||
).execute { httpResponse ->
|
||||
if (httpResponse.status.value in 200..299) {
|
||||
val byteReadChannel = httpResponse.bodyAsChannel()
|
||||
byteReadChannel.copyTo(outputStream)
|
||||
}
|
||||
}
|
||||
}
|
||||
checksum(fileName)
|
||||
}
|
||||
|
||||
// Guard against zip slip
|
||||
fun resolveSaveFile(destinationPath: File, zipEntry: ZipEntry): File {
|
||||
val destFile = File(destinationPath, zipEntry.name)
|
||||
|
||||
val destinationDirPath = destinationPath.getCanonicalPath()
|
||||
val destinationFilePath = destFile.getCanonicalPath()
|
||||
|
||||
if (!destinationFilePath.startsWith(destinationDirPath + File.separator)) {
|
||||
throw IOException("Entry is outside of the target dir: ${zipEntry.name}")
|
||||
}
|
||||
|
||||
return destFile
|
||||
}
|
||||
|
||||
suspend fun unzip(
|
||||
file: String,
|
||||
destDir: String,
|
||||
onProgress: (Float) -> Unit = sendSubProgress,
|
||||
) {
|
||||
val destFolder = File(destDir)
|
||||
if (!destFolder.exists()) {
|
||||
destFolder.mkdirs()
|
||||
}
|
||||
onProgress(0f)
|
||||
withContext(Dispatchers.IO) {
|
||||
val zipFile = ZipFile(file)
|
||||
var progress = 0f
|
||||
val semaphore = Semaphore(4)
|
||||
for (entry in zipFile.entries()) {
|
||||
this.launch() {
|
||||
semaphore.withPermit {
|
||||
unzipWorker(zipFile, entry, destDir)
|
||||
}
|
||||
}
|
||||
onProgress(progress / zipFile.size() * 100)
|
||||
progress++
|
||||
}
|
||||
}
|
||||
onProgress(100f)
|
||||
}
|
||||
|
||||
suspend fun unzipWorker(zipFile: ZipFile, zipEntry: ZipEntry, destDir: String) {
|
||||
val destFolder = File(destDir)
|
||||
val targetFile = File(destFolder, zipEntry.name)
|
||||
if (!targetFile.canonicalPath.startsWith(destFolder.canonicalPath)) {
|
||||
throw IOException("Entry is outside of the target dir: ${zipEntry.name}")
|
||||
}
|
||||
|
||||
withContext(Dispatchers.IO) {
|
||||
try {
|
||||
if (zipEntry.isDirectory) {
|
||||
if (!targetFile.exists() && !targetFile.mkdirs()) {
|
||||
throw IOException("Failed to create directory: $targetFile")
|
||||
}
|
||||
} else {
|
||||
targetFile.parentFile?.let { parent ->
|
||||
if (!parent.exists() && !parent.mkdirs() && !parent.exists()) {
|
||||
throw IOException("Failed to create parent directory: $parent")
|
||||
}
|
||||
}
|
||||
|
||||
zipFile.getInputStream(zipEntry).use { input ->
|
||||
FileOutputStream(targetFile).use { output ->
|
||||
input.copyTo(output, bufferSize = 8192)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
println("Error during unzip of ${zipEntry.name}: ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteFile(file: File) {
|
||||
if (file.exists() && file.isFile) {
|
||||
file.delete()
|
||||
}
|
||||
}
|
||||
|
||||
fun checksum(file: String) {
|
||||
val data = Files.readAllBytes(Paths.get(file))
|
||||
val hash = MessageDigest.getInstance("SHA-256").digest(data)
|
||||
val checksum = BigInteger(1, hash).toString(16)
|
||||
}
|
||||
|
||||
suspend fun shouldUpdate(): Boolean {
|
||||
println("Current version $VERSION")
|
||||
// We're running from a git branch don't update
|
||||
if (VERSION.contains("dirty")) {
|
||||
return false
|
||||
}
|
||||
val client = HttpClient(CIO) {
|
||||
install(ContentNegotiation) {
|
||||
json(
|
||||
Json {
|
||||
ignoreUnknownKeys = true
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
try {
|
||||
val response: Updater.GHResponse = client.get("https://api.github.com/repos/slimevr/slimevr-server/releases/latest").body()
|
||||
client.close()
|
||||
println(response.assets.toString())
|
||||
val json = Json {
|
||||
ignoreUnknownKeys = true
|
||||
}
|
||||
val releaseInfos = json.decodeFromString<Array<Updater.ReleaseInfo>>(response.assets.toString())
|
||||
for (releaseInfo in releaseInfos) {
|
||||
println(releaseInfo.toString())
|
||||
}
|
||||
// Replace this if versioning ever changes
|
||||
val githubVersionArr = response.tag_name.replace("v", "").split(".")
|
||||
val localVersionArr = VERSION.replace("v", "").split(".")
|
||||
// Cursed?
|
||||
return if (githubVersionArr[0] > localVersionArr[0]) {
|
||||
true
|
||||
} else if (githubVersionArr[0] < localVersionArr[0] && githubVersionArr[1] > localVersionArr[1]) {
|
||||
true
|
||||
} else if (githubVersionArr[0] < localVersionArr[0] && githubVersionArr[1] < localVersionArr[1] && githubVersionArr[2] > localVersionArr[2]) {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
println("Error getting github release info: ${e.message}")
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
import java.nio.file.Paths
|
||||
|
||||
class Windows {
|
||||
|
||||
val sendMainProgress: (Int) -> Unit = { progress -> updaterGui.mainProgressBar.setProgress(progress) }
|
||||
val path = Paths.get("").toAbsolutePath().toString()
|
||||
|
||||
suspend fun updateWindows() {
|
||||
// First check if everything is already installed. Install it if it isn't
|
||||
usbDrivers()
|
||||
steamVRDriver()
|
||||
feeder()
|
||||
}
|
||||
|
||||
fun usbDrivers() {
|
||||
//mainProgressBar.string = "Updating usb drivers"
|
||||
updaterGui.subLabel.text = "Checking Windows Drivers"
|
||||
val installedDriversList =
|
||||
executeShellCommand("powershell.exe", "pnputil /enum-drivers")
|
||||
val ch341ser = installedDriversList.contains("ch341ser.inf")
|
||||
val ch343ser = installedDriversList.contains("ch343ser.inf")
|
||||
val silabser = installedDriversList.contains("silabser.inf")
|
||||
|
||||
if (ch341ser && ch343ser && silabser) {
|
||||
println("drivers already installed!")
|
||||
return
|
||||
}
|
||||
|
||||
println("Cannot find one of the drivers, installing drivers")
|
||||
val driverinstallOutput = executeShellCommand("$path\\installusbdrivers.bat")
|
||||
println(driverinstallOutput)
|
||||
sendMainProgress(33)
|
||||
}
|
||||
|
||||
|
||||
suspend fun feeder() {
|
||||
updaterGui.subLabel.text = "Downloading Feeder App"
|
||||
downloadFile(WINDOWSFEEDERURL, WINDOWSFEEDERNAME)
|
||||
updaterGui.subLabel.text = "Unzipping Feeder App"
|
||||
unzip(WINDOWSFEEDERNAME, WINDOWSFEEDERDIRECTORY)
|
||||
updaterGui.subLabel.text = "Registering Feeder App"
|
||||
executeShellCommand("${path}\\${WINDOWSFEEDERDIRECTORY}\\SlimeVR-Feeder-App.exe", "--install")
|
||||
sendMainProgress(100)
|
||||
updaterGui.subLabel.text = "Feeder App Done"
|
||||
}
|
||||
|
||||
suspend fun steamVRDriver() {
|
||||
updaterGui.subLabel.text = "Updating SteamVR Driver"
|
||||
val steamVRLocation = executeShellCommand("powershell.exe", "-Command", "(Get-ItemProperty \'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 250820\').InstallLocation").trim()
|
||||
if (!steamVRLocation.contains("SteamVR")) {
|
||||
println("SteamVR not installed, cannot install SlimeVR Steam driver.")
|
||||
return
|
||||
}
|
||||
val vrPathRegContents = executeShellCommand("${steamVRLocation}\\bin\\win64\\vrpathreg.exe", "finddriver", "slimevr")
|
||||
val isDriverRegistered = vrPathRegContents.contains("WINDOWSSTEAMVRDRIVERDIRECTORY")
|
||||
if (isDriverRegistered) {
|
||||
println("steamVR driver is already registered. Skipping...")
|
||||
return
|
||||
}
|
||||
updaterGui.subLabel.text = "Downloading SteamVR Driver"
|
||||
downloadFile(WINDOWSSTEAMVRDRIVERURL, WINDOWSSTEAMVRDRIVERNAME)
|
||||
updaterGui.subLabel.text = "Unzipping SteamVR Driver"
|
||||
unzip(WINDOWSSTEAMVRDRIVERNAME, WINDOWSSTEAMVRDRIVERDIRECTORY)
|
||||
executeShellCommand(
|
||||
"${steamVRLocation}\\bin\\win64\\vrpathreg.exe",
|
||||
"adddriver",
|
||||
"${
|
||||
Paths.get(
|
||||
"",
|
||||
).toAbsolutePath()
|
||||
}\\${WINDOWSSTEAMVRDRIVERDIRECTORY}\\slimevr",
|
||||
)
|
||||
updaterGui.subLabel.text = "SteamVR Driver done"
|
||||
sendMainProgress(66)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val WINDOWSSTEAMVRDRIVERURL = "https://github.com/SlimeVR/SlimeVR-OpenVR-Driver/releases/latest/download/slimevr-openvr-driver-win64.zip"
|
||||
private const val WINDOWSSTEAMVRDRIVERNAME = "slimevr-openvr-driver-win64.zip"
|
||||
private const val WINDOWSSTEAMVRDRIVERDIRECTORY = "slimevr-openvr-driver-win64"
|
||||
private const val WINDOWSFEEDERURL = "https://github.com/SlimeVR/SlimeVR-Feeder-App/releases/latest/download/SlimeVR-Feeder-App-win64.zip"
|
||||
private const val WINDOWSFEEDERNAME = "SlimeVR-Feeder-App-win64.zip"
|
||||
private const val WINDOWSFEEDERDIRECTORY = "SlimeVR-Feeder-App-win64"
|
||||
private const val WINDOWSSERVERURL = "https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-win64.zip"
|
||||
private const val WINDOWSSERVERNAME = "slimevr-win64.zip"
|
||||
private const val WINDOWSSERVERDIRECTORY = "slimevr-win64"
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package dev.slimevr.updater
|
||||
|
||||
import dev.slimevr.updater.ManifestUtils.Companion.getRelease
|
||||
import dev.slimevr.updater.ManifestUtils.Companion.listChannels
|
||||
import dev.slimevr.updater.ManifestUtils.Companion.listVersions
|
||||
import kotlin.test.Test
|
||||
|
||||
class UpdaterTest {
|
||||
|
||||
@Test
|
||||
fun testArguments() {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testUpdater() {
|
||||
val updater = Updater()
|
||||
updater.runUpdater()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testDownload() {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testListVersions() {
|
||||
val manifest = Manifest().getManifest()
|
||||
listVersions(manifest, "stable")
|
||||
println("/------------------------------------------")
|
||||
listVersions(manifest, "beta")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testListChannels() {
|
||||
val manifest = Manifest().getManifest()
|
||||
listChannels(manifest)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testGetLatestWindowsRelease() {
|
||||
val manifest = Manifest().getManifest()
|
||||
val release = getRelease(manifest, "stable", "v19.0.0", "windows", "x86_64")
|
||||
println(release?.url)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun downgrade() {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
fun updateToSpecificVersion() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,401 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="23">
|
||||
<profile kind="CodeFormatterProfile" name="Spotless" version="23">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_if_empty"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_if_empty"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_switch_case_arrow_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_if_empty"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_permitted_types" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_permitted_types_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_switch_body_block_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_arrow" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_if_empty"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_switch_case_with_arrow_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_colon" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_if_empty"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_switch_case_with_arrow" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_if_empty"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="separate_lines_if_wrapped"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_permitted_types" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.javaFormatter" value="org.eclipse.jdt.core.defaultJavaFormatter"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="100"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
Reference in new issue
Block a user