nixpkgs/pkgs/development/tools/selenium/selendroid/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
2.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper, jdk, selenium-server-standalone }:
2014-11-21 16:28:27 +00:00
let
2022-01-23 12:39:52 +00:00
pname = "selendroid-standalone";
pluginName = "selendroid-grid-plugin-${version}";
2017-10-15 10:28:12 +00:00
version = "0.17.0";
srcs = {
jar = fetchurl {
2022-01-23 12:39:52 +00:00
url = "https://github.com/selendroid/selendroid/releases/download/${version}/selendroid-standalone-${version}-with-dependencies.jar";
2017-10-15 10:28:12 +00:00
sha256 = "10lxdsgp711pv8r6dk2aagnbvnn1b25zfqjvz7plc73zqhx1dxvw";
};
gridPlugin = fetchurl {
url = "https://search.maven.org/remotecontent?filepath=io/selendroid/selendroid-grid-plugin/${version}/${pluginName}.jar";
2017-10-15 10:28:12 +00:00
sha256 = "1x6cjmp2hpghbgbf8vss0qaj2n4sfl29wp3bc4k1s3hnnpccvz70";
};
};
in
2019-08-13 21:52:01 +00:00
stdenv.mkDerivation {
2022-01-23 12:39:52 +00:00
inherit pname version;
2014-11-21 16:28:27 +00:00
2019-06-19 15:45:34 +00:00
dontUnpack = true;
2014-11-21 16:28:27 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jdk ];
2014-11-21 16:28:27 +00:00
installPhase = ''
mkdir -p $out/share/lib/selendroid
2022-01-23 12:39:52 +00:00
cp ${srcs.jar} $out/share/lib/selendroid/selendroid-standalone-${version}.jar
cp ${srcs.gridPlugin} $out/share/lib/selendroid/${pluginName}.jar
2014-11-21 16:28:27 +00:00
makeWrapper ${jdk}/bin/java $out/bin/selendroid \
2022-01-23 12:39:52 +00:00
--add-flags "-jar $out/share/lib/selendroid/selendroid-standalone-${version}.jar"
2014-11-21 16:28:27 +00:00
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"
2014-11-21 16:28:27 +00:00
'';
meta = with lib; {
homepage = "http://selendroid.io/";
2015-04-28 08:54:58 +00:00
description = "Test automation for native or hybrid Android apps and the mobile web";
2014-11-21 16:28:27 +00:00
maintainers = with maintainers; [ offline ];
platforms = platforms.all;
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2014-11-21 16:28:27 +00:00
license = licenses.asl20;
};
}