Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 5 additions & 28 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -385,37 +385,14 @@ task :javadocs => [:common, :firefox, :htmlunit, :ie, :remote, :support, :chrome
sh cmd
end

task :py_prep_for_install_release => ["//javascript/firefox-driver:webdriver", :chrome, "//javascript/firefox-driver:webdriver_prefs"] do
if python? then

firefox_py_home = "py/selenium/webdriver/firefox/"
firefox_build_dir = 'build/javascript/firefox-driver/'
x86 = firefox_py_home + "x86/"
amd64 = firefox_py_home + "amd64/"

if (windows?) then
firefox_build_dir = firefox_build_dir.gsub(/\//, "\\")
firefox_py_home = firefox_py_home .gsub(/\//, "\\")
x86 = x86.gsub(/\//,"\\")
amd64 = amd64.gsub(/\//,"\\")
end

mkdir_p x86 unless File.exists?(x86)
mkdir_p amd64 unless File.exists?(amd64)

cp "cpp/prebuilt/i386/libnoblur.so", x86+"x_ignore_nofocus.so", :verbose => true
cp "cpp/prebuilt/amd64/libnoblur64.so", amd64+"x_ignore_nofocus.so", :verbose => true

cp firefox_build_dir + "webdriver.xpi" , firefox_py_home, :verbose => true
cp firefox_build_dir + "webdriver_prefs.json" , firefox_py_home, :verbose => true
end
end
task :py_prep_for_install_release => ["//javascript/firefox-driver:webdriver",
:chrome,
"//javascript/firefox-driver:webdriver_prefs",
"//py:prep"]

task :py_docs => "//py:docs"

task :py_install => :py_prep_for_install_release do
sh "python setup.py install"
end
task :py_install => "//py:install"

task :py_release => :py_prep_for_install_release do
sh "grep -v test setup.py > setup_release.py; mv setup_release.py setup.py"
Expand Down
8 changes: 8 additions & 0 deletions py/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,11 @@ py_env(
],
dest = "build/python"
)

py_install(
name = "install"
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use two space indent, as this is actually just Ruby code. Alternatively put it on one line.


py_prep(
name = "prep"
)
46 changes: 44 additions & 2 deletions rake-tasks/crazy_fun/mappings/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def add_all(fun)
fun.add_mapping("py_env", Python::VirtualEnv.new)

fun.add_mapping("py_docs", Python::GenerateDocs.new)

fun.add_mapping("py_install", Python::Install.new)

fun.add_mapping("py_prep", Python::Prep.new)
end
end

Expand Down Expand Up @@ -213,5 +217,43 @@ def handle(fun, dir, args)
end
end

end

class Install < Tasks
def py_exe
windows? ? "C:\\Python27\\python.exe" : "/usr/bin/python"
end

def handle(fun, dir, args)
task Tasks.new.task_name(dir, args[:name]) do
sh py_exe + " setup.py install", :verbose => true
end
end
end

class Prep < Tasks
def handle(fun, dir, args)
task Tasks.new.task_name(dir, args[:name]) do
firefox_py_home = "py/selenium/webdriver/firefox/"
firefox_build_dir = 'build/javascript/firefox-driver/'
x86 = firefox_py_home + "x86/"
amd64 = firefox_py_home + "amd64/"

if (windows?) then
firefox_build_dir = firefox_build_dir.gsub(/\//, "\\")
firefox_py_home = firefox_py_home .gsub(/\//, "\\")
x86 = x86.gsub(/\//,"\\")
amd64 = amd64.gsub(/\//,"\\")
end

mkdir_p x86 unless File.exists?(x86)
mkdir_p amd64 unless File.exists?(amd64)

cp "cpp/prebuilt/i386/libnoblur.so", x86+"x_ignore_nofocus.so", :verbose => true
cp "cpp/prebuilt/amd64/libnoblur64.so", amd64+"x_ignore_nofocus.so", :verbose => true

cp firefox_build_dir + "webdriver.xpi" , firefox_py_home, :verbose => true
cp firefox_build_dir + "webdriver_prefs.json" , firefox_py_home, :verbose => true
end
end
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove superfluous new line

end