Skip to content

Commit

Permalink
Build the RC server using Buck.
Browse files Browse the repository at this point in the history
First pass at build the RC server with Buck.
  • Loading branch information
shs96c committed Jan 12, 2015
1 parent a293958 commit d0ef377
Show file tree
Hide file tree
Showing 20 changed files with 206 additions and 11 deletions.
1 change: 1 addition & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
remote = //java/client/src/org/openqa/selenium/remote:remote
safari = //java/client/src/org/openqa/selenium/safari:safari

selenium-java = //java/client/src/org/openqa/selenium:selenium-java
leg-rc = //java/client/src/com/thoughtworks/selenium:legacy-selenium-client
1 change: 1 addition & 0 deletions java/client/src/com/thoughtworks/selenium/webdriven/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ java_library(name = 'webdriven',
'//java/client/test/org/openqa/selenium/v1:tests',
'//java/client/test/org/openqa/selenium/v1/internal/seleniumemulation:LargeTests',
'//java/client/test/org/openqa/selenium/v1/internal/seleniumemulation:tests',
'//java/server/src/org/openqa/selenium/server:server',
],
)

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
Expand Up @@ -48,7 +48,8 @@ java_library(name = 'core',
'internal/WrapsElement.java',
] + glob([
'html5/*.java',
'internal/FindsBy*.java'
'internal/FindsBy*.java',
'mobile/*.java',
]),
deps = [
':beta',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ java_library(name = 'locators',
],
visibility = [
'//java/client/src/org/openqa/selenium/safari:safari',
'//java/server/src/org/openqa/selenium/server:server',
],
)
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/os/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ java_library(
'//java/client/src/org/openqa/selenium/safari:safari',
'//java/client/test/org/openqa/selenium:tests',
'//java/client/test/org/openqa/selenium/testing/drivers:drivers',
'//java/server/src/org/openqa/selenium/server:server',
],
)

2 changes: 0 additions & 2 deletions java/client/src/org/openqa/selenium/remote/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ java_library(name = "common",
"ErrorHandler.java",
"JsonException.java",
"JsonToBeanConverter.java",
"PropertyMunger.java",
"Responses.java",
"ScreenshotException.java",
"SessionNotFoundException.java",
"SimplePropertyDescriptor.java",
Expand Down
11 changes: 11 additions & 0 deletions java/server/src/cybervillains/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
java_library(name = 'cybervillains',
srcs = glob(['ca/*.java']),
deps = [
'//java/server/src/org/openqa/selenium/server/security:security',
'//third_party/java/bouncycastle:bouncycastle',
],
visibility = [
'//java/server/src/org/openqa/selenium/server:server',
],
)

54 changes: 54 additions & 0 deletions java/server/src/org/openqa/selenium/remote/server/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
java_library(name = 'sessions',
srcs = [
'DriverSessions.java',
'KnownElements.java',
'Session.java',
],
deps = [
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/src/org/openqa/selenium/remote:api',
'//third_party/java/commons-logging:commons-logging',
'//third_party/java/guava-libraries:guava-libraries',
],
visibility = [
'//java/server/src/org/openqa/selenium/server:server',
],
)

java_library(name = 'server',
srcs = [
'CapabilitiesComparator.java',
'DefaultDriverFactory.java',
'DefaultDriverProvider.java',
'DefaultDriverSessions.java',
'DefaultSession.java',
'DriverFactory.java',
'DriverProvider.java',
'DriverServlet.java',
'JsonHttpCommandHandler.java',
'JsonParametersAware.java',
'SessionCleaner.java',
'SnapshotScreenListener.java',
] + glob([
'handler/**/*.java',
'rest/*.java',
'xdrpc/*.java',
]),
deps = [
':sessions',
'//java/client/src/org/openqa/selenium:codecs',
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/src/org/openqa/selenium/logging:logging',
'//java/client/src/org/openqa/selenium/remote:remote',
'//java/client/src/org/openqa/selenium/support/events:events',
'//java/server/src/org/openqa/selenium/remote/server/log:log',
'//third_party/java/gson:gson',
'//third_party/java/guava-libraries:guava-libraries',
'//third_party/java/servlet-api:servlet-api',
],
visibility = [
'//java/server/src/org/openqa/selenium/server:server',
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import javax.imageio.ImageIO;

public class SnapshotScreenListener extends AbstractWebDriverEventListener {
class SnapshotScreenListener extends AbstractWebDriverEventListener {

private final Session session;

Expand Down
12 changes: 12 additions & 0 deletions java/server/src/org/openqa/selenium/remote/server/log/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
java_library(name = 'log',
srcs = glob(['*.java']),
deps = [
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/logging:logging',
'//java/client/src/org/openqa/selenium/remote:api',
'//third_party/java/guava-libraries:guava-libraries',
],
visibility = [
'//java/server/src/...',
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
limitations under the License.
*/

package org.openqa.selenium.remote;
package org.openqa.selenium.remote.server.rest;

import org.openqa.selenium.remote.SimplePropertyDescriptor;

import java.lang.reflect.Method;

public class PropertyMunger {
class PropertyMunger {

public static Object get(String name, Object on) throws Exception {
SimplePropertyDescriptor[] properties =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package org.openqa.selenium.remote;
package org.openqa.selenium.remote.server.rest;

import com.google.common.base.Optional;
import com.google.gson.JsonObject;

import org.openqa.selenium.remote.BeanToJsonConverter;
import org.openqa.selenium.remote.ErrorCodes;
import org.openqa.selenium.remote.Response;
import org.openqa.selenium.remote.SessionId;

/**
* Contains factory methods for creating {@link Response} objects.
* Contains factory methods for creating {@link org.openqa.selenium.remote.Response} objects.
*/
public class Responses {
class Responses {

private static final ErrorCodes ERROR_CODES = new ErrorCodes();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import org.openqa.selenium.remote.Command;
import org.openqa.selenium.remote.DriverCommand;
import org.openqa.selenium.remote.ErrorCodes;
import org.openqa.selenium.remote.PropertyMunger;
import org.openqa.selenium.remote.Response;
import org.openqa.selenium.remote.Responses;
import org.openqa.selenium.remote.SessionId;
import org.openqa.selenium.remote.SessionNotFoundException;
import org.openqa.selenium.remote.UnreachableBrowserException;
Expand Down
11 changes: 11 additions & 0 deletions java/server/src/org/openqa/selenium/security/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
java_library(name = 'security',
srcs = glob(['*.java']),
deps = [
'//java/client/src/org/openqa/selenium/io:io',
'//third_party/java/bouncycastle:bouncycastle',
'//third_party/java/guava-libraries:guava-libraries',
],
visibility = [
'//java/server/src/cybervillains:cybervillains',
],
)
50 changes: 50 additions & 0 deletions java/server/src/org/openqa/selenium/server/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

java_binary(name = 'rc',
main_class = "org.openqa.selenium.server.SeleniumServer",
deps = [
':server',
],
)

java_library(name = 'server',
srcs = glob(['**/*.java'], excludes = ['security/*.java']),
deps = [
':resources',
'//java/client/src/org/openqa/selenium:codecs',
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/browserlaunchers/locators:locators',
'//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/client/src/org/openqa/selenium/remote:api',
'//java/client/src/org/openqa/selenium/remote:capabilities',
'//java/client/src/com/thoughtworks/selenium:api',
'//java/client/src/com/thoughtworks/selenium/webdriven:webdriven',
'//java/server/src/cybervillains:cybervillains',
'//java/server/src/org/openqa/selenium/remote/server:server',
'//java/server/src/org/openqa/selenium/remote/server:sessions',
'//java/server/src/org/openqa/selenium/remote/server/log:log',
'//third_party/java/commons-logging:commons-logging',
'//third_party/java/guava-libraries:guava-libraries',
'//third_party/java/gson:gson',
'//third_party/java/jetty:jetty-for-rc',
],
)

prebuilt_jar(name = 'resources',
binary_jar = ':resources-zip',
)

zip(name = 'resources-zip',
out = 'resources.jar',
srcs = [
'VERSION.txt',
] + glob([
'customProfileDirCUSTFF/**/*',
'customProfileDirCUSTFFCHROME/**/*',
'hudsuckr/*',
'konqueror/*',
'opera/*',
'sslSupport/*',
]),
)
11 changes: 11 additions & 0 deletions java/server/src/org/openqa/selenium/server/security/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
java_library(name = 'security',
srcs = glob(['*.java']),
deps = [
'//java/client/src/org/openqa/selenium/io:io',
'//third_party/java/bouncycastle:bouncycastle',
'//third_party/java/guava-libraries:guava-libraries',
],
visibility = [
'//java/server/src/cybervillains:cybervillains',
],
)
32 changes: 32 additions & 0 deletions third_party/java/bouncycastle/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
java_library(name = 'bouncycastle',
exported_deps = [
':pkix',
':prov',
],
visibility = [
'//java/server/src/cybervillains:cybervillains',
'//java/server/src/org/openqa/selenium/server/security:security',
],
)

#JARS = ['bcpkix-jdk15on-1.48.jar', 'bcprov-jdk15on-1.48.jar',]

genrule(name = 'repack-bcpkix',
cmd = 'jar xf bcpkix-jdk15on-1.48.jar && rm META-INF/BCKEY* && jar cf $OUT *',
srcs = [ 'bcpkix-jdk15on-1.48.jar', ],
out = 'bouncycastle-pkix-jdk15on-1.48.jar',
)

prebuilt_jar(name = 'pkix',
binary_jar = ':repack-bcpkix',
)

genrule(name = 'repack-bcprov',
cmd = 'jar xf bcprov-jdk15on-1.48.jar && rm META-INF/BCKEY* && jar cf $OUT *',
srcs = [ 'bcprov-jdk15on-1.48.jar', ],
out = 'bouncycastle-prov-jdk15on-1.48.jar',
)

prebuilt_jar(name = 'prov',
binary_jar = ':repack-bcprov',
)
2 changes: 2 additions & 0 deletions third_party/java/commons-logging/BUCK
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
prebuilt_jar(name = 'commons-logging',
binary_jar = 'commons-logging-1.1.3.jar',
visibility = [
'//java/server/src/org/openqa/selenium/remote/server:sessions',
'//java/server/src/org/openqa/selenium/server:server',
'//third_party/java/...',
],
)
3 changes: 3 additions & 0 deletions third_party/java/jetty/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ prebuilt_jar(name = 'jetty-for-rc',
'//third_party/java/mx4j:mx4j',
'//third_party/java/servlet-api:servlet-api',
],
visibility = [
'//java/server/src/org/openqa/selenium/server:server',
],
)
1 change: 1 addition & 0 deletions third_party/java/servlet-api/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ prebuilt_jar(name = 'servlet-api',
binary_jar = 'servlet-api-2.5-6.1.9.jar',
visibility = [
'//java/client/test/org/openqa/selenium/environment:environment',
'//java/server/src/org/openqa/selenium/remote/server:server',
'//third_party/java/jetty:jetty',
'//third_party/java/jetty:jetty-for-rc',
],
Expand Down

0 comments on commit d0ef377

Please sign in to comment.