Skip to content

Commit 224f8f9

Browse files
authored
Improves documentation and usage (#2038)
2 parents d026161 + 7f04707 commit 224f8f9

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

plugin-gradle/CHANGES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
138138
```
139139
spotless {
140140
java {
141-
eclipse().withP2Mirrors(['https://download.eclipse.org/', 'https://some.internal.mirror/eclipse'])
141+
eclipse().withP2Mirrors(['https://download.eclipse.org/': 'https://some.internal.mirror/eclipse'])
142142
}
143143
}
144144
```

plugin-gradle/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ spotless {
234234
eclipse()
235235
// optional: you can specify a specific version and/or config file
236236
eclipse('4.26').configFile('eclipse-prefs.xml')
237+
// if the access to the p2 repositories is restricted, mirrors can be
238+
// specified using a URI prefix map as follows:
239+
echlise().withP2Mirrors(['https://download.eclipse.org/eclipse/updates/4.29/':'https://some.internal.mirror/4-29-updates-p2/'])
240+
237241
```
238242

239243

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/BaseGroovyExtension.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -64,11 +64,12 @@ private GrEclipseConfig(String version, FormatExtension extension) {
6464
extension.addStep(builder.build());
6565
}
6666

67-
public void configFile(Object... configFiles) {
67+
public GrEclipseConfig configFile(Object... configFiles) {
6868
requireElementsNonNull(configFiles);
6969
Project project = extension.getProject();
7070
builder.setPreferences(project.files(configFiles).getFiles());
7171
extension.replaceStep(builder.build());
72+
return this;
7273
}
7374

7475
public GrEclipseConfig withP2Mirrors(Map<String, String> mirrors) {

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/CppExtension.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,11 +52,12 @@ public class EclipseConfig {
5252
addStep(builder.build());
5353
}
5454

55-
public void configFile(Object... configFiles) {
55+
public EclipseConfig configFile(Object... configFiles) {
5656
requireElementsNonNull(configFiles);
5757
Project project = getProject();
5858
builder.setPreferences(project.files(configFiles).getFiles());
5959
replaceStep(builder.build());
60+
return this;
6061
}
6162

6263
public EclipseConfig withP2Mirrors(Map<String, String> mirrors) {

0 commit comments

Comments
 (0)