Skip to content

Commit

Permalink
Fix the Buck build for the safaridriver.
Browse files Browse the repository at this point in the history
The resulting extension isn't quite ready for action, but it
moves us closer. I need to figure out how to build a
js_module_binary with Buck before we can move forward. How
hard can it be?
  • Loading branch information
shs96c committed Oct 13, 2015
1 parent f62d496 commit 3d364f6
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 8 deletions.
129 changes: 129 additions & 0 deletions javascript/safari-driver/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,132 @@ js_binary(name = 'client',
'//java/client/src/org/openqa/selenium/safari:client',
],
)

# Binary for the debug/logging window.
js_binary(
name = 'debug',
srcs = [
'deps.js',
'debug/debug.js',
],
defines = [
'goog.userAgent.ASSUME_WEBKIT=true',
'goog.userAgent.product.ASSUME_SAFARI=true',
'safaridriver.message.ORIGIN=1',
'safaridriver.message.FORCE_SYNCHRONOUS_PROXY_SEND=true',
],
externs = [
'externs/common.js',
'externs/webcontent.js',
],
flags = [
'--jscomp_error=accessControls',
'--jscomp_error=ambiguousFunctionDecl',
'--jscomp_error=checkRegExp',
'--jscomp_error=checkTypes',
'--jscomp_error=checkVars',
'--jscomp_error=constantProperty',
'--jscomp_error=deprecated',
'--jscomp_error=duplicateMessage',
'--jscomp_error=es5Strict',
'--jscomp_error=externsValidation',
'--jscomp_error=fileoverviewTags',
'--jscomp_error=globalThis',
'--jscomp_error=invalidCasts',
'--jscomp_error=missingProperties',
'--jscomp_error=nonStandardJsDocs',
'--jscomp_error=strictModuleDepCheck',
'--jscomp_error=typeInvalidation',
'--jscomp_error=undefinedVars',
'--jscomp_error=unknownDefines',
'--jscomp_error=uselessCode',
'--jscomp_error=visibility',

"--output_wrapper='%output%;safaridriver.debug.init();'",
'--third_party=false',
],
deps = [
':command',
':common',
'//javascript/safari-driver/message:message',
'//javascript/webdriver:base',
'//javascript/webdriver:capabilities',
'//javascript/webdriver:session',
'//javascript/webdriver:webdriver',
'//third_party/closure:closure',
],
)

# The global extension script.
js_binary(
name = 'extension',
srcs = [
'deps.js',
'extension/commands.js',
'extension/extension.js',
'extension/logdb.js',
'extension/server.js',
'extension/session.js',
'extension/tab.js',
'extension/tabmanager.js',
],
defines = [
'goog.userAgent.ASSUME_WEBKIT=true',
'goog.userAgent.product.ASSUME_SAFARI=true',
'safaridriver.message.ORIGIN=0'
],
externs = [
'externs/common.js',
'externs/extension.js',
],
flags = [
'--jscomp_error=accessControls',
'--jscomp_error=ambiguousFunctionDecl',
'--jscomp_error=checkRegExp',
'--jscomp_error=checkTypes',
'--jscomp_error=checkVars',
'--jscomp_error=constantProperty',
'--jscomp_error=deprecated',
'--jscomp_error=duplicateMessage',
'--jscomp_error=es5Strict',
'--jscomp_error=externsValidation',
'--jscomp_error=fileoverviewTags',
'--jscomp_error=globalThis',
'--jscomp_error=invalidCasts',
'--jscomp_error=missingProperties',
'--jscomp_error=nonStandardJsDocs',
'--jscomp_error=strictModuleDepCheck',
'--jscomp_error=typeInvalidation',
'--jscomp_error=undefinedVars',
'--jscomp_error=unknownDefines',
'--jscomp_error=uselessCode',
'--jscomp_error=visibility',

"--output_wrapper='%output%;safaridriver.extension.init();'",
'--third_party=false',
],
deps = [
':common',
'//javascript/safari-driver/message:message',
'//javascript/webdriver:webdriver',
'//third_party/closure:closure',
],
)

# Packages everything up into a .safariextension folder that can be loaded by
# Safari's Extension Builder.
folder(
name = 'safari-driver',
out = 'SafariDriver.safariextension',
srcs = [
':debug',
':extension',
# ':injected',
# ':page',
'Info.plist',
'icon.png',
'toolbar.png',
'debug/log.html',
'extension/extension.html',
],
)
8 changes: 0 additions & 8 deletions javascript/safari-driver/prebuilt/BUCK

This file was deleted.

63 changes: 63 additions & 0 deletions javascript/webdriver/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ js_library(name = 'base',
],
)

js_library(name = 'button',
srcs = [
'button.js',
],
)

js_library(name = 'capabilities',
srcs = [
'capabilities.js',
Expand All @@ -23,6 +29,9 @@ js_library(name = 'capabilities',
':logging',
':serializable',
],
visibility = [
'//javascript/safari-driver/...'
],
)

js_library(name = 'events',
Expand Down Expand Up @@ -54,6 +63,15 @@ js_library(name = 'key',
],
)

js_library(name = 'locators',
srcs = [
'locators.js',
],
deps = [
'//third_party/closure:closure',
],
)

js_library(name = 'logging',
srcs = [
'logging.js',
Expand All @@ -77,6 +95,19 @@ js_library(name = 'promise',
],
)

js_library(name = 'sequence',
srcs = [
'actionsequence.js',
'touchsequence.js',
],
deps = [
':base',
':button',
':key',
'//third_party/closure:closure',
],
)

js_library(name = 'serializable',
srcs = [
'serializable.js',
Expand All @@ -94,6 +125,7 @@ js_library(name = 'session',
],
visibility = [
'//javascript/remote:client',
'//javascript/safari-driver/...'
],
)

Expand All @@ -105,3 +137,34 @@ js_library(name = 'stacktrace',
'//third_party/closure:closure',
],
)

js_library(name = 'until',
srcs = [
'until.js',
],
deps = [
':locators',
'//javascript/atoms:errors',
'//third_party/closure:closure',
],
)

js_library(name = 'webdriver',
srcs = [
'webdriver.js',
],
deps = [
':base',
':key',
':locators',
':logging',
':sequence',
':session',
':until',
'//javascript/atoms:errors',
'//third_party/closure:closure',
],
visibility = [
'//javascript/safari-driver/...'
],
)

0 comments on commit 3d364f6

Please sign in to comment.