diff --git a/.editorconfig b/.editorconfig index dd73d98b..b381fcd8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,3 +8,9 @@ indent_style = space indent_size = 4 trim_trailing_whitespace = true max_line_length = 120 + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.github/workflows/application.yml b/.github/workflows/application.yml index 2c7f0a78..610e0a9e 100644 --- a/.github/workflows/application.yml +++ b/.github/workflows/application.yml @@ -15,9 +15,9 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 8 - cache: 'gradle' + cache: "gradle" - name: Check license headers run: ./gradlew checkLicenses @@ -27,7 +27,7 @@ jobs: strategy: matrix: java-version: ["8", "11", "17", "19"] # LTS + Latest - os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] name: Java ${{ matrix.java-version }} (${{ matrix.os }}) Tests steps: - uses: actions/checkout@v3 @@ -35,15 +35,15 @@ jobs: - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: ${{ matrix.java-version }} - cache: 'gradle' + cache: "gradle" - name: Run Unit Tests run: ./gradlew --no-daemon test --tests com.atlauncher.* - name: Run UI Tests - uses: GabrielBB/xvfb-action@v1 + uses: coactions/setup-xvfb@v1 if: matrix.os != 'macos-latest' # skipped on OSX as not working and no way to test fixes continue-on-error: ${{ matrix.os == 'windows-latest' }} # Windows seems flaky with: @@ -60,9 +60,9 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 8 - cache: 'gradle' + cache: "gradle" - name: Read version id: version @@ -77,7 +77,7 @@ jobs: with: string: ${{ steps.version.outputs.text }} pattern: '([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\.?\w*' - replace-with: '$1' + replace-with: "$1" - name: Build run: ./gradlew build -x test @@ -111,7 +111,7 @@ jobs: with: string: ${{ steps.changelog.outputs.text }} pattern: '^.*?(### (New Features|Fixes|Misc)\n.*)$' - replace-with: '$1' + replace-with: "$1" flags: gs - name: Clean up the changelog to only have used sections @@ -190,12 +190,12 @@ jobs: - name: Commit new version/CHANGELOG file uses: EndBug/add-and-commit@v7.0.0 with: - add: 'CHANGELOG.md src/main/resources/version' - message: 'chore: bump version' + add: "CHANGELOG.md src/main/resources/version" + message: "chore: bump version" - name: Add comment, remove label and then close issues labeled with 'awaiting-release' uses: ./.github/actions/label-cleanup with: - label: 'awaiting-release' - comment: 'This has been fixed with version ${{ needs.build.outputs.clean-version }}' + label: "awaiting-release" + comment: "This has been fixed with version ${{ needs.build.outputs.clean-version }}" token: ${{ secrets.BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/aur-publish.yml b/.github/workflows/aur-publish.yml index 045c3bdd..0a1b46c6 100644 --- a/.github/workflows/aur-publish.yml +++ b/.github/workflows/aur-publish.yml @@ -35,5 +35,5 @@ jobs: - name: Commit changed files uses: EndBug/add-and-commit@v7.0.0 with: - add: 'packaging/aur/' - message: 'chore: update aur packages' + add: "packaging/aur/" + message: "chore: update aur packages" diff --git a/.vscode/settings.json b/.vscode/settings.json index 1e72b90a..aba91d18 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,6 +9,9 @@ "source.organizeImports": true } }, + "[github-actions-workflow]": { + "editor.tabSize": 2 + }, "editor.formatOnSave": true, "better-comments.tags": [ { @@ -30,4 +33,4 @@ "java.codeGeneration.generateComments": true, "git.inputValidationLength": 100, "java.compile.nullAnalysis.mode": "automatic", -} +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a47f9de..203aaf0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,4 +15,5 @@ This changelog only contains the changes that are unreleased. For changes for in ### Misc - Upgrade to Gradle 8.2 -- Update dependency versions \ No newline at end of file +- Update dependency versions +- Fix ui tests failing constantly \ No newline at end of file diff --git a/src/main/java/com/atlauncher/App.java b/src/main/java/com/atlauncher/App.java index 1d13c721..e85ba965 100644 --- a/src/main/java/com/atlauncher/App.java +++ b/src/main/java/com/atlauncher/App.java @@ -178,6 +178,13 @@ public class App { */ public static Path workingDir = null; + /** + * This will tell the launcher to disable HTTP2 connections. + *
+ * --disable-http2 + */ + public static boolean disableHttp2 = false; + /** * This will tell the launcher to allow all SSL certs regardless of validity. * This is insecure and only intended for development purposes. @@ -877,6 +884,9 @@ public class App { parser.accepts("base-cdn-domain", "The base CDN domain.").withRequiredArg().ofType(String.class); parser.accepts("base-cdn-path", "The path on the CDN used for downloading files.").withRequiredArg() .ofType(String.class); + parser.accepts("disable-http2", + "This will tell the launcher to disable HTTP2 connections.") + .withOptionalArg().ofType(Boolean.class); parser.accepts("allow-all-ssl-certs", "This will tell the launcher to allow all SSL certs regardless of validity. This is insecure and only intended for development purposes.") .withOptionalArg().ofType(Boolean.class); @@ -978,6 +988,8 @@ public class App { LogManager.warn("Base cdn path set to " + baseCdnPath); } + disableHttp2 = options.has("disable-http2"); + allowAllSslCerts = options.has("allow-all-ssl-certs"); if (allowAllSslCerts) { LogManager.warn("Allowing all ssl certs. This is insecure and should only be used for development."); diff --git a/src/main/java/com/atlauncher/Network.java b/src/main/java/com/atlauncher/Network.java index 18a5691d..914065ae 100644 --- a/src/main/java/com/atlauncher/Network.java +++ b/src/main/java/com/atlauncher/Network.java @@ -52,7 +52,8 @@ import okhttp3.tls.HandshakeCertificates; public final class Network { public static Cache CACHE = new Cache(FileSystem.CACHE.toFile(), 100 * 1024 * 1024); // 100MB cache - private static List