Skip to content

Commit

Permalink
Trying to make tck work with Ivy
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Jan 15, 2012
1 parent a83e635 commit 955c632
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 138 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
gem 'rake', '0.9.2'
gem 'cucumber', '1.1.2'
gem 'aruba', '0.4.7'
gem 'rake', '0.9.2.2'
gem 'cucumber', '1.1.4'
gem 'aruba', '0.4.11'
45 changes: 45 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
GEM
remote: http://rubygems.org/
specs:
aruba (0.4.11)
childprocess (>= 0.2.3)
cucumber (>= 1.1.1)
ffi (>= 1.0.11)
rspec (>= 2.7.0)
builder (3.0.0)
childprocess (0.3.0)
ffi (~> 1.0.6)
cucumber (1.1.4)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.7.1)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
ffi (1.0.11-java)
gherkin (2.7.3)
json (>= 1.4.6)
gherkin (2.7.3-java)
json (>= 1.4.6)
json (1.6.4)
json (1.6.4-java)
rake (0.9.2.2)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
rspec-mocks (~> 2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
term-ansicolor (1.0.7)

PLATFORMS
java
ruby

DEPENDENCIES
aruba (= 0.4.11)
cucumber (= 1.1.4)
rake (= 0.9.2.2)
80 changes: 22 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,42 @@ Cucumber-JVM also integrates with the following Dependency Injection containers:

## Downloading / Installation

Final releases will be published in [Maven Central](http://search.maven.org/) when all issues in [Milestone 1](https://github.com/cucumber/cucumber-jvm/issues?milestone=1&state=open) are closed. Until then you can grab
SNAPSHOT releases by adding this repo to your POM:
Releases are published in [Maven Central](http://search.maven.org/)

```xml
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
```
### Getting jars

Jar files can be browsed and downloaded from [Maven Central] or https://oss.sonatype.org/content/repositories/releases/info/cukes/
(New releases will show up here immediately, while it takes a couple of hours to sync to MAven Central).

### Using Maven

Now you can grab jars with the following dependency in your POM:
Add a dependency in your [POM](http://maven.apache.org/pom.html):

```xml
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.0-RC3</version>
</dependency>
```

If you are not using Maven you can download the SNAPSHOT jars manually from https://oss.sonatype.org/content/repositories/snapshots/info/cukes/
### Using Ivy

If you are using [Ivy](http://ant.apache.org/ivy/), you can download the SNAPSHOTS jars by adding the following [resolver](http://ant.apache.org/ivy/history/latest-milestone/settings/resolvers.html) to your [ivysettings.xml](http://ant.apache.org/ivy/history/latest-milestone/settings.html)
Add a [dependency](http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html) in your [ivy.xml](http://ant.apache.org/ivy/history/latest-milestone/ivyfile.html):

```xml
<ibiblio name="sonatype-snapshots"
m2compatible="true"
usepoms="true"
pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
root="https://oss.sonatype.org/content/repositories/snapshots"/>
<dependency org="info.cukes" name="cucumber-core" rev="1.0.0-RC3"/>
```

Now you can grab jars with the following [dependency](http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html) in your [ivy.xml](http://ant.apache.org/ivy/history/latest-milestone/ivyfile.html):
Since the artifacts are released to Maven Central, the default Ivy configuration should pull them down automatically.
Alternatively you can define your own resolver:

```xml
<dependency org="info.cukes" name="cucumber-core" rev="1.0.0-SNAPSHOT" changing="true"/>
<ibiblio name="sonatype"
m2compatible="true"
usepoms="true"
pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
root="https://oss.sonatype.org/content/repositories/releases/info/cukes/"/>
```

## Documentation
Expand All @@ -68,7 +68,9 @@ If you are adventurous, check out the examples, read the code and ask specific q

### API Docs

* http://cukes.info/cucumber/jvm/api/1.0.0-SNAPSHOT/apidocs/ (URL subject to change)
TODO: Fix this. The Ivy build doesn't upload them yet.

* http://cukes.info/cucumber/jvm/api/1.0.0-RC3/apidocs/ (URL subject to change)

## Examples

Expand Down Expand Up @@ -97,19 +99,6 @@ You'll need Ant installed
export ANT_OPTS=-XX:MaxPermSize=128m
ant clean publish-artifacts

TODO:

* Sign jars:
* https://github.com/MaliciousMonkey/Ant-PGP
* http://stackoverflow.com/questions/5199571/pgp-decrypt-using-ant
* http://www.lockboxlabs.org/content/downloads
* Upload jars
* https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.ReleaseIt
* Tag git
* Fix stepdefs.json (it's empty)
* Run the cucumber-tck tests (still use maven, to test it works with maven)
* Doc how to set up IDEA

### Continuous Integration

http://jenkins-01.public.cifoundry.net/job/Cucumber%20JVM/
Expand All @@ -127,31 +116,6 @@ Now you can run the cross-platform Cucumber features:
bundle install
rake

### Code generation

StepDefinition APIs in all of Gherkin's supported i18n languages are generated using Ruby.
The i18n Java annotations (except English) are not added to the Git repo because Git on both OS X and Windows handles UTF-8 file names badly.
In order to compile `cucumber-java` with all I18n annotations, you have to generate them yourself.
With Ruby installed and on your path, install some gems that are needed for code generation:

#### Using bundler

Try this first

gem install bundler
bundle install

Now you can generate the code:

rake generate

#### Without bundler

On Windows it might be tricky to install all the gems. (The listed gems are used for both code generation and for running the cross-platform features). If you only want to generate code, you can get away with:

gem install gherkin
rake generate SKIP_BUNDLER=true

## Troubleshooting

Below are some common problems you might encounter while hacking on Cucumber-JVM - and solutions.
Expand Down
29 changes: 2 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
require 'cucumber/rake/task'

desc "Release"
task :release => [:git_clean, :generate] do
sh "mvn release:clean"
sh "mvn --batch-mode -P release-sign-artifacts release:prepare"
sh "mvn --batch-mode -P release-sign-artifacts release:perform"
end

task :git_clean do
sh "git clean -df"
end

desc "Generate code"
task :generate do
Dir['*/Rakefile'].each do |rakefile|
Dir.chdir(File.dirname(rakefile)) do
if ENV['SKIP_BUNDLER'].to_s == 'true'
puts `rake generate`
else
require 'bundler/setup'
puts `bundle exec rake generate`
end
end
end
end

Cucumber::Rake::Task.new(:picocontainer) do |t|
Cucumber::Rake::Task.new(:tck_tests) do |t|
t.cucumber_opts = '-r java/src/test/resources/cucumber-tck -r cucumber-tck cucumber-tck'
end

task :default => :picocontainer
task :default => :tck_tests
3 changes: 2 additions & 1 deletion build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<property name="bcpg-jar" location="${ivy-install-dir}/bcpg.jar"/>
<property name="bcprov-jar" location="${ivy-install-dir}/bcprov.jar"/>
<available property="ivy-installed" file="${ivy-jar}"/>
<available property="main-sources" file="src/main/java"/>
<dirname property="common-basedir" file="${ant.file.common}"/>
<property environment="env"/>

Expand Down Expand Up @@ -72,7 +73,7 @@
<echoproperties/>
</target>

<target name="compile-main" depends="-init-ivy,generate" description="compile the module">
<target name="compile-main" depends="-init-ivy,generate" description="compile the module" if="main-sources">
<mkdir dir="target/classes"/>
<javac destdir="target/classes"
srcdir="src/main/java"
Expand Down
75 changes: 27 additions & 48 deletions java/src/test/resources/cucumber-tck/cucumber_java_mappings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,43 @@ def features_dir
end

def run_scenario(scenario_name)
write_pom
write_build_files
write_test_unit_classes
run_simple "mvn test", false
run_simple "ant test", false
end

def run_feature
write_pom
write_build_files
write_test_unit_classes
run_simple "mvn test", false
run_simple "ant test", false
end

def write_pom
write_file('pom.xml', <<-EOF)
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>1.0.0.RC2-SNAPSHOT</version>
</parent>
<artifactId>cucumber-picocontainer-test</artifactId>
<version>1.0.0.RC2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Cucumber: PicoContainer Test</name>
def write_build_files
write_file('build.xml', <<-EOF)
<project name="cucumber-tck" default="test">
<import file="../../build-common.xml" />
</project>
EOF

write_file('ivy.xml', <<-EOF)
<ivy-module version="2.0">
<info organisation="info.cukes" module="cucumber-tck" revision="${cucumber-jvm-version}"/>
<configurations defaultconfmapping="*->default">
<conf name="default"/>
<conf name="test" extends="default"/>
</configurations>
<publications>
<artifact type="jar" conf="default"/>
</publications>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>1.0.0.RC2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.0.0.RC2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>1.7.2</version>
<scope>test</scope>
</dependency>
<dependency name="cucumber-picocontainer" rev="${cucumber-jvm-version}" conf="default"/>
<dependency name="cucumber-junit" rev="${cucumber-jvm-version}" conf="test"/>
</dependencies>
</project>
</ivy-module>
EOF
end

Expand Down
1 change: 0 additions & 1 deletion jruby/lib/.gitignore

This file was deleted.

0 comments on commit 955c632

Please sign in to comment.