public class PdeBuildTask extends DefaultTask
Runs PDE build to make an RCP application or a p2 repository.
Your project must have defined GOOMPH_PDE_VER
, see
PdeInstallation.fromProject(org.gradle.api.Project)
for details.
import com.diffplug.gradle.pde.*
import com.diffplug.gradle.ZipMisc
task buildP2(type: PdeBuildTask) {
// set the base platform
base(rootProject.file('target.fromp2/build/p2asmaven/p2runnable'))
// configure where the projects will come from
addPluginPath(rootProject.file('target.frommaven/build'))
// and where they will go
destination(P2_DIR)
// specify that this is a product build
product {
id 'com.diffplug.rcpdemo.product'
version rootProject.version
productPluginDir rootProject.file('com.diffplug.rcpdemo')
productFileWithinPlugin 'rcpdemo.product'
explicitVersionPolicy({
it.resolve('com.google.guava', '17.0.0', '18.0.0').with('17.0.0', '18.0.0')
})
}
// set the build properties to be appropriate for p2
props['p2.build.repo'] = 'file://' + project.file(P2_DIR).absolutePath
props['p2.gathering'] = 'true'
props['skipDirector'] = 'true'
props['runPackager'] = 'false'
props['groupConfigurations'] = 'true'
app {
it.consolelog()
it.addArgs('-debug')
}
// p2.compress doesn't work, so we'll do it manually
doLast {
def compressXml = { name ->
def xml = project.file(P2_REPO_DIR + "/${name}.xml")
def jar = project.file(P2_REPO_DIR + "/${name}.jar")
ZipMisc.zip(xml, "${name}.xml", jar)
xml.delete()
}
compressXml('artifacts')
compressXml('content')
}
}
Task.Namer
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor and Description |
---|
PdeBuildTask() |
Modifier and Type | Method and Description |
---|---|
void |
addPluginPath(Object pluginPath)
Adds a directory from which to read.
|
void |
app(Action<EclipseApp> antModifier)
Allows for fine-grained manipulation of the pde operation.
|
void |
base(Object base)
Sets the directory which contains either the
extracted delta pack, or the result of a p2
mirror task containing something like this:
|
void |
build() |
void |
destination(Object buildDir)
Sets the target directory.
|
JdkConfig |
getJdkConfig()
Returns the JDK config for users to edit.
|
Map<String,String> |
getProps()
Extra properties to set in the build.
|
void |
product(Action<PdeProductBuildConfig> productConfig)
Copies the product and imgs from the given directory to the given path within the build directory.
|
void |
setConfigs(com.diffplug.common.swt.os.SwtPlatform... platforms)
Sets the platforms which we will build for.
|
appendParallelSafeAction, compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getRequiredServices, getServices, getSharedResources, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString, usesService
public void destination(Object buildDir)
Sets the target directory.
public void base(Object base)
Sets the directory which contains either the extracted delta pack, or the result of a p2 mirror task containing something like this:
p2.addFeature('org.eclipse.equinox.executable')
p2.addFeature('org.eclipse.rcp.configuration')
p2.addFeature('org.eclipse.platform')
public void addPluginPath(Object pluginPath)
Adds a directory from which to read.
public void setConfigs(com.diffplug.common.swt.os.SwtPlatform... platforms)
Sets the platforms which we will build for.
public void app(Action<EclipseApp> antModifier)
Allows for fine-grained manipulation of the pde operation.
public void product(Action<PdeProductBuildConfig> productConfig)
Copies the product and imgs from the given directory to the given path within the build directory.