Permalink
Browse files

major build changes:

 - 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...
1 parent b3cef14 commit 0fd258da7fb2917d40c5c73d5ad7689b543caf6b plightbo committed Mar 24, 2007
Showing with 154 additions and 28 deletions.
  1. +27 −26 build.xml
  2. +125 −0 pom.xml
  3. +2 −2 selenium_example.rb
View
53 build.xml
@@ -1,37 +1,38 @@
-<project name="selenium" default="all">
- <target name="generate-sources">
- <ant dir=".." target="extract-xml"/>
- <xslt in="../iedoc.xml" out="selenium.rb" style="iedoc2ruby.xml"/>
+<project name="selenium">
+ <target name="ant-generate-sources">
+ <mkdir dir="target"/>
+ <xslt in="../target/iedoc.xml" out="target/selenium.rb" style="iedoc2ruby.xml"/>
</target>
- <target name="doc" depends="generate-sources">
- <condition property="rdoc.executable" value="rdoc.bat">
- <os family="windows" />
- </condition>
- <property name="rdoc.executable" value="rdoc" />
- <exec executable="${rdoc.executable}" failonerror="true">
- <arg value="selenium.rb" />
- </exec>
+
+ <target name="ant-doc">
+ <condition property="rdoc.executable" value="rdoc.bat">
+ <os family="windows"/>
+ </condition>
+ <property name="rdoc.executable" value="rdoc"/>
+ <exec dir="target" executable="${rdoc.executable}" failonerror="true">
+ <arg value="selenium.rb"/>
+ </exec>
+ <zip basedir="target/doc" destfile="target/doc.zip"/>
</target>
- <target name="all" depends="generate-sources, test, doc"/>
- <target name="test" depends="generate-sources" unless="skiptests">
- <ant dir=".." target="start-server" />
+
+ <target name="ant-test">
+ <echo>${selenium-server}</echo>
+ <java jar="${selenium-server}" fork="true" spawn="true"/>
+ <sleep seconds="2"/>
+
<!-- output="${tmp}/ruby_out.txt" -->
- <property name="ruby.executable" value="ruby" />
+ <property name="ruby.executable" value="ruby"/>
<!--<fail message="autofail ${ruby.executable}" />-->
<exec executable="${ruby.executable}" resultproperty="result">
<arg line="selenium_example.rb"/>
</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">
- <not><equals arg1="0" arg2="${result}" /></not>
+ <not>
+ <equals arg1="0" arg2="${result}"/>
+ </not>
</condition>
- <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" />
+ <fail if="build.failed" message="ruby tests failed!"/>
</target>
</project>
View
125 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>
View
4 selenium_example.rb
@@ -17,7 +17,7 @@
require 'test/unit'
-require 'selenium'
+require 'target/selenium'
class ExampleTest < Test::Unit::TestCase
include SeleniumHelper
@@ -47,4 +47,4 @@ def test_something
assert_equal('Jane Agnews', get_value(input_id))
end
-end
+end

0 comments on commit 0fd258d

Please sign in to comment.