-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -488,13 +488,9 @@ public PrettierConfig prettier() { | |
public class EclipseWtpConfig { | ||
private final EclipseBasedStepBuilder builder; | ||
|
||
EclipseWtpConfig(EclipseWtpFormatterStep type) { | ||
this(type, EclipseWtpFormatterStep.defaultVersion()); | ||
} | ||
|
||
EclipseWtpConfig(EclipseWtpFormatterStep type, String version) { | ||
builder = type.createBuilder(GradleProvisioner.fromProject(getProject())); | ||
builder.setVersion(EclipseWtpFormatterStep.defaultVersion()); | ||
builder.setVersion(version); | ||
addStep(builder.build()); | ||
This comment has been minimized.
Sorry, something went wrong.
nedtwigg
Author
Member
|
||
} | ||
|
||
|
@@ -504,17 +500,14 @@ public void configFile(Object... configFiles) { | |
builder.setPreferences(project.files(configFiles).getFiles()); | ||
replaceStep(builder.build()); | ||
} | ||
|
||
} | ||
|
||
public EclipseWtpConfig eclipseWtp(String type) { | ||
This comment has been minimized.
Sorry, something went wrong.
nedtwigg
Author
Member
|
||
return new EclipseWtpConfig(EclipseWtpFormatterStep.valueFrom(type)); | ||
public EclipseWtpConfig eclipseWtp(EclipseWtpFormatterStep type) { | ||
return eclipseWtp(type, EclipseWtpFormatterStep.defaultVersion()); | ||
} | ||
|
||
public EclipseWtpConfig eclipseWtp(String type, String version) { | ||
return new EclipseWtpConfig( | ||
EclipseWtpFormatterStep.valueFrom(type), | ||
version); | ||
public EclipseWtpConfig eclipseWtp(EclipseWtpFormatterStep type, String version) { | ||
return new EclipseWtpConfig(type, version); | ||
} | ||
|
||
/** Sets up a format task according to the values in this extension. */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
|
||
public class EclipseWtp implements FormatterStepFactory { | ||
@Parameter | ||
private String type; | ||
This comment has been minimized.
Sorry, something went wrong.
nedtwigg
Author
Member
|
||
private EclipseWtpFormatterStep type; | ||
|
||
@Parameter | ||
private String version; | ||
|
@@ -38,7 +38,7 @@ public class EclipseWtp implements FormatterStepFactory { | |
|
||
@Override | ||
public FormatterStep newFormatterStep(FormatterStepConfig stepConfig) { | ||
EclipseBasedStepBuilder eclipseConfig = EclipseWtpFormatterStep.valueFrom(type).createBuilder(stepConfig.getProvisioner()); | ||
EclipseBasedStepBuilder eclipseConfig = type.createBuilder(stepConfig.getProvisioner()); | ||
eclipseConfig.setVersion(version == null ? EclipseWtpFormatterStep.defaultVersion() : version); | ||
if (null != files) { | ||
eclipseConfig.setPreferences( | ||
|
In general, making an argument case-insensitive is just opening a can of worms. The less code we have to maintain, the better!