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'
// 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_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 |
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(SwtPlatform... platforms)
Sets the platforms which we will build for.
|
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setName, setOnlyIf, setOnlyIf, setProject, setProperty, setShouldRunAfter, shouldRunAfter, toString
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 JdkConfig getJdkConfig()
Returns the JDK config for users to edit.
public void setConfigs(SwtPlatform... platforms)
Sets the platforms which we will build for.
public void product(Action<PdeProductBuildConfig> productConfig)
Copies the product and imgs from the given directory to the given path within the build directory.