diff --git a/CHANGES.md b/CHANGES.md index c9ccb398b..64d0fcddb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,8 @@ ### Version 3.10.0 - TBD ([javadoc](http://diffplug.github.io/goomph/javadoc/snapshot/), [snapshot](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/gradle/goomph/)) +- Added a feature to provide a custom goomph-pde-bootstrap installation. [(#52)](https://github.com/diffplug/goomph/pull/52) + ### Version 3.9.1 - February 2nd 2018 ([javadoc](http://diffplug.github.io/goomph/javadoc/3.9.1/), [jcenter](https://bintray.com/diffplug/opensource/goomph/3.9.1/view)) - Added `--launcher.suppressErrors` to all `EclipseApp` invocations so that build errors won't open a blocking dialog on build servers. [(#49)](https://github.com/diffplug/goomph/pull/49) diff --git a/src/main/java/com/diffplug/gradle/GoomphCacheLocations.java b/src/main/java/com/diffplug/gradle/GoomphCacheLocations.java index 550bf7167..adf7d2d0c 100644 --- a/src/main/java/com/diffplug/gradle/GoomphCacheLocations.java +++ b/src/main/java/com/diffplug/gradle/GoomphCacheLocations.java @@ -36,6 +36,7 @@ * * - {@link #p2bootstrap()} * - {@link #pdeBootstrap()} + * - {@link #pdeBootstrapUrl()} * - {@link #bundlePool()} * - {@link #workspaces()} * @@ -121,6 +122,26 @@ public static File p2bootstrap() { public static File override_p2bootstrap = null; + /** + * Location where the pde-bootstrap application should be downloaded from. + * + * Goomph's pde tasks rely on the eclipse [p2 director application](http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_director.html&cp=2_0_20_2). + * It is distributed within the Eclipse SDK. The Package is + * downloaded and installed during configuration from official eclipse + * repository. + * + * Defaults to official update site of the selected Eclipse Release. If you override, it still + * needs to follow the correct versioning scheme. e.g. if you want to relocate to `http://intranet/goomph-pde-boostrap`, then + * the artifact will need to be available at `http://intranet/goomph-pde-boostrap/4.5.2/goomph-pde-bootstrap.zip` + * + * As new versions of pdeBootstrap come out, you will have to update your internal URL cache, but these releases are infrequent. + */ + public static Optional pdeBootstrapUrl() { + return Optional.ofNullable(override_pdeBootstrapUrl); + } + + public static String override_pdeBootstrapUrl = null; + /** * Location where eclipse instances with PDE build * are cached: `~/.goomph/pde-bootstrap`. diff --git a/src/main/java/com/diffplug/gradle/pde/PdeInstallation.java b/src/main/java/com/diffplug/gradle/pde/PdeInstallation.java index 8f84d5472..33f7ff354 100644 --- a/src/main/java/com/diffplug/gradle/pde/PdeInstallation.java +++ b/src/main/java/com/diffplug/gradle/pde/PdeInstallation.java @@ -16,7 +16,9 @@ package com.diffplug.gradle.pde; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; +import java.net.URL; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; @@ -34,6 +36,7 @@ import com.diffplug.common.swt.os.SwtPlatform; import com.diffplug.gradle.FileMisc; import com.diffplug.gradle.GoomphCacheLocations; +import com.diffplug.gradle.ZipMisc; import com.diffplug.gradle.eclipserunner.EclipseApp; import com.diffplug.gradle.eclipserunner.EclipseRunner; import com.diffplug.gradle.eclipserunner.NativeRunner; @@ -41,9 +44,13 @@ /** Wraps a PDE installation for the given eclipse release.*/ public class PdeInstallation implements EclipseRunner { + + static final String DOWNLOAD_FILE = "/goomph-pde-bootstrap.zip"; + static final String VERSIONED_DOWNLOAD_FILE = "/goomph-pde-bootstrap-%s.zip"; + /** * Returns a PdeInstallation based on `GOOMPH_PDE_VER`, and other factors. - * + * * You must specify which version of Eclipse should be used by Goomph. * - Option #1: To use an officially supported release, use this: * + `GOOMPH_PDE_VER`=4.5.2 (or any official release) @@ -51,7 +58,7 @@ public class PdeInstallation implements EclipseRunner { * + `GOOMPH_PDE_VER`= * + `GOOMPH_PDE_UDPATE_SITE`= * + `GOOMPH_PDE_ID`=