Package com.diffplug.gradle.oomph
Class OomphConvention
- java.lang.Object
-
- com.diffplug.gradle.oomph.OomphConvention
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ConventionJdt
,ConventionPde
,ConventionStyle
,ConventionThirdParty
,WithRepoConvention
public class OomphConvention extends Object implements AutoCloseable
Base class for implementing a DSL around a specific part of the IDE.
-
-
Field Summary
Fields Modifier and Type Field Description protected OomphIdeExtension
extension
-
Constructor Summary
Constructors Modifier Constructor Description protected
OomphConvention(OomphIdeExtension extension)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This is called when the convention block ends.static <T extends OomphConvention>
voidconfigure(Function<OomphIdeExtension,T> constructor, OomphIdeExtension extension, Action<T> action)
Convenience method for configuring the IDE.protected void
requireIUs(String... ius)
Ensures the p2 model contains the given IUs.protected void
setPerspectiveOver(String toSet, String... toTrump)
Sets the perspective to the first value, if the existing value is one of the other values.
-
-
-
Field Detail
-
extension
protected final OomphIdeExtension extension
-
-
Constructor Detail
-
OomphConvention
protected OomphConvention(OomphIdeExtension extension)
-
-
Method Detail
-
requireIUs
protected void requireIUs(String... ius)
Ensures the p2 model contains the given IUs.
-
setPerspectiveOver
protected void setPerspectiveOver(String toSet, String... toTrump)
Sets the perspective to the first value, if the existing value is one of the other values. This allows a consistent mechanism for PDE to trump JDT.
-
close
public void close()
This is called when the convention block ends. Usually it can just be empty, but if you've been accumulating values, this is your chance to smush them down into a setup action (seeConventionJdt
.- Specified by:
close
in interfaceAutoCloseable
-
configure
public static <T extends OomphConvention> void configure(Function<OomphIdeExtension,T> constructor, OomphIdeExtension extension, Action<T> action)
Convenience method for configuring the IDE.
-
-