Skip to content

Commit 2c2fa99

Browse files
committed
Build the Grid server using Buck.
1 parent d0ef377 commit 2c2fa99

File tree

13 files changed

+257
-2
lines changed

13 files changed

+257
-2
lines changed

Diff for: .buckconfig

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@
2222
remote = //java/client/src/org/openqa/selenium/remote:remote
2323
safari = //java/client/src/org/openqa/selenium/safari:safari
2424

25+
grid = //java/server/src/org/openqa/grid/selenium:selenium
26+
leg-rc = //java/client/src/com/thoughtworks/selenium:legacy-selenium-client
27+
rc-server = //java/server/src/org/openqa/selenium/server:rc
2528
selenium-java = //java/client/src/org/openqa/selenium:selenium-java
26-
leg-rc = //java/client/src/com/thoughtworks/selenium:legacy-selenium-client

Diff for: java/client/src/com/thoughtworks/selenium/webdriven/BUCK

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ java_library(name = 'webdriven',
4242
'//java/client/test/org/openqa/selenium/v1:tests',
4343
'//java/client/test/org/openqa/selenium/v1/internal/seleniumemulation:LargeTests',
4444
'//java/client/test/org/openqa/selenium/v1/internal/seleniumemulation:tests',
45+
'//java/server/src/org/openqa/grid/selenium:classes',
4546
'//java/server/src/org/openqa/selenium/server:server',
4647
],
4748
)

Diff for: java/server/src/org/openqa/grid/BUCK

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
java_library(name = 'grid',
2+
srcs = glob([
3+
'internal/**/*.java',
4+
'web/**/*.java',
5+
]),
6+
deps = [
7+
':images',
8+
'//java/client/src/org/openqa/selenium:platform',
9+
'//java/client/src/org/openqa/selenium/io:io',
10+
'//java/client/src/org/openqa/selenium/net:net',
11+
'//java/client/src/org/openqa/selenium/remote:remote',
12+
'//java/server/src/org/openqa/grid/common:common',
13+
'//java/server/src/org/openqa/selenium/remote/server/log:log',
14+
'//java/server/src/org/openqa/selenium/server:server',
15+
'//third_party/java/apache-httpclient:apache-httpclient',
16+
'//third_party/java/gson:gson',
17+
'//third_party/java/guava-libraries:guava-libraries',
18+
'//third_party/java/jcip_annotations:jcip_annotations',
19+
'//third_party/java/jetty:jetty',
20+
'//third_party/java/jetty:jetty-for-rc',
21+
'//third_party/java/servlet-api:servlet-api',
22+
'//third_party/java/yaml:yaml',
23+
],
24+
visibility = [
25+
'//java/server/src/org/openqa/grid/selenium:classes',
26+
],
27+
)
28+
29+
prebuilt_jar(name = 'images',
30+
binary_jar = ':images-zip',
31+
)
32+
33+
zip(name = 'images-zip',
34+
srcs = glob(['images/*']),
35+
out = 'images.jar',
36+
)

Diff for: java/server/src/org/openqa/grid/common/BUCK

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
java_library(name = 'common',
2+
srcs = glob(['**/*.java']),
3+
deps = [
4+
':defaults',
5+
'//java/client/src/org/openqa/selenium:platform',
6+
'//java/client/src/org/openqa/selenium/net:net',
7+
'//java/client/src/org/openqa/selenium/remote:remote',
8+
'//java/server/src/org/openqa/selenium/server:server',
9+
'//third_party/java/gson:gson',
10+
'//third_party/java/guava-libraries:guava-libraries',
11+
],
12+
visibility = [
13+
'//java/server/src/org/openqa/grid:grid',
14+
'//java/server/src/org/openqa/grid/selenium:classes',
15+
],
16+
)
17+
18+
prebuilt_jar(name = 'defaults',
19+
binary_jar = ':defaults-zip',
20+
)
21+
22+
zip(name = 'defaults-zip',
23+
srcs = glob(['defaults/*']),
24+
out = 'defaults.jar',
25+
)

Diff for: java/server/src/org/openqa/grid/selenium/BUCK

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
java_binary(name = 'selenium',
2+
main_class = 'org.openqa.grid.selenium.GridLauncher',
3+
deps = [
4+
':classes',
5+
],
6+
)
7+
8+
java_library(name = 'classes',
9+
srcs = glob(['**/*.java']),
10+
deps = [
11+
'//java/client/src/com/thoughtworks/selenium/webdriven:webdriven',
12+
'//java/client/src/org/openqa/selenium:webdriver-api',
13+
'//java/client/src/org/openqa/selenium/chrome:chrome',
14+
'//java/client/src/org/openqa/selenium/firefox:firefox',
15+
'//java/client/src/org/openqa/selenium/remote:capabilities',
16+
'//java/server/src/org/openqa/grid/common:common',
17+
'//java/server/src/org/openqa/grid:grid',
18+
'//java/server/src/org/openqa/selenium/remote/server/log:log',
19+
'//java/server/src/org/openqa/selenium/server:server',
20+
'//third_party/java/gson:gson',
21+
'//third_party/java/servlet-api:servlet-api',
22+
],
23+
)

Diff for: java/server/src/org/openqa/selenium/remote/server/BUCK

+21-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ java_library(name = 'server',
3535
'rest/*.java',
3636
'xdrpc/*.java',
3737
]),
38+
resources = [
39+
':client',
40+
':hub',
41+
':style',
42+
],
3843
deps = [
3944
':sessions',
4045
'//java/client/src/org/openqa/selenium:codecs',
@@ -51,4 +56,19 @@ java_library(name = 'server',
5156
visibility = [
5257
'//java/server/src/org/openqa/selenium/server:server',
5358
],
54-
)
59+
)
60+
61+
export_file(name = 'client',
62+
src = '//javascript/remote:client',
63+
out = 'client.js',
64+
)
65+
66+
export_file(name = 'hub',
67+
src = '//javascript/remote:hub',
68+
out = 'hub.html',
69+
)
70+
71+
export_file(name = 'style',
72+
src = '//javascript/remote:style',
73+
out = 'style.css',
74+
)

Diff for: java/server/src/org/openqa/selenium/server/BUCK

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ java_library(name = 'server',
2929
'//third_party/java/gson:gson',
3030
'//third_party/java/jetty:jetty-for-rc',
3131
],
32+
visibility = [
33+
'//java/server/src/org/openqa/grid:grid',
34+
'//java/server/src/org/openqa/grid/common:common',
35+
'//java/server/src/org/openqa/grid/selenium:classes',
36+
],
3237
)
3338

3439
prebuilt_jar(name = 'resources',

Diff for: javascript/remote/BUCK

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
export_file(name = 'hub',
2+
src = 'hub.html',
3+
out = 'hub.html',
4+
visibility = [
5+
'//java/server/src/org/openqa/selenium/remote/server:hub',
6+
],
7+
)
8+
9+
export_file(name = 'style',
10+
src = 'style.css',
11+
out = 'style.css',
12+
visibility = [
13+
'//java/server/src/org/openqa/selenium/remote/server:style',
14+
],
15+
)
16+
17+
js_binary(name = 'client',
18+
srcs = glob(['*.js', 'ui/*.js',]),
19+
deps = [
20+
'//javascript/atoms:errors',
21+
'//javascript/webdriver:base',
22+
'//javascript/webdriver:http',
23+
'//javascript/webdriver:session',
24+
'//third_party/closure:closure',
25+
],
26+
flags = [
27+
'--jscomp_error=accessControls',
28+
'--jscomp_error=ambiguousFunctionDecl',
29+
'--jscomp_error=checkRegExp',
30+
'--jscomp_error=checkTypes',
31+
'--jscomp_error=checkVars',
32+
'--jscomp_error=constantProperty',
33+
'--jscomp_error=deprecated',
34+
'--jscomp_error=duplicateMessage',
35+
'--jscomp_error=es5Strict',
36+
'--jscomp_error=externsValidation',
37+
'--jscomp_error=fileoverviewTags',
38+
'--jscomp_error=globalThis',
39+
'--jscomp_error=invalidCasts',
40+
'--jscomp_error=missingProperties',
41+
'--jscomp_error=nonStandardJsDocs',
42+
'--jscomp_error=strictModuleDepCheck',
43+
'--jscomp_error=typeInvalidation',
44+
'--jscomp_error=undefinedVars',
45+
'--jscomp_error=unknownDefines',
46+
'--jscomp_error=uselessCode',
47+
'--jscomp_error=visibility',
48+
49+
'--third_party=false',
50+
51+
'--compilation_level=ADVANCED_OPTIMIZATIONS',
52+
],
53+
visibility = [
54+
'//java/server/src/org/openqa/selenium/remote/server:client',
55+
],
56+
)

Diff for: javascript/webdriver/BUCK

+70
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,40 @@ js_library(name = 'base',
1010
'//third_party/closure:closure',
1111
],
1212
visibility = [
13+
'//javascript/remote:client',
1314
'//javascript/safari-driver/...',
1415
],
1516
)
1617

18+
js_library(name = 'capabilities',
19+
srcs = [
20+
'capabilities.js',
21+
],
22+
deps = [
23+
':logging',
24+
':serializable',
25+
],
26+
)
27+
28+
js_library(name = 'events',
29+
srcs = [
30+
'events.js',
31+
],
32+
)
33+
34+
js_library(name = 'http',
35+
srcs = glob(['http/*.js']),
36+
deps = [
37+
':base',
38+
':promise',
39+
'//javascript/atoms:errors',
40+
'//third_party/closure:closure',
41+
],
42+
visibility = [
43+
'//javascript/remote:client',
44+
],
45+
)
46+
1747
js_library(name = 'key',
1848
srcs = [
1949
'key.js',
@@ -34,3 +64,43 @@ js_library(name = 'logging',
3464
'//javascript/...',
3565
],
3666
)
67+
68+
js_library(name = 'promise',
69+
srcs = [
70+
'promise.js',
71+
],
72+
deps = [
73+
':events',
74+
':stacktrace',
75+
'//third_party/closure:closure',
76+
],
77+
)
78+
79+
js_library(name = 'serializable',
80+
srcs = [
81+
'serializable.js',
82+
],
83+
deps = [
84+
],
85+
)
86+
87+
js_library(name = 'session',
88+
srcs = [
89+
'session.js',
90+
],
91+
deps = [
92+
':capabilities',
93+
],
94+
visibility = [
95+
'//javascript/remote:client',
96+
],
97+
)
98+
99+
js_library(name = 'stacktrace',
100+
srcs = [
101+
'stacktrace.js',
102+
],
103+
deps = [
104+
'//third_party/closure:closure',
105+
],
106+
)

Diff for: third_party/java/jcip_annotations/BUCK

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
prebuilt_jar(name = 'jcip_annotations',
2+
binary_jar = 'jcip-annotations-1.0.jar',
3+
visibility = [
4+
'//java/server/src/org/openqa/grid:grid',
5+
],
6+
)

Diff for: third_party/java/jetty/BUCK

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ prebuilt_jar(name = 'jetty',
66
],
77
visibility = [
88
'//java/client/test/org/openqa/selenium/environment:environment',
9+
'//java/server/src/org/openqa/grid:grid',
910
],
1011
)
1112

@@ -19,5 +20,6 @@ prebuilt_jar(name = 'jetty-for-rc',
1920
],
2021
visibility = [
2122
'//java/server/src/org/openqa/selenium/server:server',
23+
'//java/server/src/org/openqa/grid:grid',
2224
],
2325
)

Diff for: third_party/java/servlet-api/BUCK

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ prebuilt_jar(name = 'servlet-api',
22
binary_jar = 'servlet-api-2.5-6.1.9.jar',
33
visibility = [
44
'//java/client/test/org/openqa/selenium/environment:environment',
5+
'//java/server/src/org/openqa/grid:grid',
6+
'//java/server/src/org/openqa/grid/selenium:classes',
57
'//java/server/src/org/openqa/selenium/remote/server:server',
68
'//third_party/java/jetty:jetty',
79
'//third_party/java/jetty:jetty-for-rc',

Diff for: third_party/java/yaml/BUCK

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
prebuilt_jar(name = 'yaml',
2+
binary_jar = 'snakeyaml-1.8.jar',
3+
visibility = [
4+
'//java/server/src/org/openqa/grid:grid',
5+
],
6+
)
7+

0 commit comments

Comments
 (0)