Skip to content

Commit

Permalink
Simplify the core selenium target to avoid a split package
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jul 8, 2018
1 parent a786624 commit 3962e3d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 234 deletions.
146 changes: 13 additions & 133 deletions java/client/src/org/openqa/selenium/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@ load("//:selenium-version.bzl", "SE_VERSION")

java_library(name = 'selenium',
exported_deps = [
':beta',
':core',
':exceptions',
':platform',
':primitives',
'//java/client/src/org/openqa/selenium/interactions:interactions',
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/src/org/openqa/selenium/logging:api',
'//java/client/src/org/openqa/selenium/logging:logging',
'//java/client/src/org/openqa/selenium/net:net',
'//java/client/src/org/openqa/selenium/os:os',
],
Expand All @@ -25,145 +18,32 @@ export_file(
visibility = ['PUBLIC'],
)

java_library(name = 'core',
java_library(
name = 'core',
maven_coords = 'org.seleniumhq.selenium:selenium-api:' + SE_VERSION,
maven_pom_template = ':template-pom',
srcs = [
'AbstractCapabilities.java',
'Alert.java',
'By.java',
'Capabilities.java',
'Cookie.java',
'ContextAware.java',
'HasCapabilities.java',
'JavascriptExecutor.java',
'DeviceRotation.java',
'Keys.java',
'ImmutableCapabilities.java',
'MutableCapabilities.java',
'OutputType.java',
'PageLoadStrategy.java',
'Proxy.java',
'Rotatable.java',
'ScreenOrientation.java',
'SearchContext.java',
'TakesScreenshot.java',
'UnexpectedAlertBehaviour.java',
'WebDriver.java',
'WebElement.java',
'internal/ElementScrollBehavior.java',
'internal/HasIdentity.java',
'internal/Locatable.java',
'internal/WrapsDriver.java',
'internal/WrapsElement.java',
] + glob([
'html5/*.java',
'internal/FindsBy*.java',
'mobile/*.java',
srcs = glob([
'*.java',
'html5/*.java',
'internal/*.java',
'interactions/**/*.java',
'logging/**/*.java',
'mobile/*.java',
]),
exported_deps = [
# This list of dependencies MUST NOT include anything other than code
# from the selenium project. That means no guava and no gson.
':beta',
':exceptions',
':platform',
':primitives',
'//java/client/src/org/openqa/selenium/interactions:core',
'//java/client/src/org/openqa/selenium/interactions:exceptions',
'//java/client/src/org/openqa/selenium/logging:api',
manifest_file = ':manifest',
deps = [
# Nothing from third party
],
visibility = [
'PUBLIC',
],
]
)

genrule(name = 'manifest',
out = 'manifest.mf',
cmd = 'python -c "print(\'\\n\\nName: Build-Info\\nSelenium-Version: {}\\n\\n\')" >> $OUT'.format(SE_VERSION),
)

java_library(name = 'beta',
srcs = [ 'Beta.java' ],
visibility = [
'//java/client/src/org/openqa/selenium/interactions:interactions',
'//java/client/src/org/openqa/selenium/logging:api',
'//java/client/src/org/openqa/selenium/logging:logging',
'//java/client/src/org/openqa/selenium/os:os',
],
)

java_library(name = 'exceptions',
srcs = [
'ElementClickInterceptedException.java',
'ElementNotInteractableException.java',
'ElementNotSelectableException.java',
'ElementNotVisibleException.java',
'ImeActivationFailedException.java',
'ImeNotAvailableException.java',
'InvalidArgumentException.java',
'InvalidCookieDomainException.java',
'InvalidElementStateException.java',
'InvalidSelectorException.java',
'JavascriptException.java',
'NoAlertPresentException.java',
'NoSuchCookieException.java',
'NoSuchElementException.java',
'NoSuchFrameException.java',
'NoSuchSessionException.java',
'NoSuchWindowException.java',
'NotFoundException.java',
'SessionNotCreatedException.java',
'ScriptTimeoutException.java',
'StaleElementReferenceException.java',
'TimeoutException.java',
'UnableToSetCookieException.java',
'UnhandledAlertException.java',
'UnsupportedCommandException.java',
'WebDriverException.java',
'internal/BuildInfo.java',
],
manifest_file = ':manifest',
deps = [
':beta',
],
visibility = [
'//java/client/src/org/openqa/selenium/interactions:exceptions',
'//java/client/src/org/openqa/selenium/interactions:interactions',
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/src/org/openqa/selenium/logging:logging',
'//java/client/src/org/openqa/selenium/net:net',
'//java/client/src/org/openqa/selenium/os:os',
'//java/client/test/org/openqa/selenium/testing:helpers',
],
)

java_library(
name = 'platform',
srcs = [
'Architecture.java',
'Platform.java',
],
deps = [
':exceptions',
],
visibility = [
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/src/org/openqa/selenium/net:net',
'//java/client/src/org/openqa/selenium/os:os',
],
)

java_library(name = 'primitives',
srcs = [
'Dimension.java',
'Point.java',
'Rectangle.java',
],
visibility = [
'//java/client/src/org/openqa/selenium/interactions:core',
],
)

java_library(
name = 'client-combined',
maven_coords = 'org.seleniumhq.selenium:selenium-java:' + SE_VERSION,
Expand Down
61 changes: 0 additions & 61 deletions java/client/src/org/openqa/selenium/interactions/BUCK

This file was deleted.

3 changes: 1 addition & 2 deletions java/client/src/org/openqa/selenium/io/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ java_library(
name = 'io',
srcs = glob(['*.java']),
deps = [
'//java/client/src/org/openqa/selenium:exceptions',
'//java/client/src/org/openqa/selenium:platform',
'//java/client/src/org/openqa/selenium:core',
],
visibility = [
'//java/client/src/org/openqa/selenium:selenium',
Expand Down
32 changes: 0 additions & 32 deletions java/client/src/org/openqa/selenium/logging/BUCK

This file was deleted.

3 changes: 1 addition & 2 deletions java/client/src/org/openqa/selenium/net/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ java_library(
name = 'net',
srcs = glob(['*.java']),
deps = [
'//java/client/src/org/openqa/selenium:exceptions',
'//java/client/src/org/openqa/selenium:platform',
'//java/client/src/org/openqa/selenium:core',
'//third_party/java/guava:guava',
],
visibility = [
Expand Down
4 changes: 1 addition & 3 deletions java/client/src/org/openqa/selenium/os/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ java_library(
name = 'os',
srcs = glob(['*.java']),
deps = [
'//java/client/src/org/openqa/selenium:beta',
'//java/client/src/org/openqa/selenium:exceptions',
'//java/client/src/org/openqa/selenium:platform',
'//java/client/src/org/openqa/selenium:core',
'//java/client/src/org/openqa/selenium/io:io',
'//third_party/java/commons:commons-exec',
'//third_party/java/guava:guava',
Expand Down
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/testing/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ java_library(name = 'helpers',
'JreSystemProperty.java',
],
deps = [
'//java/client/src/org/openqa/selenium:exceptions',
'//java/client/src/org/openqa/selenium:core',
'//third_party/java/guava:guava',
],
visibility = [
Expand Down

0 comments on commit 3962e3d

Please sign in to comment.