Skip to content

Commit

Permalink
chore(build): Assume gnu-sed usage for MacOS users
Browse files Browse the repository at this point in the history
Simplify release script maintenance
  • Loading branch information
christophd committed Jun 27, 2022
1 parent a504e11 commit 6551b7e
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 58 deletions.
25 changes: 20 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contributing to Citrus ![Logo][1]


:tada::lemon::tada: First off all, thanks for taking the time to contribute! :tada::lemon::tada:
:tada::lemon::tada: First, thank you for taking the time to contribute! :tada::lemon::tada:

This document contains a set of guidelines for contributing to the Citrus framework ecosystem.
The intention of these guidelines is to make it easier to work together. Nevertheless these guidelines are just
The intention of these guidelines is to make it easier to work together. However, these guidelines are just
suggestions and not set in stone. Use them to the best of your knowledge and feel free to propose changes in a
pull request.

Expand Down Expand Up @@ -65,7 +65,6 @@ issue and include a link to the original issue in the body of your new one.
to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the
existing issue instead of opening a new one.


### Suggesting changes

This section guides you through submitting enhancement suggestions, feature requests or maintenance tasks for Citrus.
Expand All @@ -90,6 +89,22 @@ So if you'd like to work on an issue that is scheduled for a release, please mak
maintainers and make sure that it's possible for you to propose a [pull request](#pull-requests) before the planned
release date of the milestone, if specified.

#### Preconditions

You need following software on your machine in order to start developing:

* Java 11+
Installed JDK plus JAVA_HOME environment variable set
up and pointing to your Java installation directory. Used to compile and build the Citrus code.

* Maven 3.6.3+
Citrus projects will fit best with [Maven](https://maven.apache.org).
However, it is not required to use Maven. You can also run tests using [Gradle](https://gradle.org/) for instance.

* Java IDE (optional)
A Java IDE will help you to manage your Citrus project (e.g. creating
and executing test cases). You can use the Java IDE that you like best like Eclipse or IntelliJ IDEA.

#### Unsure where to begin contributing to Citrus?
You can start by looking for issues labeled with `good first issue` which should only require a few lines of code, and
a test or two.
Expand Down Expand Up @@ -153,15 +168,15 @@ without any further research/reconstruction efforts.
or [features](https://github.com/citrusframework/citrus/issues/new?template=feature_request.md) has been filled out completely
* Bigger changes have been transformed to epics and were broken down into smaller issues
* The context of the issue is understood by at least one maintainer
* Therefore it's important to provide as much context as possible
* Therefore, it's important to provide as much context as possible
* Acceptance criteria are given
* In case of a bug: There is a test to pass
* In case of a feature/enhancement: There is at least one acceptance criteria derived from the user story

### Definition of done
The definition of done (DOD) specifies the exit-criteria for an issue that is currently in progress to be passed for
review. If you're working on an issue which you would like to pass for review, it would be great, if you could ensure
that all of the following criteria are met. This helps us to review your changes as effective as possible.
that all the following criteria are met. This helps us to review your changes as effective as possible.

* All requirements of the linked issue have been fulfilled
* Automated tests for the acceptance criteria have been created and passed
Expand Down
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,25 @@ Preconditions
You need following software on your machine in order to use the
Citrus framework:

* Java 11 or higher
* Java 11+
Installed JDK plus JAVA_HOME environment variable set
up and pointing to your Java installation directory
up and pointing to your Java installation directory. Used to compile and build the Citrus code.

* Maven 3.6.3+
Citrus projects will fit best with [Maven](https://maven.apache.org).
However, it is not required to use Maven. You can also run tests using [Gradle](https://gradle.org/) for instance.

* Java IDE (optional)
A Java IDE will help you to manage your Citrus project (e.g. creating
and executing test cases). You can use the Java IDE that you like best
like Eclipse or IntelliJ IDEA.

* Maven 3.0.x or higher (optional)
Citrus projects will fit best with Maven (https://maven.apache.org).
However it is not required to use Maven. You can also run tests using
ANT (https://ant.apache.org/) for instance.

and executing test cases). You can use the Java IDE that you like best like Eclipse or IntelliJ IDEA.

Installation
---------

* Download the latest Citrus release archive

* Extract the archive into an appropriate location on your local storage

* Use the ANT tutorial in our tutorials section to find out how to run
tests using ANT.

* Read the Maven tutorial to find out how to integrate the Citrus tests
into the Maven build lifecycle

Expand Down
20 changes: 9 additions & 11 deletions endpoints/citrus-rmi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ Preconditions
You need following software on your machine in order to use the
Citrus framework:

* Java 11 or higher
Installed JDK plus JAVA_HOME environment variable set
up and pointing to your Java installation directory
* Java 11+
Installed JDK plus JAVA_HOME environment variable set
up and pointing to your Java installation directory. Used to compile and build the Citrus code.

* Maven 3.6.3+
Citrus projects will fit best with [Maven](https://maven.apache.org).
However, it is not required to use Maven. You can also run tests using [Gradle](https://gradle.org/) for instance.

* Java IDE (optional)
A Java IDE will help you to manage your Citrus project (e.g. creating
and executing test cases). You can use the Java IDE that you like best
like Eclipse or IntelliJ IDEA.

* Maven 3.3.x or higher (optional)
Citrus projects will fit best with Maven (http://maven.apache.org).
However it is not required to use Maven. You can also run tests using
ANT (http://ant.apache.org/) for instance.
A Java IDE will help you to manage your Citrus project (e.g. creating
and executing test cases). You can use the Java IDE that you like best like Eclipse or IntelliJ IDEA.

Usage
---------
Expand Down
21 changes: 20 additions & 1 deletion scripts/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@
= Citrus Build CLI Tool

This `citrus` script can be found in `$PROJECT_DIR/scripts` and helps with development related tasks such as performing an
automated release. It requires bash and can be used on Linux or MacOS.
automated release. It requires bash and can be used on Linux or MacOS (and Windows if you make it work with Linux scripts e.g. via Cygwin).

[[build-tool-preconditions]]
.Preconditions

You need following software on your machine in order to use the build scripts:

* Java 11+:
Installed JDK plus JAVA_HOME environment variable set
up and pointing to your Java installation directory. Used to compile and build the Citrus code.

* Maven 3.6.3+:
Citrus projects will fit best with [Maven](https://maven.apache.org).
However, it is not required to use Maven. You can also run tests using [Gradle](https://gradle.org/) for instance.

* Git
as a client for version control

NOTE: MacOS users will need to use *gnu-sed* to successfully run the Make build scripts.
Please install gnu-sed on your machine (e.g. `brew install gnu-sed`) and set your PATH accordingly to use gnu-sed with: `export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"`

To have this script handy all the time it is recommended to either add this `scripts/citrus` binary to the $PATH or add a
symlink from `citrus` into a directory which is already on your execution path.
Expand Down
17 changes: 3 additions & 14 deletions scripts/commands/docs
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,8 @@ update_docs_version() {

echo "Update docs to version: $version"

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed -i "17p" $file
sed -i "17s/$version/$snapshot_version/g" $file
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
sed -i '' "17p" $file
sed -i '' "17s/$version/$snapshot_version/g" $file
fi
sed -i "17p" $file
sed -i "17s/$version/$snapshot_version/g" $file
}

set_docs_version() {
Expand All @@ -161,10 +155,5 @@ set_docs_version() {
return
fi

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed -i "s/$snapshot_version/$version/g" $file
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
sed -i '' "s/$snapshot_version/$version/g" $file
fi
sed -i "s/$snapshot_version/$version/g" $file
}
10 changes: 2 additions & 8 deletions scripts/commands/release
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,6 @@ update_project_metadata() {

echo "Update project metadata to version: $version"

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed -i "s/current-version: .*/current-version: $version/" $file
sed -i "s/next-version: .*/next-version: $next_version/g" $file
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
sed -i '' "s/current-version: .*/current-version: $version/" $file
sed -i '' "s/next-version: .*/next-version: $next_version/g" $file
fi
sed -i "s/current-version: .*/current-version: $version/" $file
sed -i "s/next-version: .*/next-version: $next_version/g" $file
}
7 changes: 1 addition & 6 deletions scripts/commands/util/version_funcs
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,7 @@ set_version() {

if [ "$check" = true ]; then
#echo "update $file"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed -i "s/$snapshot_version/$version/g" $file
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
sed -i '' "s/$snapshot_version/$version/g" $file
fi
sed -i "s/$snapshot_version/$version/g" $file
fi
done

Expand Down

0 comments on commit 6551b7e

Please sign in to comment.