From da29242cf493adf5a02fba8ea794e95bc2831da2 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Thu, 19 Dec 2024 10:38:07 +0100 Subject: [PATCH] Move contribution url into centralised place Using the work by @mingness to simplify the contributions workflow. Disabled the post request because that data is not saved anywhere and most hosts do not support it --- app/build.gradle.kts | 1 + app/src/processing/app/contrib/ContributionListing.java | 2 +- app/src/processing/app/contrib/ContributionManager.java | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 70a352cd5..41a705672 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,6 +17,7 @@ group = rootProject.group tasks.withType { systemProperty("processing.version", version) systemProperty("processing.revision", "1296") + systemProperty("processing.contributions.source", "https://contributions-preview.processing.org/contribs.txt") } diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index fb1bc6a29..0c9945526 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -44,7 +44,7 @@ public class ContributionListing { * Stable URL that will redirect to wherever the file is hosted. * Changed to use https in 4.0 beta 8 (returns same data). */ - static final String LISTING_URL = "https://download.processing.org/contribs"; + static final String LISTING_URL = System.getProperty("processing.contributions.source","https://download.processing.org/contribs"); static final String LOCAL_FILENAME = "contribs.txt"; /** Location of the listing file on disk, will be read and written. */ diff --git a/app/src/processing/app/contrib/ContributionManager.java b/app/src/processing/app/contrib/ContributionManager.java index 117c9e717..c4d45f7d7 100644 --- a/app/src/processing/app/contrib/ContributionManager.java +++ b/app/src/processing/app/contrib/ContributionManager.java @@ -67,10 +67,10 @@ public class ContributionManager { conn.setConnectTimeout(15 * 1000); conn.setReadTimeout(60 * 1000); - if (post == null) { + // Disable the post for now, since it's not used + if (post == null || System.getProperty("processing.contributions.source") != null) { conn.setRequestMethod("GET"); conn.connect(); - } else { post = Util.gzipEncode(post); conn.setRequestMethod("POST");