diff --git a/build/build.xml b/build/build.xml index c0ff1817f..e8893b1a2 100644 --- a/build/build.xml +++ b/build/build.xml @@ -354,9 +354,6 @@ - - - @@ -366,13 +363,12 @@ - @@ -380,17 +376,14 @@ - - @@ -694,16 +687,7 @@ - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1485,16 +1445,7 @@ src="${jdk.tgz.path}" overwrite="false" /> - - - - - - - - - - + diff --git a/build/jre/build.xml b/build/jre/build.xml index f39ed41a1..3cf363e3a 100644 --- a/build/jre/build.xml +++ b/build/jre/build.xml @@ -35,15 +35,14 @@ - + - - + diff --git a/build/jre/src/AdoptOpenJdkDownloadUrlGenerator.java b/build/jre/src/AdoptOpenJdkDownloadUrlGenerator.java deleted file mode 100644 index 92b40e1b6..000000000 --- a/build/jre/src/AdoptOpenJdkDownloadUrlGenerator.java +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2019-20 The Processing Foundation - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/** - * Utility to generate download URLs from AdoptOpenJDK. - */ -public class AdoptOpenJdkDownloadUrlGenerator extends DownloadUrlGenerator { - static private final String BASE_URL = - "https://github.com/AdoptOpenJDK/openjdk%d-binaries/releases/download/jdk-%d.%d.%d%%2B%d/OpenJDK%dU-%s_%d.%d.%d_%d.%s"; - - - @Override - public String buildUrl(String platform, String component, - int train, int version, int update, - int build, String flavor) { - - if (!component.equalsIgnoreCase("jdk")) { - throw new RuntimeException("Can only generate JDK download URLs for AdoptOpenJDK."); - } - - String filename = buildDownloadRemoteFilename(platform); - String fileExtension = buildFileExtension(platform); - return String.format( - BASE_URL, - train, - train, - version, - update, - build, - train, - filename, - train, - version, - update, - build, - fileExtension - ); - } - - - /** - * Build a the filename (the "flavor") that is expected on AdoptOpenJDK. - * - * @param downloadPlatform The platform for which the download URL is being generated like - * "macos" or "linux64". - * @return The artifact name without extension like "jdk_x64_mac_hotspot". - */ - private String buildDownloadRemoteFilename(String downloadPlatform) { - switch (downloadPlatform.toLowerCase()) { - case "windows32": return "jdk_x86-32_windows_hotspot"; - case "windows64": return "jdk_x64_windows_hotspot"; - case "macosx64": return "jdk_x64_mac_hotspot"; - case "linux32": throw new RuntimeException("Linux32 not supported by AdoptOpenJDK."); - case "linux64": return "jdk_x64_linux_hotspot"; - case "linuxarm": return "jdk_aarch64_linux_hotspot"; - default: throw new RuntimeException("Unknown platform: " + downloadPlatform); - } - } - - - /** - * Determine the download file extension. - * - * @param downloadPlatform The platform for which the download URL is being generated like - * "macos" or "linux64". - * @return The file extension without leading period like "zip" or "tar.gz". - */ - private String buildFileExtension(String downloadPlatform) { - return downloadPlatform.startsWith("windows") ? "zip" : "tar.gz"; - } -} diff --git a/build/jre/src/DownloadItem.java b/build/jre/src/DownloadItem.java deleted file mode 100644 index 30e716f43..000000000 --- a/build/jre/src/DownloadItem.java +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2014-19 The Processing Foundation - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -import java.util.Optional; - - -/** - * Data structure describing an item to be downloaded as part the Processing build. - */ -public class DownloadItem { - - private String url; - private String localPath; - private Optional cookie; - - /** - * Create a new download item. - * - * @param newUrl The remote URL at which the download can be found (via GET). - * @param newLocalPath The local path to which the file should be written. - * @param newCookie Optional cookie that, if present, should be given to the server along with the - * GET request for the download contents. - */ - public DownloadItem(String newUrl, String newLocalPath, Optional newCookie) { - url = newUrl; - localPath = newLocalPath; - cookie = newCookie; - } - - /** - * Determine where the download can be requested. - * - * @return The remote URL at which the download can be found (via GET). - */ - public String getUrl() { - return url; - } - - /** - * Determine to where the download should be saved. - * - * @return The local path to which the file should be written. - */ - public String getLocalPath() { - return localPath; - } - - /** - * Determine if and what cookie should be given as part of the download request. - * - * @return Optional cookie that, if present, should be given to the server along with the - * GET request for the download contents. Should be ignored otherwise. - */ - public Optional getCookie() { - return cookie; - } - - -} diff --git a/build/jre/src/DownloadUrlGenerator.java b/build/jre/src/DownloadUrlGenerator.java deleted file mode 100644 index 08e3541d1..000000000 --- a/build/jre/src/DownloadUrlGenerator.java +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2014-19 The Processing Foundation - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - - -import java.util.Optional; - -/** - * Abstract base class for strategy to generate download URLs. - */ -public abstract class DownloadUrlGenerator { - - /** - * Determine the URL at which the artifact can be downloaded. - * - * @param platform The platform for which the download URL is being generated like "macos" or - * "linux64". - * @param component The component to download like "JDK", "JRE", or "JFX". - * @param train The JDK train (like 1 or 11). - * @param version The JDK version (like 8 or 1). - * @param update The update (like 13). - * @param build The build number (like 133). - * @param flavor The flavor like "macosx-x64.dmg". - * @param hash The hash like "d54c1d3a095b4ff2b6607d096fa80163". - */ - public abstract String buildUrl(String platform, String component, - int train, int version, int update, - int build, String flavor); - - /** - * Get the cookie that should be used in downloading the target component. - * - * @return Optional that is empty if no cookie should be used or optional with the string cookie - * value if one should be used. - */ - public Optional getCookie() { - return Optional.empty(); - } - - /** - * Determine the name of the file to which the remote file should be saved. - * - * @param downloadPlatform The platform for which the download URL is being generated like - * "macos" or "linux64". - * @param component The component to download like "JDK", "JRE", or "JFX". - * @param train The JDK train (like 1 or 11). - * @param version The JDK version (like 8 or 1). - * @param update The update (like 13). - * @param build The build number (like 133). - * @param flavor The flavor like "macosx-x64.dmg". - */ - public String getLocalFilename(String downloadPlatform, String component, - int train, int version, int update, - int build, String flavor) { - - String baseFilename = component.toLowerCase(); - - String versionStr; - if (update == 0) { - versionStr = String.format("-%d-%s", version, flavor); - } else { - versionStr = String.format("-%du%d-%s", version, update, flavor); - } - - return baseFilename + versionStr; - } - -} diff --git a/build/jre/src/Downloader.java b/build/jre/src/Downloader.java index 575faa824..546229b78 100644 --- a/build/jre/src/Downloader.java +++ b/build/jre/src/Downloader.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2014-19 The Processing Foundation + Copyright (c) 2014-20 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -31,32 +31,27 @@ import org.apache.tools.ant.Task; * Ant Task for downloading the latest JRE, JDK, or OpenJFX release. */ public class Downloader extends Task { - private static final boolean PRINT_LOGGING = true; - private String platform; // macos private int train; // Java 11 (was 1 through Java 8) private int version; // 0 (was 8 prior to Java 9) private int update; // Update 131 private int build; // Build 11 - private String component; // "jre", "jdk", or "jfx" + private String component; // "jdk" or "jfx" private String flavor; // Like "zip" private String path; // target path - /** - * Create a new downloader without tag attributes filled in. - **/ public Downloader() { } /** * Set the platform being used. * - * @param platform The platfom for which files are being downloaded like macosx. + * @param platform The platform for which files are being downloaded like macosx. */ public void setPlatform(String platform) { - this.platform = platform; + this.platform = platform.toLowerCase(); } @@ -103,10 +98,10 @@ public class Downloader extends Task { /** * Indicate what component or release type of Java is being downloaded. * - * @param component The component to download like "JDK", "JRE", or "OpenJFX". + * @param component The component to download like "jdk" or "jfx" */ public void setComponent(String component) { - this.component = component; + this.component = component.toLowerCase(); } @@ -131,7 +126,7 @@ public class Downloader extends Task { /** - * Download the JDK or JRE. + * Entry point called by Ant */ public void execute() throws BuildException { if (train == 0) { @@ -139,8 +134,7 @@ public class Downloader extends Task { throw new BuildException("Train (i.e. 1 or 11) must be set"); } - boolean isJava11 = train == 11; - if (!isJava11 && version == 0) { + if (train != 11 && version == 0) { throw new BuildException("Version (i.e. 7 or 8) must be set"); } @@ -164,58 +158,54 @@ public class Downloader extends Task { * Download the package from AdoptOpenJDK or Oracle. */ void download() throws IOException { - DownloadItem downloadItem; - - // Determine url generator for task - Optional downloadItemMaybe = getDownloadItem(); - if (downloadItemMaybe.isEmpty()) { - return; // There is nothing to do. - } else { - downloadItem = downloadItemMaybe.get(); - } - - // Build URL and path if (path == null) { - path = downloadItem.getLocalPath(); + path = getLocalFilename(component, version, update, flavor); } - String url = downloadItem.getUrl(); - - // Downlaod - println("Attempting download at " + url); + String url = null; + if (component.equals("jdk")) { + url = adoptOpenJdkUrl(platform, component, train, version, update, build, flavor); + } else if (component.equals("jfx")) { + url = gluonHqUrl(platform, component, train, version, update); + } else { + throw new RuntimeException("Do not know how to download: " + component); + } + System.out.println("Downloading from " + url); HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); + /* Optional cookieMaybe = downloadItem.getCookie(); if (cookieMaybe.isPresent()) { conn.setRequestProperty("Cookie", cookieMaybe.get()); } + */ - //printHeaders(conn); - //conn.connect(); while (conn.getResponseCode() == 302 || conn.getResponseCode() == 301) { Map> headers = conn.getHeaderFields(); List location = headers.get("Location"); - if (location.size() == 1) { + if (location.size() > 0) { url = location.get(0); - println("Redirecting to " + url); + System.out.println("Redirecting to " + url); } else { - throw new BuildException("Got " + location.size() + " locations."); + // TODO should this just do one of the + throw new BuildException("No redirect location provided"); } - List cookies = headers.get("Set-Cookie"); conn = (HttpURLConnection) new URL(url).openConnection(); + /* + List cookies = headers.get("Set-Cookie"); if (cookies != null) { for (String cookie : cookies) { + System.out.println("Setting cookie " + cookie); conn.setRequestProperty("Cookie", cookie); } } - if (cookieMaybe.isPresent()) { conn.setRequestProperty("Cookie", cookieMaybe.get()); } - + */ conn.connect(); } @@ -224,8 +214,8 @@ public class Downloader extends Task { BufferedInputStream bis = new BufferedInputStream(input); File outputFile = new File(path); //folder, filename); - String msg = String.format("Downloading %s from %s%n", outputFile.getAbsolutePath(), url); - println(msg); + System.out.format("Downloading %s from %s%n", + outputFile.getAbsolutePath(), url); // Write to a temp file so that we don't have an incomplete download // masquerading as a good archive. @@ -243,7 +233,8 @@ public class Downloader extends Task { if (outputFile.exists()) { if (!outputFile.delete()) { - throw new BuildException("Could not delete old download: " + outputFile.getAbsolutePath()); + throw new BuildException("Could not delete old download: " + + outputFile.getAbsolutePath()); } } if (!tempFile.renameTo(outputFile)) { @@ -257,97 +248,97 @@ public class Downloader extends Task { } } + + static private String adoptOpenJdkUrl(String platform, String component, + int train, int version, int update, + int build, String flavor) { + final String URL_FORMAT = "https://github.com/AdoptOpenJDK/openjdk%d-binaries/releases/download/jdk-%d.%d.%d%%2B%d/OpenJDK%dU-%s_%d.%d.%d_%d.%s"; + + String filename = null; + switch (platform) { + case "windows32": filename = "jdk_x86-32_windows_hotspot"; break; + case "windows64": filename = "jdk_x64_windows_hotspot"; break; + case "macosx64": filename = "jdk_x64_mac_hotspot"; break; + case "linux32": throw new RuntimeException("32-bit Linux not supported by AdoptOpenJDK."); + case "linux64": filename = "jdk_x64_linux_hotspot"; break; + case "linuxarm": filename = "jdk_aarch64_linux_hotspot"; break; + default: throw new RuntimeException("Unknown platform: " + platform); + } + + String fileExtension = platform.startsWith("windows") ? "zip" : "tar.gz"; + + return String.format( + URL_FORMAT, + train, + train, + version, + update, + build, + train, + filename, + train, + version, + update, + build, + fileExtension + ); + } + + + static private String gluonHqUrl(String platform, String component, + int train, int version, int update) { + final String URL_FORMAT = + "https://gluonhq.com/download/javafx-%d-%d-%d-sdk-%s/"; + + String platformShort; + if (platform.contains("linux")) { + platformShort = "linux"; + } else if (platform.contains("mac")) { + platformShort = "mac"; + } else if (platform.contains("windows")) { + platformShort = "windows"; + } else { + throw new RuntimeException("Unsupported platform for JFX: " + platform); + } + return String.format(URL_FORMAT, train, version, update, platformShort); + } + + /** - * Print the headers used for {URLConnection}. + * Determine the name of the file to which the remote file should be saved. + * + * @param downloadPlatform The platform for which the download URL is being generated like + * "macos" or "linux64". + * @param component The component to download like "JDK", "JRE", or "JFX". + * @param train The JDK train (like 1 or 11). + * @param version The JDK version (like 8 or 1). + * @param update The update (like 13). + * @param build The build number (like 133). + * @param flavor The flavor like "macosx-x64.dmg". */ - static void printHeaders(URLConnection conn) { + static private String getLocalFilename(String component, int version, + int update, String flavor) { + String versionStr; + if (update == 0) { + versionStr = String.format("-%d-%s", version, flavor); + } else { + versionStr = String.format("-%du%d-%s", version, update, flavor); + } + return component + versionStr; + } + + + static private void printHeaders(URLConnection conn) { Map> headers = conn.getHeaderFields(); Set>> entrySet = headers.entrySet(); for (Map.Entry> entry : entrySet) { String headerName = entry.getKey(); - println("Header Name:" + headerName); + System.err.println("Header Name:" + headerName); List headerValues = entry.getValue(); for (String value : headerValues) { - print("Header value:" + value); + System.err.println("Header Value:" + value); } - printEmptyLine(); - printEmptyLine(); + System.err.println(); } } - - /** - * Get the item to be downloaded for this task. - * - * @return The to be downloaded or empty if there is no download required. - */ - private Optional getDownloadItem() { - // Determine download type - boolean isJavaDownload = component.equalsIgnoreCase("jdk"); - isJavaDownload = isJavaDownload || component.equalsIgnoreCase("jre"); - - boolean isJfxDownload = component.equalsIgnoreCase("jfx"); - - DownloadUrlGenerator downloadUrlGenerator; - - // Determine url generator - if (isJavaDownload) { - downloadUrlGenerator = new AdoptOpenJdkDownloadUrlGenerator(); - } else if (isJfxDownload) { - downloadUrlGenerator = new GluonHqDownloadUrlGenerator(); - } else { - throw new RuntimeException("Do not know how to download: " + component); - } - - // Build download item - String path = downloadUrlGenerator.getLocalFilename( - platform, - component, - train, - version, - update, - build, - flavor - ); - - String url = downloadUrlGenerator.buildUrl( - platform, - component, - train, - version, - update, - build, - flavor - ); - - return Optional.of(new DownloadItem(url, path, downloadUrlGenerator.getCookie())); - } - - /** - * Print a line out to console if logging is enabled. - * - * @param message The message to be printed. - */ - private static void println(String message) { - if (PRINT_LOGGING) { - System.out.println(message); - } - } - - /** - * Print a line out to console if logging is enabled without a newline. - * - * @param message The message to be printed. - */ - private static void print(String message) { - if (PRINT_LOGGING) { - System.out.print(message); - } - } - - /** - * Print an empty line to the system.out. - */ - private static void printEmptyLine() { - println(""); - } } diff --git a/build/jre/src/GluonHqDownloadUrlGenerator.java b/build/jre/src/GluonHqDownloadUrlGenerator.java deleted file mode 100644 index 77ef62677..000000000 --- a/build/jre/src/GluonHqDownloadUrlGenerator.java +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2014-20 The Processing Foundation - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - - -/** - * URL generator for downloading JFX directly from OpenJFX's sponsor Gluon. - */ -public class GluonHqDownloadUrlGenerator extends DownloadUrlGenerator { - - private static final String TEMPLATE_URL = "http://gluonhq.com/download/javafx-%d-%d-%d-sdk-%s/"; - - @Override - public String buildUrl(String platform, String component, int train, int version, int update, - int build, String flavor) { - - String platformLower = platform.toLowerCase(); - - String platformShort; - if (platformLower.contains("linux")) { - platformShort = "linux"; - } else if (platformLower.contains("mac")) { - platformShort = "mac"; - } else if (platformLower.contains("windows")) { - platformShort = "windows"; - } else { - throw new RuntimeException("Unsupported platform for JFX: " + platform); - } - - return String.format(TEMPLATE_URL, train, version, update, platformShort); - } - -} diff --git a/build/jre/test/AdoptOpenJdkDownloadUrlGeneratorTest.java b/build/jre/test/AdoptOpenJdkDownloadUrlGeneratorTest.java deleted file mode 100644 index 4a07fa990..000000000 --- a/build/jre/test/AdoptOpenJdkDownloadUrlGeneratorTest.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-19 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - - -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class AdoptOpenJdkDownloadUrlGeneratorTest { - - private static final String EXPECTED_WIN64_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_windows_hotspot_11.0.1_13.zip"; - private static final String EXPECTED_MAC_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_mac_hotspot_11.0.1_13.tar.gz"; - private static final String EXPECTED_LINUX_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_linux_hotspot_11.0.1_13.tar.gz"; - private static final String EXPECTED_LINUX_URL_ARM = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.1_13.tar.gz"; - - private static final String COMPONENT = "jdk"; - private static final int TRAIN = 11; - private static final int VERSION = 0; - private static final int UPDATE = 1; - private static final int BUILD = 13; - private static final String FLAVOR_SUFFIX = "-x64.tar.gz"; - private static final String HASH = ""; - - private AdoptOpenJdkDownloadUrlGenerator urlGenerator; - - @Before - public void setUp() throws Exception { - urlGenerator = new AdoptOpenJdkDownloadUrlGenerator(); - } - - @Test - public void testBuildUrlWindows() { - String url = urlGenerator.buildUrl( - "windows64", - COMPONENT, - TRAIN, - VERSION, - UPDATE, - BUILD, - "windows" + FLAVOR_SUFFIX, - HASH - ); - - assertEquals( - EXPECTED_WIN64_URL, - url - ); - } - - @Test - public void testBuildUrlMac() { - String url = urlGenerator.buildUrl( - "macosx64", - COMPONENT, - TRAIN, - VERSION, - UPDATE, - BUILD, - "mac" + FLAVOR_SUFFIX, - HASH - ); - - assertEquals( - EXPECTED_MAC_URL, - url - ); - } - - @Test - public void testBuildUrlLinux64() { - String url = urlGenerator.buildUrl( - "linux64", - COMPONENT, - TRAIN, - VERSION, - UPDATE, - BUILD, - "linux64" + FLAVOR_SUFFIX, - HASH - ); - - assertEquals( - EXPECTED_LINUX_URL, - url - ); - } - - @Test - public void testBuildUrlLinuxArm() { - String url = urlGenerator.buildUrl( - "linuxArm", - COMPONENT, - TRAIN, - VERSION, - UPDATE, - BUILD, - "linuxArm" + FLAVOR_SUFFIX, - HASH - ); - - assertEquals( - EXPECTED_LINUX_URL_ARM, - url - ); - } - -} diff --git a/build/jre/test/GluonHqDownloadUrlGeneratorTest.java b/build/jre/test/GluonHqDownloadUrlGeneratorTest.java deleted file mode 100644 index 0f1ca2faa..000000000 --- a/build/jre/test/GluonHqDownloadUrlGeneratorTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-19 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - - -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class GluonHqDownloadUrlGeneratorTest { - - private static final String EXPECTED_WIN64_URL = "http://gluonhq.com/download/javafx-11-0-2-sdk-windows/"; - private static final String EXPECTED_MAC_URL = "http://gluonhq.com/download/javafx-11-0-2-sdk-mac"; - private static final String EXPECTED_LINUX_URL = "http://gluonhq.com/download/javafx-11-0-2-sdk-linux/"; - - private static final String COMPONENT = "jfx"; - private static final int TRAIN = 11; - private static final int VERSION = 0; - private static final int UPDATE = 2; - private static final int BUILD = 0; - private static final String FLAVOR_SUFFIX = ".zip"; - private static final String HASH = ""; - - private AdoptOpenJdkDownloadUrlGenerator urlGenerator; - - @Before - public void setUp() throws Exception { - urlGenerator = new AdoptOpenJdkDownloadUrlGenerator(); - } - - @Test - public void testBuildUrlWindows() { - String url = urlGenerator.buildUrl( - "windows64", - COMPONENT, - TRAIN, - VERSION, - UPDATE, - BUILD, - "windows" + FLAVOR_SUFFIX, - HASH - ); - - assertEquals( - EXPECTED_WIN64_URL, - url - ); - } - - @Test - public void testBuildUrlMac() { - String url = urlGenerator.buildUrl( - "macosx64", - COMPONENT, - TRAIN, - VERSION, - UPDATE, - BUILD, - "mac" + FLAVOR_SUFFIX, - HASH - ); - - assertEquals( - EXPECTED_MAC_URL, - url - ); - } - - @Test - public void testBuildUrlLinux() { - String url = urlGenerator.buildUrl( - "linux64", - COMPONENT, - TRAIN, - VERSION, - UPDATE, - BUILD, - "linux64" + FLAVOR_SUFFIX, - HASH - ); - - assertEquals( - EXPECTED_LINUX_URL, - url - ); - } - -} diff --git a/build/jre/test/OracleDownloadUrlGeneratorTest.java b/build/jre/test/OracleDownloadUrlGeneratorTest.java deleted file mode 100644 index 2124c210f..000000000 --- a/build/jre/test/OracleDownloadUrlGeneratorTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-19 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; -import static org.junit.Assert.assertEquals; - -public class OracleDownloadUrlGeneratorTest { - - private static final String EXPECTED_URL = "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-macosx-x64.dmg"; - - private OracleDownloadUrlGenerator urlGenerator; - - @Before - public void setUp() throws Exception { - urlGenerator = new OracleDownloadUrlGenerator(); - } - - @Test - public void testBuildUrl() { - String url = urlGenerator.buildUrl( - "macos", - "jdk", - 1, - 8, - 131, - 11, - "macosx-x64.dmg", - "d54c1d3a095b4ff2b6607d096fa80163" - ); - - assertEquals( - EXPECTED_URL, - url - ); - } - -} diff --git a/build/shared/lib/welcome/generic.html b/build/shared/lib/welcome/generic.html index 50a4e8216..0946269b3 100644 --- a/build/shared/lib/welcome/generic.html +++ b/build/shared/lib/welcome/generic.html @@ -13,7 +13,7 @@ -

Welcome to Processing 4 (alpha)

+

Processing 4 (alpha)

diff --git a/build/shared/lib/welcome/sketchbook.html b/build/shared/lib/welcome/sketchbook.html index a45c02bdd..6d4cc8cfa 100644 --- a/build/shared/lib/welcome/sketchbook.html +++ b/build/shared/lib/welcome/sketchbook.html @@ -13,7 +13,7 @@ -

Welcome to Processing 4 (alpha) +

Processing 4 (alpha) diff --git a/core/todo.txt b/core/todo.txt index c60cd6721..ca2932a9c 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -22,8 +22,6 @@ _ removing AWT from core _ https://github.com/codeanticode/processing-lwjgl/wiki#making-awt-optional-in-papplet _ move loadImage() into surface -_ size() issues on Mojave? (3.4 works, 3.5.3 does not) -_ https://github.com/processing/processing/issues/5791 _ use exit event to set mouseY to 0 on macOS _ https://github.com/processing/processing/pull/5796/files @@ -31,6 +29,12 @@ _ possible fix for precision issues with PDF _ https://github.com/processing/processing/issues/5801#issuecomment-466632459 +high +_ size() issues on Mojave? (3.4 works, 3.5.3 does not) +_ https://github.com/processing/processing/issues/5791 +_ closed for now; unable to confirm anything in the thread + + high-ish _ Update isAccessible() in Table to use JDK 11 reflection methods _ https://github.com/processing/processing4/issues/3 diff --git a/java/src/processing/mode/java/pdex/Rename.java b/java/src/processing/mode/java/pdex/Rename.java index 7c5c6bca2..1941f4135 100644 --- a/java/src/processing/mode/java/pdex/Rename.java +++ b/java/src/processing/mode/java/pdex/Rename.java @@ -129,8 +129,8 @@ class Rename { final String newName = textField.getText().trim(); if (!newName.isEmpty()) { if (newName.length() >= 1 && - newName.chars().limit(1).allMatch(Character::isUnicodeIdentifierStart) && - newName.chars().skip(1).allMatch(Character::isUnicodeIdentifierPart)) { + newName.chars().limit(1).allMatch(Character::isJavaIdentifierStart) && + newName.chars().skip(1).allMatch(Character::isJavaIdentifierPart)) { rename(ps, binding, newName); window.setVisible(false); } else { diff --git a/todo.txt b/todo.txt index 804bb9944..c9bef4630 100755 --- a/todo.txt +++ b/todo.txt @@ -12,6 +12,8 @@ X link to a wiki page for 4.x X create wiki page for changes in 4.x X selecting a sketch in the Sketch menu no longer opens its window X https://github.com/processing/processing/issues/5882 +X streamlining the jdk downloader +X https://github.com/processing/processing4/issues/47 cross-ported from 3.5.4 X don't remove entries from Recent menu on Save As @@ -74,6 +76,9 @@ X https://github.com/processing/processing/issues/5805 X https://github.com/processing/processing/pull/5909 X updtes to Ukrainian translation X https://github.com/processing/processing/pull/5944 +X rename-variable menu allows Java identifiers +X https://github.com/processing/processing/issues/5828 +X https://github.com/processing/processing/pull/5906 sampottinger X Fix JDK naming and cleanup in ant build @@ -117,6 +122,8 @@ _ change help menu links to go to newer FAQ and the rest open issues +_ update the docs repo +_ check with Casey re: shallow clone or approach _ reliable getLibraryFolder() and getDocumentsFolder() methods in MacPlatform _ https://github.com/processing/processing4/issues/9 _ further streamline the downloader @@ -129,9 +136,6 @@ _ windows anti-malware leaves browser stuck at 100% _ https://github.com/processing/processing/issues/5893 -quick fixes -_ rename-variable menu allows Java identifiers -_ https://github.com/processing/processing/pull/5906 from Casey _ Math for BLEND incorrect in the reference?