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
This commit is contained in:
Stef Tervelde
2024-12-19 10:38:07 +01:00
parent 2fc0d69a4c
commit da29242cf4
3 changed files with 4 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ group = rootProject.group
tasks.withType<JavaExec> {
systemProperty("processing.version", version)
systemProperty("processing.revision", "1296")
systemProperty("processing.contributions.source", "https://contributions-preview.processing.org/contribs.txt")
}

View File

@@ -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. */

View File

@@ -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");