Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Add Cucumber-JVM migration module #1

Merged
merged 12 commits into from
Mar 23, 2023
Merged
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: cucumber
6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>cucumber/renovate-config"
]
}
18 changes: 18 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release GitHub

on:
push:
branches: [release/*]

jobs:
create-github-release:
name: Create GitHub Release and Git tag
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: cucumber/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self: Add this to the secrets.

24 changes: 24 additions & 0 deletions .github/workflows/release-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Maven

on:
push:
branches: [release/*]

jobs:
publish-mvn:
name: Publish Maven Package
runs-on: ubuntu-latest
environment: Release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'
- uses: cucumber/[email protected]
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus-username: ${{ secrets.SONATYPE_USERNAME }}
nexus-password: ${{ secrets.SONATYPE_PASSWORD }}
33 changes: 33 additions & 0 deletions .github/workflows/test-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Java

on:
pull_request:
branches:
- '**'
workflow_call:
push:
branches:
- main
- renovate/**

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
version: [ 17, 19 ]
name: 'Build Java ${{ matrix.version }} - ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.version }}
cache: 'maven'
- name: Install dependencies
run: mvn install -DskipTests=true -DskipITs=true --batch-mode -D"style.color=always" --show-version
- name: Test
run: mvn verify -D"style.color=always"
env:
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# IDE working files
*.iws
*.ipr
*.iml
.idea/
.settings
.project
.classpath
lib/


# Build directories
distrib/
target/
tmp/
gen-external-apklibs/
out/

# Build & test droppings
pom.xml.releaseBackup
pom.xml.versionsBackup
release.propertiesF
*.ser
dependency-reduced-pom.xml
*~
libpeerconnection.log

# OS generated files
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
20 changes: 20 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) The Cucumber Organisation

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
# Cucumber JVM migration

Cucumber-JVM migration contains [OpenRewrite](https://docs.openrewrite.org/) recipes for migrating applications using Cucumber-JVM.

## Running migration recipes
Migration recipes can be run using the [rewrite-maven-plugin](https://docs.openrewrite.org/reference/rewrite-maven-plugin)
or [rewrite-gradle-plugin](https://docs.openrewrite.org/reference/gradle-plugin-configuration).
These can either be added to the build file of the project to be migrated or [run without modifying the build](https://docs.openrewrite.org/running-recipes/running-rewrite-on-a-maven-project-without-modifying-the-build).


### Upgrade to Cucumber JVM 7.x
```shell
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=io.cucumber:cucumber-jvm-migration:LATEST \
-DactiveRecipes=io.cucumber.migration.UpgradeCucumber7x
```

### Cucumber-Java8 migration to Cucumber-Java
```shell
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=io.cucumber:cucumber-jvm-migration:LATEST \
-DactiveRecipes=io.cucumber.migration.CucumberJava8ToJava
```


## Questions, Problems, Help needed?

Please ask on

* [Stack Overflow](https://stackoverflow.com/questions/tagged/cucumber-jvm).
* [CucumberBDD Slack](https://cucumberbdd-slack-invite.herokuapp.com/) <sup>[direct link](https://cucumberbdd.slack.com/)</sup>

## Bugs and Feature requests

You can register bugs and feature requests in the
[GitHub Issue Tracker](https://github.com/cucumber/cucumber-jvm-migration/issues).

Please bear in mind that this project is almost entirely developed by
volunteers. If you do not provide the implementation yourself (or pay someone
to do it for you), the bug might never get fixed. If it is a serious bug, other
people than you might care enough to provide a fix.

## Contributing

If you'd like to contribute to the documentation, checkout
[cucumber/docs.cucumber.io](https://github.com/cucumber/docs.cucumber.io)
otherwise see our
[CONTRIBUTING.md](https://github.com/cucumber/cucumber-jvm/blob/main/CONTRIBUTING.md).
179 changes: 179 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>io.cucumber</groupId>
<artifactId>cucumber-parent</artifactId>
<version>4.1.1</version>
<relativePath/>
</parent>

<artifactId>cucumber-jvm-migration</artifactId>
<version>0.1.0-SNAPSHOT</version>

<name>Cucumber JVM Migration</name>
<description>Migration module to upgrade projects using cucumber-jvm.</description>

<properties>
<base.java.version>1.8</base.java.version>
<cucumber.version>7.11.0</cucumber.version>
<junit.version>5.9.2</junit.version>
<rewrite.version>1.17.0</rewrite.version>
<resources.encoding>UTF-8</resources.encoding>
<project.build.outputTimestamp>1674814830</project.build.outputTimestamp>
<project.Automatic-Module-Name>io.cucumber.migration</project.Automatic-Module-Name>
</properties>
<scm>
<connection>scm:git:git://github.com/cucumber/cucumber-jvm-migration.git</connection>
<developerConnection>scm:git:[email protected]:cucumber/cucumber-jvm-migration.git</developerConnection>
<url>git://github.com/cucumber/cucumber-jvm-migration.git</url>
<tag>HEAD</tag>
</scm>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-bom</artifactId>
<version>${cucumber.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-recipe-bom</artifactId>
<version>${rewrite.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-plugin</artifactId>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-api</artifactId>
</dependency>

<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-gradle</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-maven</artifactId>
</dependency>

<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java-17</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven-3-6-3-plus</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<fail>true</fail>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>[11,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>${resources.encoding}</encoding>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${base.java.version}</source>
<target>${base.java.version}</target>
<!-- Allow for text blocks in tests -->
<testSource>17</testSource>
<testTarget>17</testTarget>
</configuration>
</plugin>
</plugins>
</build>

</project>
Loading