depot/third_party/nixpkgs/pkgs/development/tools/selenium/selendroid/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

50 lines
1.8 KiB
Nix

{ stdenv, fetchurl, makeWrapper, jdk, selenium-server-standalone }:
with stdenv.lib;
let
name = "selendroid-standalone-${version}";
pluginName = "selendroid-grid-plugin-${version}";
version = "0.17.0";
srcs = {
jar = fetchurl {
url = "https://github.com/selendroid/selendroid/releases/download/${version}/${name}-with-dependencies.jar";
sha256 = "10lxdsgp711pv8r6dk2aagnbvnn1b25zfqjvz7plc73zqhx1dxvw";
};
gridPlugin = fetchurl {
url = "https://search.maven.org/remotecontent?filepath=io/selendroid/selendroid-grid-plugin/${version}/${pluginName}.jar";
sha256 = "1x6cjmp2hpghbgbf8vss0qaj2n4sfl29wp3bc4k1s3hnnpccvz70";
};
};
in
stdenv.mkDerivation {
inherit name;
inherit version;
dontUnpack = true;
buildInputs = [ jdk makeWrapper ];
installPhase = ''
mkdir -p $out/share/lib/selendroid
cp ${srcs.jar} $out/share/lib/selendroid/${name}.jar
cp ${srcs.gridPlugin} $out/share/lib/selendroid/${pluginName}.jar
makeWrapper ${jdk}/bin/java $out/bin/selendroid \
--add-flags "-jar $out/share/lib/selendroid/${name}.jar"
makeWrapper ${jdk}/bin/java $out/bin/selendroid-selenium \
--add-flags "-Dfile.encoding=UTF-8" \
--add-flags "-cp ${selenium-server-standalone}/share/lib/${selenium-server-standalone.name}/${selenium-server-standalone.name}.jar:$out/share/lib/selendroid/${pluginName}.jar" \
--add-flags "org.openqa.grid.selenium.GridLauncherV3" \
--add-flags "-role hub" \
--add-flags "-capabilityMatcher io.selendroid.grid.SelendroidCapabilityMatcher"
'';
meta = {
homepage = "http://selendroid.io/";
description = "Test automation for native or hybrid Android apps and the mobile web";
maintainers = with maintainers; [ offline ];
platforms = platforms.all;
license = licenses.asl20;
};
}