Skip to content

Commit

Permalink
major build changes:
Browse files Browse the repository at this point in the history
 - everything is now maven-based (with small callouts to ant)
 - right now, only the java and ruby clients are built (others are still todo)
 - ruby artifacts are published neatly along with the java-based ones
 - tests verified to pass on my local mac
 - can skip all tests (JUnit and ruby both!) wiht "mvn -Dnotest"
 - small cleanup of the pom files (using dependencyManagement, better names/urls, etc)
 - removed stale readme.html and cotta files
 - removed old ant build files that will confuse folks (we've got SVN history of course, we can always bring them back)
 - removed stale idea project file (code.iml)

git-svn-id: https://svn.openqa.org/svn/selenium-rc/trunk/clients/ruby@1757 0891141a-5dea-0310-ad27-ebc607f31677
  • Loading branch information
plightbo committed Mar 24, 2007
1 parent b3cef14 commit 0fd258d
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 28 deletions.
53 changes: 27 additions & 26 deletions build.xml
@@ -1,37 +1,38 @@
<project name="selenium" default="all"> <project name="selenium">
<target name="generate-sources"> <target name="ant-generate-sources">
<ant dir=".." target="extract-xml"/> <mkdir dir="target"/>
<xslt in="../iedoc.xml" out="selenium.rb" style="iedoc2ruby.xml"/> <xslt in="../target/iedoc.xml" out="target/selenium.rb" style="iedoc2ruby.xml"/>
</target> </target>
<target name="doc" depends="generate-sources">
<condition property="rdoc.executable" value="rdoc.bat"> <target name="ant-doc">
<os family="windows" /> <condition property="rdoc.executable" value="rdoc.bat">
</condition> <os family="windows"/>
<property name="rdoc.executable" value="rdoc" /> </condition>
<exec executable="${rdoc.executable}" failonerror="true"> <property name="rdoc.executable" value="rdoc"/>
<arg value="selenium.rb" /> <exec dir="target" executable="${rdoc.executable}" failonerror="true">
</exec> <arg value="selenium.rb"/>
</exec>
<zip basedir="target/doc" destfile="target/doc.zip"/>
</target> </target>
<target name="all" depends="generate-sources, test, doc"/>
<target name="test" depends="generate-sources" unless="skiptests"> <target name="ant-test">
<ant dir=".." target="start-server" /> <echo>${selenium-server}</echo>
<java jar="${selenium-server}" fork="true" spawn="true"/>
<sleep seconds="2"/>

<!-- output="${tmp}/ruby_out.txt" --> <!-- output="${tmp}/ruby_out.txt" -->
<property name="ruby.executable" value="ruby" /> <property name="ruby.executable" value="ruby"/>
<!--<fail message="autofail ${ruby.executable}" />--> <!--<fail message="autofail ${ruby.executable}" />-->
<exec executable="${ruby.executable}" resultproperty="result"> <exec executable="${ruby.executable}" resultproperty="result">
<arg line="selenium_example.rb"/> <arg line="selenium_example.rb"/>
</exec> </exec>
<ant dir=".." target="stop-server" /> <get taskname="selenium-shutdown" src="http://localhost:4444/selenium-server/driver/?cmd=shutDown" dest="target/shutdown-result.txt" ignoreerrors="true" />
<sleep seconds="2"/>
<condition property="build.failed"> <condition property="build.failed">
<not><equals arg1="0" arg2="${result}" /></not> <not>
<equals arg1="0" arg2="${result}"/>
</not>
</condition> </condition>
<fail if="build.failed" message="ruby tests failed!" /> <fail if="build.failed" message="ruby tests failed!"/>
</target>
<target name="clean">
<delete>
<fileset dir="." includes="selenium.rb" />
</delete>
<mkdir dir="doc" />
<delete dir="doc" />
</target> </target>
</project> </project>
125 changes: 125 additions & 0 deletions pom.xml
@@ -0,0 +1,125 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openqa.selenium.client-drivers</groupId>
<version>0.9.1-SNAPSHOT</version>
<artifactId>selenium-client-drivers</artifactId>
</parent>
<groupId>org.openqa.selenium.client-drivers</groupId>
<artifactId>selenium-ruby-client-driver</artifactId>
<packaging>pom</packaging>
<name>Selenium RC Ruby Client</name>
<profiles>
<profile>
<id>test</id>
<activation>
<property>
<name>!notest</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<configuration>
<tasks>
<ant target="ant-test">
<property name="selenium-server" value="${maven.dependency.org.openqa.selenium.server.selenium-server.standalone.jar.path}"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-trax</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<ant target="ant-generate-sources">
<property name="selenium-server" value="${maven.dependency.org.openqa.selenium.server.selenium-server.standalone.jar.path}"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>package</id>
<phase>package</phase>
<configuration>
<tasks>
<ant target="ant-doc">
<property name="selenium-server" value="${maven.dependency.org.openqa.selenium.server.selenium-server.standalone.jar.path}"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-trax</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/selenium.rb</file>
<type>rb</type>
</artifact>
<artifact>
<file>target/doc.zip</file>
<type>zip</type>
<classifier>docs</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 2 additions & 2 deletions selenium_example.rb
Expand Up @@ -17,7 +17,7 @@




require 'test/unit' require 'test/unit'
require 'selenium' require 'target/selenium'


class ExampleTest < Test::Unit::TestCase class ExampleTest < Test::Unit::TestCase
include SeleniumHelper include SeleniumHelper
Expand Down Expand Up @@ -47,4 +47,4 @@ def test_something
assert_equal('Jane Agnews', get_value(input_id)) assert_equal('Jane Agnews', get_value(input_id))
end end


end end

0 comments on commit 0fd258d

Please sign in to comment.