From d32323ebc6917d5d2660aea842c7d31bfb0d156c Mon Sep 17 00:00:00 2001 From: Simon Stewart Date: Sun, 5 Jan 2014 18:29:09 +0000 Subject: [PATCH] Minor decomplexification of the selenium emulation build scripts. Notably, this change pulls the generated JS files into the com.thoughtworks.selenium.webdriven package rather than sub-packages. --- .../selenium/webdriven/JavascriptLibrary.java | 6 +- .../selenium/webdriven/build.desc | 69 ++++--------------- .../client/src/org/openqa/selenium/build.desc | 4 +- 3 files changed, 19 insertions(+), 60 deletions(-) diff --git a/java/client/src/com/thoughtworks/selenium/webdriven/JavascriptLibrary.java b/java/client/src/com/thoughtworks/selenium/webdriven/JavascriptLibrary.java index 903c5b1904799..fa83a5617ab25 100644 --- a/java/client/src/com/thoughtworks/selenium/webdriven/JavascriptLibrary.java +++ b/java/client/src/com/thoughtworks/selenium/webdriven/JavascriptLibrary.java @@ -34,13 +34,13 @@ public class JavascriptLibrary { static final String PREFIX = "/" + JavascriptLibrary.class.getPackage() - .getName().replace(".", "/") + "/selenium_atoms/"; + .getName().replace(".", "/") + "/"; private final ConcurrentHashMap scripts = new ConcurrentHashMap(); private static final String injectableSelenium = - "/com/thoughtworks/selenium/webdriven/scripts/injectableSelenium.js"; + "/com/thoughtworks/selenium/webdriven/injectableSelenium.js"; private static final String htmlUtils = - "/com/thoughtworks/selenium/webdriven/scripts/htmlutils.js"; + "/com/thoughtworks/selenium/webdriven/htmlutils.js"; /** * Loads the named Selenium script and returns it wrapped in an anonymous function. diff --git a/java/client/src/com/thoughtworks/selenium/webdriven/build.desc b/java/client/src/com/thoughtworks/selenium/webdriven/build.desc index b8ba85b9bd250..e8ea3543d2b0a 100644 --- a/java/client/src/com/thoughtworks/selenium/webdriven/build.desc +++ b/java/client/src/com/thoughtworks/selenium/webdriven/build.desc @@ -4,8 +4,21 @@ java_library(name = "webdriven", ":emulation-api", ], embedded = [ - ":scripts", - ":selenium_atoms", + "htmlutils.js", + "injectableSelenium.js", + "//javascript/selenium-atoms:findElement", + "//javascript/selenium-atoms:findOption", + "//javascript/selenium-atoms:fireEvent", + "//javascript/selenium-atoms:fireEventAt", + "//javascript/selenium-atoms:getAttribute", + "//javascript/selenium-atoms:getText", + "//javascript/selenium-atoms:linkLocator", + "//javascript/selenium-atoms:isElementPresent", + "//javascript/selenium-atoms:isSomethingSelected", + "//javascript/selenium-atoms:isTextPresent", + "//javascript/selenium-atoms:isVisible", + "//javascript/selenium-atoms:type", + "//third_party/js/sizzle:sizzle", ]) @@ -25,55 +38,3 @@ java_library(name = "emulation-api", "//java/client/src/org/openqa/selenium:webdriver-api", "//third_party/java/guava-libraries", ]) - - -export_file(name = "injectableSelenium", - srcs = [ "injectableSelenium.js" ]) - - -export_file(name = "htmlutils", - srcs = [ "htmlutils.js" ]) - - -folder(name = "scripts", - deps = [ - "injectableSelenium.js", - "htmlutils.js", - ], - outs = [ - "scripts/injectableSelenium.js", - "scripts/htmlutils.js", - ]) - - -folder(name = "selenium_atoms", - deps = [ - "//javascript/selenium-atoms:findElement.js", - "//javascript/selenium-atoms:findOption.js", - "//javascript/selenium-atoms:fireEvent.js", - "//javascript/selenium-atoms:fireEventAt.js", - "//javascript/selenium-atoms:getAttribute.js", - "//javascript/selenium-atoms:getText.js", - "//javascript/selenium-atoms:linkLocator.js", - "//javascript/selenium-atoms:isElementPresent.js", - "//javascript/selenium-atoms:isSomethingSelected.js", - "//javascript/selenium-atoms:isTextPresent.js", - "//javascript/selenium-atoms:isVisible.js", - "//javascript/selenium-atoms:type.js", - "//third_party/js/sizzle:sizzle.js", - ], - outs = [ - "selenium_atoms/findElement.js", - "selenium_atoms/findOption.js", - "selenium_atoms/fireEvent.js", - "selenium_atoms/fireEventAt.js", - "selenium_atoms/getAttribute.js", - "selenium_atoms/getText.js", - "selenium_atoms/linkLocator.js", - "selenium_atoms/isElementPresent.js", - "selenium_atoms/isSomethingSelected.js", - "selenium_atoms/isTextPresent.js", - "selenium_atoms/isVisible.js", - "selenium_atoms/type.js", - "selenium_atoms/sizzle.js", - ]) diff --git a/java/client/src/org/openqa/selenium/build.desc b/java/client/src/org/openqa/selenium/build.desc index 35ef9c3d632e9..30d17e460e69e 100644 --- a/java/client/src/org/openqa/selenium/build.desc +++ b/java/client/src/org/openqa/selenium/build.desc @@ -112,10 +112,8 @@ java_library(name = "webdriver-backed-selenium", deps = [ ":selenium-api", "//java/client/src/com/thoughtworks/selenium", + "//java/client/src/com/thoughtworks/selenium/webdriven", "//java/client/src/org/openqa/selenium/internal/seleniumemulation", - ], - embedded = [ - "//java/client/src/com/thoughtworks/selenium/webdriven:scripts", ]) java_library(name = "client-combined",