Skip to content

Commit

Permalink
Start using the skylark parser where possible
Browse files Browse the repository at this point in the history
This is the low-hanging fruit, but starts to remove the need
for python to be installed on developer machines when building
Selenium using buck.
  • Loading branch information
shs96c committed Sep 27, 2017
1 parent 0eef6a1 commit 40a78e4
Show file tree
Hide file tree
Showing 116 changed files with 220 additions and 93 deletions.
12 changes: 12 additions & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
src_roots = /java/client/src, /java/client/test, /java/server/src, /java/server/test
source_level = 8
target_level = 8
jar_spool_mode = direct_to_jar
abi_generation_mode = source_with_deps
compile_against_abis = true

[project]
ignore = \
Expand All @@ -11,9 +14,18 @@
java/client/build, \
java/server/build

[build]
metadata_storage = sqlite

[cache]
mode = dir

[parser]
polyglot_parsing_enabled = true

[resources]
resource_aware_scheduling_enabled = true

[test]
# Maximum timeout of 10 minutes per test (since each suite counts as a test)
timeout = 600000
Expand Down
2 changes: 0 additions & 2 deletions SELENIUM_VERSION

This file was deleted.

3 changes: 2 additions & 1 deletion dotnet/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//dotnet/SELENIUM_DOTNET_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//dotnet:selenium-dotnet-version.bzl", "SE_VERSION")

export_file(
name = 'keyfile',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK

SE_VERSION = '3.6.0'
ASSEMBLY_VERSION = '3.6.0.0'
43 changes: 22 additions & 21 deletions dotnet/src/support/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//dotnet/SELENIUM_DOTNET_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//dotnet:selenium-dotnet-version.bzl", "SE_VERSION", "ASSEMBLY_VERSION")

genrule(
name = 'net35',
Expand Down Expand Up @@ -41,16 +42,16 @@ genrule(
':netstandard2.0'
],
cmd_exe =
'setlocal EnableDelayedExpansion && '\
'(if not exist %OUT% mkdir %OUT%) && '\
'for %%G in (%SRCS%) do ('\
'set target_dir=%%G&& '\
'for %%H in (!target_dir!) do ('\
'set platform_moniker=%%~nxH&& '\
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && '\
'copy !target_dir!\\WebDriver.Support.dll %OUT%\\!platform_moniker! &&'\
'copy !target_dir!\\WebDriver.Support.xml %OUT%\\!platform_moniker!'\
')'\
'setlocal EnableDelayedExpansion && ' +
'(if not exist %OUT% mkdir %OUT%) && ' +
'for %%G in (%SRCS%) do (' +
'set target_dir=%%G&& ' +
'for %%H in (!target_dir!) do (' +
'set platform_moniker=%%~nxH&& ' +
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && ' +
'copy !target_dir!\\WebDriver.Support.dll %OUT%\\!platform_moniker! &&' +
'copy !target_dir!\\WebDriver.Support.xml %OUT%\\!platform_moniker!' +
')' +
')',
out = 'lib'
)
Expand Down Expand Up @@ -100,16 +101,16 @@ genrule(
':netstandard2.0_strongnamed'
],
cmd_exe =
'setlocal EnableDelayedExpansion && '\
'(if not exist %OUT% mkdir %OUT%) && '\
'for %%G in (%SRCS%) do ('\
'set target_dir=%%G&& '\
'for %%H in (!target_dir!) do ('\
'set platform_moniker=%%~nxH&& '\
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && '\
'copy !target_dir!\\WebDriver.Support.dll %OUT%\\!platform_moniker! &&'\
'copy !target_dir!\\WebDriver.Support.xml %OUT%\\!platform_moniker!'\
')'\
'setlocal EnableDelayedExpansion && ' +
'(if not exist %OUT% mkdir %OUT%) && ' +
'for %%G in (%SRCS%) do (' +
'set target_dir=%%G&& ' +
'for %%H in (!target_dir!) do (' +
'set platform_moniker=%%~nxH&& ' +
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && ' +
'copy !target_dir!\\WebDriver.Support.dll %OUT%\\!platform_moniker! &&' +
'copy !target_dir!\\WebDriver.Support.xml %OUT%\\!platform_moniker!' +
')' +
')',
out = 'lib'
)
Expand Down
67 changes: 34 additions & 33 deletions dotnet/src/webdriver/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//dotnet/SELENIUM_DOTNET_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//dotnet:selenium-dotnet-version.bzl", "SE_VERSION", "ASSEMBLY_VERSION")

genrule(
name = 'net35',
Expand Down Expand Up @@ -57,22 +58,22 @@ genrule(
':netstandard2.0'
],
cmd_exe =
'setlocal EnableDelayedExpansion && '\
'(if not exist %OUT% mkdir %OUT%) && '\
'for %%G in (%SRCS%) do ('\
'set target_dir=%%G&& '\
'for %%H in (!target_dir!) do ('\
'set platform_moniker=%%~nxH&& '\
'if \"!platform_moniker!\"==\"netstandard2.0\" ('\
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && '\
'copy !target_dir!\\WebDriver.dll %OUT%\\!platform_moniker! &&'\
'copy !target_dir!\\WebDriver.xml %OUT%\\!platform_moniker!'\
') else ('\
'set merge_args=/v4 /xmldocs /internalize /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll&& '\
'(if \"!platform_moniker!\"==\"net35\" set merge_args=/v2 /xmldocs /internalize /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll)&& '\
'$(exe //third_party/dotnet/ilrepack:ilrepack) !merge_args!'\
')'\
')'\
'setlocal EnableDelayedExpansion && ' +
'(if not exist %OUT% mkdir %OUT%) && ' +
'for %%G in (%SRCS%) do (' +
'set target_dir=%%G&& ' +
'for %%H in (!target_dir!) do (' +
'set platform_moniker=%%~nxH&& ' +
'if \"!platform_moniker!\"==\"netstandard2.0\" (' +
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && ' +
'copy !target_dir!\\WebDriver.dll %OUT%\\!platform_moniker! &&' +
'copy !target_dir!\\WebDriver.xml %OUT%\\!platform_moniker!' +
') else (' +
'set merge_args=/v4 /xmldocs /internalize /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll&& ' +
'(if \"!platform_moniker!\"==\"net35\" set merge_args=/v2 /xmldocs /internalize /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll)&& ' +
'$(exe //third_party/dotnet/ilrepack:ilrepack) !merge_args!' +
')' +
')' +
')',
out = 'lib'
)
Expand Down Expand Up @@ -130,22 +131,22 @@ genrule(
':netstandard2.0_strongnamed'
],
cmd_exe =
'setlocal EnableDelayedExpansion && '\
'(if not exist %OUT% mkdir %OUT%) && '\
'for %%G in (%SRCS%) do ('\
'set target_dir=%%G&& '\
'for %%H in (!target_dir!) do ('\
'set platform_moniker=%%~nxH&& '\
'if \"!platform_moniker!\"==\"netstandard2.0\" ('\
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && '\
'copy !target_dir!\\WebDriver.dll %OUT%\\!platform_moniker! &&'\
'copy !target_dir!\\WebDriver.xml %OUT%\\!platform_moniker!'\
') else ('\
'set merge_args=/v4 /xmldocs /internalize /keyfile=$(location //dotnet:keyfile) /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll&& '\
'(if \"!platform_moniker!\"==\"net35\" set merge_args=/v2 /xmldocs /internalize /keyfile=$(location //dotnet:keyfile) /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll)&& '\
'$(exe //third_party/dotnet/ilrepack:ilrepack) !merge_args!'\
')'\
')'\
'setlocal EnableDelayedExpansion && ' +
'(if not exist %OUT% mkdir %OUT%) && ' +
'for %%G in (%SRCS%) do (' +
'set target_dir=%%G&& ' +
'for %%H in (!target_dir!) do (' +
'set platform_moniker=%%~nxH&& ' +
'if \"!platform_moniker!\"==\"netstandard2.0\" (' +
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && ' +
'copy !target_dir!\\WebDriver.dll %OUT%\\!platform_moniker! &&' +
'copy !target_dir!\\WebDriver.xml %OUT%\\!platform_moniker!' +
') else (' +
'set merge_args=/v4 /xmldocs /internalize /keyfile=$(location //dotnet:keyfile) /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll&& ' +
'(if \"!platform_moniker!\"==\"net35\" set merge_args=/v2 /xmldocs /internalize /keyfile=$(location //dotnet:keyfile) /lib=%%H /out=%OUT%\\!platform_moniker!\\WebDriver.dll !target_dir!\\WebDriver.dll !target_dir!\\Newtonsoft.Json.dll)&& ' +
'$(exe //third_party/dotnet/ilrepack:ilrepack) !merge_args!' +
')' +
')' +
')',
out = 'lib'
)
Expand Down
43 changes: 22 additions & 21 deletions dotnet/src/webdriverbackedselenium/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//dotnet/SELENIUM_DOTNET_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//dotnet:selenium-dotnet-version.bzl", "SE_VERSION", "ASSEMBLY_VERSION")

genrule(
name = 'net35',
Expand Down Expand Up @@ -41,16 +42,16 @@ genrule(
':netstandard2.0'
],
cmd_exe =
'setlocal EnableDelayedExpansion && '\
'(if not exist %OUT% mkdir %OUT%) && '\
'for %%G in (%SRCS%) do ('\
'set target_dir=%%G&& '\
'for %%H in (!target_dir!) do ('\
'set platform_moniker=%%~nxH&& '\
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && '\
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.dll %OUT%\\!platform_moniker! &&'\
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.xml %OUT%\\!platform_moniker!'\
')'\
'setlocal EnableDelayedExpansion && ' +
'(if not exist %OUT% mkdir %OUT%) && ' +
'for %%G in (%SRCS%) do (' +
'set target_dir=%%G&& ' +
'for %%H in (!target_dir!) do (' +
'set platform_moniker=%%~nxH&& ' +
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && ' +
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.dll %OUT%\\!platform_moniker! &&' +
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.xml %OUT%\\!platform_moniker!' +
')' +
')',
out = 'lib'
)
Expand Down Expand Up @@ -100,16 +101,16 @@ genrule(
':netstandard2.0_strongnamed'
],
cmd_exe =
'setlocal EnableDelayedExpansion && '\
'(if not exist %OUT% mkdir %OUT%) && '\
'for %%G in (%SRCS%) do ('\
'set target_dir=%%G&& '\
'for %%H in (!target_dir!) do ('\
'set platform_moniker=%%~nxH&& '\
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && '\
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.dll %OUT%\\!platform_moniker! &&'\
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.xml %OUT%\\!platform_moniker!'\
')'\
'setlocal EnableDelayedExpansion && ' +
'(if not exist %OUT% mkdir %OUT%) && ' +
'for %%G in (%SRCS%) do (' +
'set target_dir=%%G&& ' +
'for %%H in (!target_dir!) do (' +
'set platform_moniker=%%~nxH&& ' +
'(if not exist %OUT%\\!platform_moniker! mkdir %OUT%\\!platform_moniker!) && ' +
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.dll %OUT%\\!platform_moniker! &&' +
'copy !target_dir!\\Selenium.WebDriverBackedSelenium.xml %OUT%\\!platform_moniker!' +
')' +
')',
out = 'lib'
)
Expand Down
1 change: 1 addition & 0 deletions java/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
export_file(
name = 'changelog',
out = "CHANGELOG",
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/com/thoughtworks/selenium/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(name = 'api',
srcs = [
Expand Down
1 change: 1 addition & 0 deletions java/client/src/com/thoughtworks/selenium/condition/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK

java_library(name = 'condition',
srcs = glob(['*.java']),
Expand Down
1 change: 0 additions & 1 deletion java/client/src/com/thoughtworks/selenium/webdriven/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

java_library(name = 'webdriven',
srcs = [
'CompoundMutator.java',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK

java_library(name = 'commands',
srcs = glob(['*.java']),
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

build_stamp(name = 'build-stamp',
kind = 'manifest',
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/chrome/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(
name = 'chrome',
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/edge/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(
name = 'edge',
Expand Down
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/firefox/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(name = 'firefox',
maven_coords = 'org.seleniumhq.selenium:selenium-firefox-driver:jar:' + SE_VERSION,
Expand Down Expand Up @@ -39,4 +40,4 @@ export_file(
name = 'amd64',
src = '//cpp/prebuilt:noblur64',
out = 'amd64/x_ignore_nofocus.so'
)
)
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/ie/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(name = 'ie',
maven_coords = 'org.seleniumhq.selenium:selenium-ie-driver:' + SE_VERSION,
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/interactions/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
java_library(name = 'interactions',
srcs = [
'Actions.java',
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/io/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
java_library(
name = 'io',
srcs = glob(['*.java']),
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/lift/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(name = 'lift',
srcs = glob(['**/*.java']),
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/logging/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
API_SRCS = [
'Logs.java',
'LogEntries.java',
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/net/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
java_library(
name = 'net',
srcs = glob(['*.java']),
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/opera/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(
name = 'opera',
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/os/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
java_library(
name = 'os',
srcs = glob(['*.java']),
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/remote/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(
name = 'api',
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/safari/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(name = 'safari',
maven_coords = 'org.seleniumhq.selenium:selenium-safari-driver:' + SE_VERSION,
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/security/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
java_library(name = 'security',
srcs = glob(['*.java']),
deps = [
Expand Down
4 changes: 3 additions & 1 deletion java/client/src/org/openqa/selenium/support/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include_defs('//SELENIUM_VERSION')
# BUILD FILE SYNTAX: SKYLARK
# BUILD FILE SYNTAX: SKYLARK
load("//:selenium-version.bzl", "SE_VERSION")

java_library(name = 'support',
srcs = [
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/support/events/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
java_library(name = 'events',
srcs = glob(['**/*.java']),
deps = [
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/support/ui/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK
java_library(name = 'clock',
srcs = [
'Clock.java',
Expand Down
Loading

0 comments on commit 40a78e4

Please sign in to comment.