Skip to content

Commit 7c92f93

Browse files
committed
Expose all DriverService.Builders to the service loader
1 parent 3efb867 commit 7c92f93

File tree

13 files changed

+80
-6
lines changed

13 files changed

+80
-6
lines changed

java/client/src/org/openqa/selenium/chrome/BUCK

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ java_library(
99
exported_deps = [
1010
'//java/client/src/org/openqa/selenium/remote:remote',
1111
],
12+
provided_deps = [
13+
'//third_party/java/service:auto-service',
14+
],
15+
annotation_processor_deps = [
16+
'//third_party/java/auto:auto-common',
17+
'//third_party/java/service:auto-service',
18+
'//third_party/java/guava:guava',
19+
],
20+
annotation_processors = [
21+
'com.google.auto.service.processor.AutoServiceProcessor',
22+
],
1223
deps = [
1324
'//third_party/java/guava:guava',
1425
],

java/client/src/org/openqa/selenium/chrome/ChromeDriverService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.openqa.selenium.chrome;
1919

20+
import com.google.auto.service.AutoService;
2021
import com.google.common.collect.ImmutableList;
2122
import com.google.common.collect.ImmutableMap;
2223

@@ -91,6 +92,7 @@ public static ChromeDriverService createDefaultService() {
9192
/**
9293
* Builder used to configure new {@link ChromeDriverService} instances.
9394
*/
95+
@AutoService(DriverService.Builder.class)
9496
public static class Builder extends DriverService.Builder<
9597
ChromeDriverService, ChromeDriverService.Builder> {
9698

java/client/src/org/openqa/selenium/edge/BUCK

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ java_library(
99
exported_deps = [
1010
'//java/client/src/org/openqa/selenium/remote:remote',
1111
],
12+
provided_deps = [
13+
'//third_party/java/service:auto-service',
14+
],
15+
annotation_processor_deps = [
16+
'//third_party/java/auto:auto-common',
17+
'//third_party/java/service:auto-service',
18+
'//third_party/java/guava:guava',
19+
],
20+
annotation_processors = [
21+
'com.google.auto.service.processor.AutoServiceProcessor',
22+
],
1223
deps = [
1324
'//third_party/java/guava:guava',
1425
],

java/client/src/org/openqa/selenium/edge/EdgeDriverService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package org.openqa.selenium.edge;
1818

19+
import com.google.auto.service.AutoService;
1920
import com.google.common.collect.ImmutableList;
2021
import com.google.common.collect.ImmutableMap;
2122

@@ -67,6 +68,7 @@ public static EdgeDriverService createDefaultService() {
6768
return new Builder().build();
6869
}
6970

71+
@AutoService(DriverService.Builder.class)
7072
public static class Builder extends DriverService.Builder<
7173
EdgeDriverService, EdgeDriverService.Builder> {
7274

java/client/src/org/openqa/selenium/firefox/BUCK

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ java_library(name = 'firefox',
1414
exported_deps = [
1515
'//java/client/src/org/openqa/selenium/remote:remote',
1616
],
17+
provided_deps = [
18+
'//third_party/java/service:auto-service',
19+
],
20+
annotation_processor_deps = [
21+
'//third_party/java/auto:auto-common',
22+
'//third_party/java/service:auto-service',
23+
'//third_party/java/guava:guava',
24+
],
25+
annotation_processors = [
26+
'com.google.auto.service.processor.AutoServiceProcessor',
27+
],
1728
deps = [
18-
':prefs',
1929
'//third_party/java/guava:guava',
2030
],
2131
visibility = [ 'PUBLIC' ],

java/client/src/org/openqa/selenium/firefox/GeckoDriverService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static com.google.common.base.Preconditions.checkNotNull;
2121
import static java.util.concurrent.TimeUnit.SECONDS;
2222

23+
import com.google.auto.service.AutoService;
2324
import com.google.common.collect.ImmutableList;
2425
import com.google.common.collect.ImmutableMap;
2526
import com.google.common.io.ByteStreams;
@@ -105,6 +106,7 @@ protected boolean hasShutdownEndpoint() {
105106
/**
106107
* Builder used to configure new {@link GeckoDriverService} instances.
107108
*/
109+
@AutoService(DriverService.Builder.class)
108110
public static class Builder extends DriverService.Builder<
109111
GeckoDriverService, GeckoDriverService.Builder> {
110112

java/client/src/org/openqa/selenium/firefox/XpiDriverService.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static org.openqa.selenium.firefox.FirefoxOptions.FIREFOX_OPTIONS;
2323
import static org.openqa.selenium.firefox.FirefoxProfile.PORT_PREFERENCE;
2424

25+
import com.google.auto.service.AutoService;
2526
import com.google.common.base.Preconditions;
2627
import com.google.common.collect.ImmutableList;
2728
import com.google.common.collect.ImmutableMap;
@@ -239,16 +240,12 @@ public static Builder builder() {
239240
return new Builder();
240241
}
241242

243+
@AutoService(DriverService.Builder.class)
242244
public static class Builder extends DriverService.Builder<XpiDriverService, XpiDriverService.Builder> {
243245

244246
private FirefoxBinary binary = null;
245247
private FirefoxProfile profile = null;
246248

247-
248-
private Builder() {
249-
// Only available through the static factory method in the XpiDriverService
250-
}
251-
252249
public Builder withBinary(FirefoxBinary binary) {
253250
this.binary = Preconditions.checkNotNull(binary);
254251
return this;

java/client/src/org/openqa/selenium/ie/BUCK

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ java_library(name = 'ie',
88
exported_deps = [
99
'//java/client/src/org/openqa/selenium/remote:remote',
1010
],
11+
provided_deps = [
12+
'//third_party/java/service:auto-service',
13+
],
14+
annotation_processor_deps = [
15+
'//third_party/java/auto:auto-common',
16+
'//third_party/java/service:auto-service',
17+
'//third_party/java/guava:guava',
18+
],
19+
annotation_processors = [
20+
'com.google.auto.service.processor.AutoServiceProcessor',
21+
],
1122
deps = [
1223
'//third_party/java/guava:guava',
1324
],

java/client/src/org/openqa/selenium/ie/InternetExplorerDriverService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.openqa.selenium.ie;
1919

20+
import com.google.auto.service.AutoService;
2021
import com.google.common.collect.ImmutableList;
2122
import com.google.common.collect.ImmutableMap;
2223

@@ -96,6 +97,7 @@ public static InternetExplorerDriverService createDefaultService() {
9697
/**
9798
* Builder used to configure new {@link InternetExplorerDriverService} instances.
9899
*/
100+
@AutoService(DriverService.Builder.class)
99101
public static class Builder extends DriverService.Builder<
100102
InternetExplorerDriverService, InternetExplorerDriverService.Builder> {
101103

java/client/src/org/openqa/selenium/opera/BUCK

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ java_library(
99
exported_deps = [
1010
'//java/client/src/org/openqa/selenium/remote:remote',
1111
],
12+
provided_deps = [
13+
'//third_party/java/service:auto-service',
14+
],
15+
annotation_processor_deps = [
16+
'//third_party/java/auto:auto-common',
17+
'//third_party/java/service:auto-service',
18+
'//third_party/java/guava:guava',
19+
],
20+
annotation_processors = [
21+
'com.google.auto.service.processor.AutoServiceProcessor',
22+
],
1223
deps = [
1324
'//third_party/java/guava:guava',
1425
],

0 commit comments

Comments
 (0)