Skip to content

Commit

Permalink
Switch to Gradle & OpenRewrite 8.0 (#4)
Browse files Browse the repository at this point in the history
* Switch to Gradle

* OpenRewrite 8.0

* License format

* Update settings.gradle.kts

* Rename packages to org.openrewrite.cucumber.jvm

* Replace GitHub workflows

* Simplify & fix CucumberAnnotationToSuite

* Update README.md
  • Loading branch information
timtebeek authored Jun 10, 2023
1 parent 6ccfd18 commit 5c514d4
Show file tree
Hide file tree
Showing 33 changed files with 847 additions and 515 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
commit-message:
prefix: "chore(ci)"
- package-ecosystem: gradle
directory: /
schedule:
interval: daily
commit-message:
prefix: "chore(ci)"
open-pull-requests-limit: 0
6 changes: 0 additions & 6 deletions .github/renovate.json

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: ci

on:
push:
branches:
- main
tags-ignore:
- "*"
pull_request:
branches:
- main
workflow_dispatch: {}
schedule:
- cron: 0 17 * * *

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
uses: openrewrite/gh-automation/.github/workflows/ci-gradle.yml@main
secrets:
gradle_enterprise_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
gradle_enterprise_cache_username: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
gradle_enterprise_cache_password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
ossrh_username: ${{ secrets.OSSRH_USERNAME }}
ossrh_token: ${{ secrets.OSSRH_TOKEN }}
ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }}
ossrh_signing_password: ${{ secrets.OSSRH_SIGNING_PASSWORD }}
20 changes: 20 additions & 0 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: dependency-check

on:
workflow_dispatch: {}
schedule:
- cron: 0 18 * * *

concurrency:
group: dependency-check-${{ github.ref }}
cancel-in-progress: true

jobs:
dependency-check:
uses: openrewrite/gh-automation/.github/workflows/dependency-check-gradle.yml@main
secrets:
slack_alerts_webhook: ${{ secrets.SLACK_ALERTS_WEBHOOK }}
gradle_enterprise_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
gradle_enterprise_cache_username: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
gradle_enterprise_cache_password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: publish

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
uses: openrewrite/gh-automation/.github/workflows/publish-gradle.yml@main
secrets:
gradle_enterprise_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
ossrh_username: ${{ secrets.OSSRH_USERNAME }}
ossrh_token: ${{ secrets.OSSRH_TOKEN }}
ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }}
ossrh_signing_password: ${{ secrets.OSSRH_SIGNING_PASSWORD }}
18 changes: 0 additions & 18 deletions .github/workflows/release-github.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/release-java.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/repository-backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: repository-backup
on:
workflow_dispatch: {}
schedule:
- cron: 0 17 * * *

concurrency:
group: backup-${{ github.ref }}
cancel-in-progress: false

jobs:
repository-backup:
uses: openrewrite/gh-automation/.github/workflows/repository-backup.yml@main
secrets:
bucket_mirror_target: ${{ secrets.S3_GITHUB_REPOSITORY_BACKUPS_BUCKET_NAME }}
bucket_access_key_id: ${{ secrets.S3_GITHUB_REPOSITORY_BACKUPS_ACCESS_KEY_ID }}
bucket_secret_access_key: ${{ secrets.S3_GITHUB_REPOSITORY_BACKUPS_SECRET_ACCESS_KEY }}
33 changes: 0 additions & 33 deletions .github/workflows/test-java.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ lib/

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

# Build & test droppings
pom.xml.releaseBackup
pom.xml.versionsBackup
.gradle/
release.propertiesF
*.ser
dependency-reduced-pom.xml
Expand Down
20 changes: 0 additions & 20 deletions LICENCE

This file was deleted.

39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Cucumber JVM migration
![Logo](https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss.png)
### Rewrite Cucumber JVM

Cucumber-JVM migration contains [OpenRewrite](https://docs.openrewrite.org/) recipes for migrating applications using Cucumber-JVM.
[![ci](https://github.com/openrewrite/rewrite-cucumber-jvm/actions/workflows/ci.yml/badge.svg)](https://github.com/openrewrite/rewrite-cucumber-jvm/actions/workflows/ci.yml)
[![Apache 2.0](https://img.shields.io/github/license/openrewrite/rewrite-cucumber-jvm.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/org.openrewrite.recipe/rewrite-cucumber-jvm.svg)](https://mvnrepository.com/artifact/org.openrewrite.recipe/rewrite-cucumber-jvm)
[![Revved up by Gradle Enterprise](https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.openrewrite.org/scans)

### What is this?

This project implements a [Rewrite module](https://github.com/openrewrite/rewrite) that performs common tasks when migrating to new version of [Cucumber-JVM](https://github.com/cucumber/cucumber-jvm).

## Running migration recipes
Migration recipes can be run using the [rewrite-maven-plugin](https://docs.openrewrite.org/reference/rewrite-maven-plugin)
Expand All @@ -11,38 +19,23 @@ These can either be added to the build file of the project to be migrated or [ru
### 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
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-cucumber-jvm:RELEASE \
-DactiveRecipes=org.openrewrite.cucumber.jvm.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
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-cucumber-jvm:RELEASE \
-DactiveRecipes=org.openrewrite.cucumber.jvm.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.
[GitHub Issue Tracker](https://github.com/openrewrite/rewrite-cucumber-jvm/issues).

## 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).
[CONTRIBUTING.md](https://github.com/openrewrite/.github/blob/main/CONTRIBUTING.md).
30 changes: 30 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("org.openrewrite.build.recipe-library") version "latest.release"
}

group = "org.openrewrite.recipe"
description = "Cucumber JVM Migration"

val rewriteVersion = rewriteRecipe.rewriteVersion.get()
dependencies {
implementation("io.cucumber:cucumber-java:7.12.0")
implementation("io.cucumber:cucumber-java8:7.12.0")
implementation("io.cucumber:cucumber-plugin:7.12.0")
implementation("io.cucumber:cucumber-junit-platform-engine:7.12.0")
implementation("org.junit.platform:junit-platform-suite-api:1.9.3")

compileOnly("org.projectlombok:lombok:latest.release")
annotationProcessor("org.projectlombok:lombok:latest.release")

implementation(platform("org.openrewrite:rewrite-bom:$rewriteVersion"))
implementation("org.openrewrite:rewrite-java")
implementation("org.openrewrite:rewrite-gradle")
implementation("org.openrewrite:rewrite-maven")

implementation("org.openrewrite.recipe:rewrite-static-analysis:$rewriteVersion")

testImplementation("org.openrewrite:rewrite-java-17")
testImplementation("org.openrewrite:rewrite-test")

testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.3")
}
13 changes: 13 additions & 0 deletions gradle/licenseHeader.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2023 the original author or authors.
<p>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
<p>
https://www.apache.org/licenses/LICENSE-2.0
<p>
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 5c514d4

Please sign in to comment.