Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
df9b1af
Remove ben-manes.versions cuz I use it in an initscript now.
nedtwigg Jan 24, 2020
c322a76
Bump gradle to 6.1
nedtwigg Jan 24, 2020
6e59f31
Bump dependencies, except bndlib.
nedtwigg Jan 24, 2020
798a48c
Bump bndlib to 5.0
nedtwigg Jan 24, 2020
8d32a81
Improved caching.
nedtwigg Jan 24, 2020
e60b5e4
Fixup javadoc.
nedtwigg Jan 24, 2020
9ed347f
Add infrastructure for moving the legacy plugin ids.
nedtwigg Jan 24, 2020
66352e4
Gradle makes sure that plugins only get applied once already, we don'…
nedtwigg Jan 24, 2020
0b03a6b
Update `com.diffplug.osgi.bndmanifest`
nedtwigg Jan 24, 2020
5c220b5
Update `com.diffplug.eclipse.mavencentral`
nedtwigg Jan 24, 2020
6b00c37
Update `com.diffplug.eclipse.buildproperties`
nedtwigg Jan 24, 2020
0406889
Update `com.diffplug.eclipse.excludebuildfolder`
nedtwigg Jan 24, 2020
0ccf7bd
Update `com.diffplug.eclipse.projectdeps`
nedtwigg Jan 24, 2020
f1e4138
Update `com.diffplug.eclipse.resourcefilters`
nedtwigg Jan 24, 2020
4a375d6
Finished all the `.eclipse` plugins.
nedtwigg Jan 24, 2020
e9af19c
Update `com.diffplug.p2.asmaven`
nedtwigg Jan 24, 2020
16276d7
Update `com.diffplug.swt.nativedeps`
nedtwigg Jan 24, 2020
88104fc
Update `com.diffplug.osgi.equinoxlaunch`
nedtwigg Jan 24, 2020
0d9cd11
Update `com.diffplug.oomph.ide`
nedtwigg Jan 25, 2020
9a30a4a
The case of equinoxLaunch is a but more complicated than the others.
nedtwigg Jan 25, 2020
7014a93
Update changelog.
nedtwigg Jan 25, 2020
b5b4d8b
Fix the equinoxLaunch case.
nedtwigg Jan 25, 2020
03d5b9b
Small changelog improvement.
nedtwigg Jan 25, 2020
0d0cd35
Another fix for the equinoxLaunch oddball.
nedtwigg Jan 25, 2020
36be6b0
Note the bndlib bump.
nedtwigg Jan 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ jdk:
script: ./gradlew build
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- rm -fr $HOME/.gradle/caches/*/executionHistory/
- rm -fr $HOME/.gradle/caches/*/fileContent/
- rm -fr $HOME/.gradle/caches/*/fileHashes/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/caches/modules-2/
- $HOME/.gradle/wrapper/
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Goomph releases

## [Unreleased]
### Changed
- All plugin ids (not classes) have [moved, from `plugins { id 'com.diffplug.gradle.blah' }` to `com.diffplug.blah`](https://github.com/diffplug/goomph/pull/115/files#diff-503f218d646c10f484fdc9d6315bf2e3)) ([#115](https://github.com/diffplug/goomph/pull/115))
- The old ids will keep working, but they'll print a warning advising a switch to the new id.
- One exception: `com.diffplug.gradle.equinoxlaunch` -> `com.diffplug.osgi.equinoxlaunch` (it should have been in OSGi category all along)
- This is annoying, but the deprecation warnings include an easy regex fix, and it's better to fix this now than later.
- [More detail on the reasoning](https://dev.to/nedtwigg/names-in-java-maven-and-gradle-2fm2) if you're curious.
- Bump `bndlib` from `4.2.0` to `5.0.0`.

## [3.20.0] - 2020-01-11
### Added
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ It is possible to have many installations of the Eclipse IDE share a common set
When you run `gradlew ide`, it builds and downloads an IDE into `build/oomphIde` with just the features you need. Takes ~15 seconds and 1MB of disk space once all the common artifacts have been cached at `~/.goomph`.

```groovy
apply plugin: 'com.diffplug.gradle.oomph.ide'
apply plugin: 'com.diffplug.oomph.ide'
oomphIde {
repoEclipseLatest()
jdt {}
Expand Down Expand Up @@ -67,20 +67,21 @@ Real world Eclipse software built with Goomph:

Below is an index of Goomph's capabilities, along with links to the javadoc where you can find usage examples.

**`com.diffplug.gradle.osgi` Plugin for generating OSGi metadata.**
**`com.diffplug.osgi` Plugins for working with OSGi.**

* [`bndmanifest`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/osgi/BndManifestPlugin.html) generates a manifest using purely bnd, and outputs it for IDE consumption.
* [`equinoxlaunch`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/eclipserunner/EquinoxLaunchPlugin.html) can configure and run equinox applications as part of the build, such as a code generator.
* [`OsgiExecable`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/osgi/OsgiExecable.html) makes it easy to run a chunk of code within an OSGi container, and get the result from outside the container.

**`com.diffplug.gradle.eclipse` Plugins for handling eclipse' maven central artifacts and creating and manipulating eclipse project files.**
**`com.diffplug.eclipse` Plugins for handling eclipse' maven central artifacts and creating and manipulating eclipse project files.**

* [`mavencentral`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/eclipse/MavenCentralPlugin.html) makes it easy to add dependency jars from an eclipse release.
* [`buildproperties`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/eclipse/BuildPropertiesPlugin.html) uses [`build.properties`](https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Feditors%2Fmanifest_editor%2Fbuild.htm) to control a gradle build, and fixes eclipse project classpath to include binary assets specified in `build.properties`.
* [`excludebuildfolder`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/eclipse/ExcludeBuildFolderPlugin.html) excludes the gradle `build` folder from Eclipse's resource indexing.
* [`projectdeps`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/eclipse/ProjectDepsPlugin.html) fixes an intermittent problem where dependencies on other projects within the workspace aren't always resolved correctly within Eclipse.
* [`resourcefilters`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/eclipse/ResourceFiltersPlugin.html) adds resource filters to the eclipse project.

**`com.diffplug.gradle.p2` Tasks and plugins for manipulating p2 data.**
**`com.diffplug.p2` Tasks and plugins for manipulating p2 data.**

* [`asmaven`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/p2/AsMavenPlugin.html) downloads dependencies from a p2 repository and makes them available in a local maven repository.
* [`P2Model`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/p2/P2Model.html) models a set of p2 repositories and IUs, and provides convenience methods for running p2-director or the p2.mirror ant task against these.
Expand All @@ -93,7 +94,7 @@ Below is an index of Goomph's capabilities, along with links to the javadoc wher
* [`PdeBuildTask`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/pde/PdeBuildTask.html) runs PDE build to build an RCP product.
* [`PdeAntBuildTask`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/pde/PdeAntBuildTask.html) runs PDE on an ant file.

**`com.diffplug.gradle.swt` Plugins for working with SWT in Gradle.**
**`com.diffplug.swt` Plugins for working with SWT in Gradle.**

* [`nativedeps`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/swt/NativeDepsPlugin.html) adds the platform-specific SWT jars to the runtime classpath so that SWT code can run.

Expand All @@ -106,7 +107,6 @@ Below is an index of Goomph's capabilities, along with links to the javadoc wher
**`com.diffplug.gradle.eclipserunner` Infrastructure for running headless eclipse applications.**

* Used to power the infrastructure above.
* [`com.diffplug.gradle.equinoxlaunch`](https://javadoc.io/static/com.diffplug.gradle/goomph/3.20.0/com/diffplug/gradle/eclipserunner/EquinoxLaunchPlugin.html) can configure and run equinox applications as part of the build, such as a code generator.

<!---freshmark /javadoc -->

Expand Down
49 changes: 32 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ plugins {
id 'com.github.spotbugs' version '3.0.0'
}

apply plugin: 'com.github.ben-manes.versions'

apply plugin: 'com.diffplug.spotless-changelog'
spotlessChangelog {
changelogFile 'CHANGES.md'
Expand All @@ -22,7 +20,7 @@ apply from: 干.file('spotless/java.gradle')

String VER_DURIAN = '1.2.0'
String VER_DURIAN_SWT = '3.0.0'
String VER_BNDLIB = '4.2.0'
String VER_BNDLIB = '5.0.0'
String OLDEST_SUPPORTED_GRADLE = '5.1'
dependencies {
// Compile misc
Expand All @@ -32,8 +30,8 @@ dependencies {
implementation "com.diffplug.durian:durian-swt.os:${VER_DURIAN_SWT}"
implementation "commons-io:commons-io:2.6"
implementation "com.diffplug.spotless:spotless-lib:1.5.1"
implementation "com.squareup.okhttp3:okhttp:4.2.0"
implementation "com.squareup.okio:okio:2.4.0"
implementation "com.squareup.okhttp3:okhttp:4.3.1"
implementation "com.squareup.okio:okio:2.4.3"
// OSGi
implementation "biz.aQute.bnd:biz.aQute.bndlib:${VER_BNDLIB}"
// p2 (osgi used in 4.7.2 to match p2-bootstrap)
Expand All @@ -49,8 +47,8 @@ dependencies {
// from 4.6.3 cuz that's the latest one
compileOnly 'org.eclipse.emf:org.eclipse.emf.ecore:2.12.0'
// testing
testImplementation "junit:junit:4.12"
testImplementation "org.assertj:assertj-core:3.13.2"
testImplementation "junit:junit:4.13"
testImplementation "org.assertj:assertj-core:3.14.0"
}
configurations.all {
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt.${osgi.platform}'
Expand Down Expand Up @@ -103,19 +101,36 @@ dependencies {
// MAVEN //
///////////
javadoc {
// TODO: error on invalid javadoc
// error on javadoc problem
options.addStringOption('Xwerror', '-quiet')
// setup links
options.linksOffline('https://docs.oracle.com/javase/8/docs/api/', 'gradle/javadoc/java8')
options.linksOffline("https://docs.gradle.org/${OLDEST_SUPPORTED_GRADLE}/javadoc/", 'gradle/javadoc/gradle')
options.linksOffline("https://diffplug.github.io/durian/javadoc/${VER_DURIAN}/", 'gradle/javadoc/durian')
options.linksOffline("https://diffplug.github.io/durian-swt/javadoc/${VER_DURIAN_SWT}/", 'gradle/javadoc/durian-swt')
options.linksOffline("https://www.javadoc.io/doc/biz.aQute.bnd/biz.aQute.bndlib/${VER_BNDLIB}/", 'gradle/javadoc/bndlib')
}

// TODO: are we handling the com.google.code.findbugs dep correctly in the new publishing setup?
/*
model.publishing.publications.pluginMaven.pom.withXml {
// findbugs annotations should have scope "provided"
asNode().dependencies.'*'.findAll() { it.groupId.text() == 'com.google.code.findbugs' }.each() { it.scope*.value = 'provided' }
}
*/
/////////////////////////////
// LEGACY REDIRECT PLUGINS //
/////////////////////////////
// plugin ids that we are migrating
def old_plugins = 'eclipseBuildProperties eclipseExcludeBuildFolder eclipseMavenCentral eclipseProjectDeps eclipseResourceFilters equinoxLaunch oomphIde p2AsMaven osgiBndManifest swtNativeDeps'.split()
gradlePlugin {
plugins {
for (plugin in old_plugins) {
register "${plugin}Legacy", {
String newId = 干.proj("plugin_${plugin}_id", "for ${plugin}: apply plugin: 'id'")
String newImpl = 干.proj("plugin_${plugin}_impl", "for ${plugin}: implementationClass")
String oldId;
if (newId.equals("com.diffplug.osgi.equinoxlaunch")) {
oldId = "com.diffplug.gradle.equinoxlaunch";
} else {
oldId = newId.replace("com.diffplug.", "com.diffplug.gradle.");
}
id = oldId
implementationClass = "${newImpl}\$Legacy"
displayName = "Back-compat alias to $newId"
description = "Back-compat alias to $newId"
}
}
}
}
20 changes: 10 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,57 @@ plugin_list=\

javadoc_links=

plugin_eclipseBuildProperties_id=com.diffplug.gradle.eclipse.buildproperties
plugin_eclipseBuildProperties_id=com.diffplug.eclipse.buildproperties
plugin_eclipseBuildProperties_impl=com.diffplug.gradle.eclipse.BuildPropertiesPlugin
plugin_eclipseBuildProperties_name=Goomph eclipseBuildProperties
plugin_eclipseBuildProperties_desc=Uses Eclipse''s build.properties to control a gradle build, and fixes the eclipse project classpath to include binary assets specified in build.properties.

plugin_eclipseExcludeBuildFolder_id=com.diffplug.gradle.eclipse.excludebuildfolder
plugin_eclipseExcludeBuildFolder_id=com.diffplug.eclipse.excludebuildfolder
plugin_eclipseExcludeBuildFolder_impl=com.diffplug.gradle.eclipse.ExcludeBuildFolderPlugin
plugin_eclipseExcludeBuildFolder_name=Goomph eclipseExcludeBuildFolder
plugin_eclipseExcludeBuildFolder_desc=Excludes the gradle build folder from Eclipse''s resource indexing.

plugin_eclipseMavenCentral_id=com.diffplug.gradle.eclipse.mavencentral
plugin_eclipseMavenCentral_id=com.diffplug.eclipse.mavencentral
plugin_eclipseMavenCentral_impl=com.diffplug.gradle.eclipse.MavenCentralPlugin
plugin_eclipseMavenCentral_name=Goomph eclipseMavenCentral
plugin_eclipseMavenCentral_desc=Maps eclipse releases and bundle ids to their MavenCentral coordinates.
plugin_eclipseMavenCentral_tags=eclipse mavenCentral

plugin_eclipseProjectDeps_id=com.diffplug.gradle.eclipse.projectdeps
plugin_eclipseProjectDeps_id=com.diffplug.eclipse.projectdeps
plugin_eclipseProjectDeps_impl=com.diffplug.gradle.eclipse.ProjectDepsPlugin
plugin_eclipseProjectDeps_name=Goomph eclipseProjectDeps
plugin_eclipseProjectDeps_desc=Fixes an intermittent problem where dependencies on other projects within the workspace aren''t always resolved correctly within Eclipse.

plugin_eclipseResourceFilters_id=com.diffplug.gradle.eclipse.resourcefilters
plugin_eclipseResourceFilters_id=com.diffplug.eclipse.resourcefilters
plugin_eclipseResourceFilters_impl=com.diffplug.gradle.eclipse.ResourceFiltersPlugin
plugin_eclipseResourceFilters_name=Goomph eclipseResourceFilters
plugin_eclipseResourceFilters_desc=Adds filters to an eclipse project which exclude or include specific resources.

plugin_equinoxLaunch_id=com.diffplug.gradle.equinoxlaunch
plugin_equinoxLaunch_id=com.diffplug.osgi.equinoxlaunch
plugin_equinoxLaunch_impl=com.diffplug.gradle.eclipserunner.EquinoxLaunchPlugin
plugin_equinoxLaunch_name=Goomph equinoxLaunch
plugin_equinoxLaunch_desc=Launches an equinox application with whatever set of plugins the user specifies
plugin_equinoxLaunch_tags=eclipse osgi

plugin_oomphIde_id=com.diffplug.gradle.oomph.ide
plugin_oomphIde_id=com.diffplug.oomph.ide
plugin_oomphIde_impl=com.diffplug.gradle.oomph.OomphIdePlugin
plugin_oomphIde_name=Goomph oomphIde
plugin_oomphIde_desc=Downloads and sets up any Eclipse-based IDE.
plugin_oomphIde_tags=eclipse ide p2AsMaven

plugin_p2AsMaven_id=com.diffplug.gradle.p2.asmaven
plugin_p2AsMaven_id=com.diffplug.p2.asmaven
plugin_p2AsMaven_impl=com.diffplug.gradle.p2.AsMavenPlugin
plugin_p2AsMaven_name=Goomph p2AsMaven
plugin_p2AsMaven_desc=Downloads a set of artifacts from a p2 repository and stuffs them into a local maven repository.
plugin_p2AsMaven_tags=eclipse p2 osgi

plugin_osgiBndManifest_id=com.diffplug.gradle.osgi.bndmanifest
plugin_osgiBndManifest_id=com.diffplug.osgi.bndmanifest
plugin_osgiBndManifest_impl=com.diffplug.gradle.osgi.BndManifestPlugin
plugin_osgiBndManifest_name=Goomph osgiBndManifest
plugin_osgiBndManifest_desc=Generates a manifest using purely bnd, and outputs it for IDE consumption.
plugin_osgiBndManifest_tags=osgi bnd eclipse

plugin_swtNativeDeps_id=com.diffplug.gradle.swt.nativedeps
plugin_swtNativeDeps_id=com.diffplug.swt.nativedeps
plugin_swtNativeDeps_impl=com.diffplug.gradle.swt.NativeDepsPlugin
plugin_swtNativeDeps_name=Goomph swtNativeDeps
plugin_swtNativeDeps_desc=Adds the platform-specific SWT jars to the runtime classpath so that SWT code can run.
Expand Down
3 changes: 0 additions & 3 deletions gradle/javadoc/durian-swt/package-list

This file was deleted.

1 change: 0 additions & 1 deletion gradle/javadoc/durian/package-list

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pluginManagement {
id 'com.diffplug.gradle.eclipse.mavencentral' version '3.18.1'
id 'com.diffplug.gradle.spotless' version '3.27.0'
id 'com.diffplug.spotless-changelog' version '1.0.0'
id 'com.github.ben-manes.versions' version '0.27.0'
id 'com.gradle.plugin-publish' version '0.10.1'
id 'com.jfrog.bintray' version '1.8.4'
}
Expand All @@ -15,7 +14,6 @@ plugins {
id 'com.diffplug.gradle.eclipse.mavencentral' apply false
id 'com.diffplug.gradle.spotless' apply false
id 'com.diffplug.spotless-changelog' apply false
id 'com.github.ben-manes.versions' apply false
id 'com.gradle.plugin-publish' apply false
id 'com.jfrog.bintray' apply false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static void initFromProject(Project project) {
}

/**
* {@link MavenCentralMap} needs to look at p2 metadata
* {@link com.diffplug.gradle.eclipse.MavenCentralMapping} needs to look at p2 metadata
* to know what the version numbers are for the specific
* bundles of a given eclipse release are.
*
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/com/diffplug/gradle/LegacyPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2020 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.diffplug.gradle;


import org.gradle.api.Plugin;
import org.gradle.api.Project;

public class LegacyPlugin implements Plugin<Project> {
private final Class<? extends Plugin<Project>> newPlugin;
private final String newId;

protected LegacyPlugin(Class<? extends Plugin<Project>> newPlugin, String newPluginId) {
this.newPlugin = newPlugin;
this.newId = newPluginId;
}

@Override
public void apply(Project proj) {
proj.getPlugins().apply(newPlugin);
String oldId;
if (newId.equals("com.diffplug.osgi.equinoxlaunch")) {
oldId = "com.diffplug.gradle.equinoxlaunch";
} else {
oldId = newId.replace("com.diffplug.", "com.diffplug.gradle.");
}
System.out.println(" plugin id '" + oldId + "' has been deprecated");
System.out.println("replaced by '" + newId + "'");
System.out.println("A simple find-replace will fix it. Here is why we moved: https://dev.to/nedtwigg/names-in-java-maven-and-gradle-2fm2#gradle-plugin-id");
}
}
5 changes: 1 addition & 4 deletions src/main/java/com/diffplug/gradle/ProjectPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
public abstract class ProjectPlugin implements Plugin<Project> {
@Override
public final void apply(Project project) {
// ensure we don't double-apply the plugin
if (project.getPlugins().hasPlugin(this.getClass())) {
return;
}
project.afterEvaluate(GoomphCacheLocations::initFromProject);
// apply the plugin once
applyOnce(project);
Expand All @@ -38,6 +34,7 @@ public final void apply(Project project) {
protected abstract void applyOnce(Project project);

/** Returns the instance of the given plugin, by returning the existing or applying brand new, as appropriate. */
@Deprecated
public static <T extends Plugin<?>> T getPlugin(Project project, Class<T> pluginClazz) {
// make sure the eclipse plugin has been applied
if (project.getPlugins().hasPlugin(pluginClazz)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.diffplug.common.base.Suppliers;
import com.diffplug.gradle.GroovyCompat;
import com.diffplug.gradle.LegacyPlugin;
import com.diffplug.gradle.ProjectPlugin;
import groovy.util.Node;
import java.io.BufferedInputStream;
Expand Down Expand Up @@ -50,15 +51,22 @@
* can be the single source of truth for all the binary assets inside your plugin.
*
* ```groovy
* apply plugin: 'com.diffplug.gradle.eclipse.buildproperties'
* apply plugin: 'com.diffplug.eclipse.buildproperties'
* ```
*/
public class BuildPropertiesPlugin extends ProjectPlugin {
public static class Legacy extends LegacyPlugin {
public Legacy() {
super(BuildPropertiesPlugin.class, "com.diffplug.eclipse.buildproperties");
}
}

private Project project;

@SuppressWarnings("unchecked")
@Override
protected void applyOnce(Project project) {
project.getPlugins().apply(Legacy.class);
this.project = project;

EclipseProjectPlugin.modifyEclipseProject(project, eclipseModel -> {
Expand All @@ -72,7 +80,7 @@ protected void applyOnce(Project project) {
});

// update processResources based on build.properties
ProjectPlugin.getPlugin(project, JavaPlugin.class);
project.getPlugins().apply(JavaPlugin.class);
ProcessResources task = (ProcessResources) project.getTasks().getByName(JavaPlugin.PROCESS_RESOURCES_TASK_NAME);
// handle the build.properties includes
//AbstractCopyTask copyTask = task.from(project.getProjectDir());
Expand Down Expand Up @@ -115,7 +123,7 @@ public List<String> getBinIncludes() {
// parse build.properties and put it into binIncludes
File buildProperties = project.file("build.properties");
if (!buildProperties.exists()) {
throw new IllegalArgumentException("There is no 'build.properties' file - do not apply 'com.diffplug.gradle.eclipse.buildproperties' to this project");
throw new IllegalArgumentException("There is no 'build.properties' file - do not apply 'com.diffplug.eclipse.buildproperties' to this project");
}

Properties parsedProperties = new Properties();
Expand Down
Loading