File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
java/src/processing/mode/java Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -887,10 +887,25 @@ private boolean isReferenceDownloaded() {
887
887
}
888
888
*/
889
889
890
+ private String getReferenceDownloadUrl () {
891
+ String versionName = Base .getVersionName ();
892
+ int revisionInt = Base .getRevision ();
893
+ String revision = String .valueOf (revisionInt );
894
+
895
+ if ("unspecified" .equals (versionName ) || revisionInt == Integer .MAX_VALUE ) {
896
+ return "https://github.com/processing/processing4/releases/download/processing-1300-4.4.0/processing-4.4.0-reference.zip" ;
897
+ }
898
+
899
+ String url = String .format (
900
+ "https://github.com/processing/processing4/releases/download/processing-%s-%s/processing-%s-reference.zip" ,
901
+ revision , versionName , versionName );
902
+ System .out .println ("Generated URL: " + url );
903
+ return url ;
904
+ }
890
905
891
906
private void downloadReference () {
892
907
try {
893
- URL source = new URL (REFERENCE_URL_2 );
908
+ URL source = new URL (getReferenceDownloadUrl () );
894
909
HttpURLConnection conn = (HttpURLConnection ) source .openConnection ();
895
910
HttpURLConnection .setFollowRedirects (true );
896
911
conn .setConnectTimeout (15 * 1000 );
You can’t perform that action at this time.
0 commit comments