Skip to content

Commit 84befef

Browse files
authored
Initial implementation (#1)
1 parent e2e31c8 commit 84befef

26 files changed

+912
-54
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
contents: read
1414
strategy:
1515
matrix:
16-
java: ['17', '21', '23']
16+
java: ['17', '21', '24']
1717
env:
1818
DEFAULT_JAVA: '17'
1919
runs-on: ubuntu-latest
@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: Sonar analysis
4949
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
50-
run: ./gradlew sonar --info --exclude-task integrationTest -Dsonar.token=$SONAR_TOKEN
50+
run: ./gradlew sonar --info -Dsonar.token=$SONAR_TOKEN
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Build Javadoc
3030
run: ./gradlew javadoc --info
3131
- name: Build Reports
32-
run: ./gradlew check jacocoTestReport --exclude-task integrationTest --info
32+
run: ./gradlew check jacocoTestReport --info
3333
- name: Collect artifacts
3434
run: cp -r build/reports/ build/docs/
3535
- name: Upload artifact

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
if: ${{ !inputs.skip-deploy-maven-central }}
4747
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --warning-mode all
4848
env:
49-
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
50-
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
49+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.MAVEN_CENTRAL_PORTAL_TOKEN }}
50+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.MAVEN_CENTRAL_PORTAL_USERNAME }}
5151
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
5252
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
5353

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
"-Djava.util.logging.config.file=src/test/resources/logging.properties"
1717
]
1818
},
19+
"sonarlint.connectedMode.project": {
20+
"connectionId": "itsallcode",
21+
"projectKey": "org.itsallcode:simple-process"
22+
}
1923
}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [0.2.0] - unreleased
8+
9+
## [0.1.0] - 2025-02-??
10+
11+
* [PR #1](https://github.com/itsallcode/simple-process/pull/1): Initial release

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,94 @@ Wrapper to simplify working with external processes.
44

55
**This project is at an early development stage and the API will change without backwards compatibility.**
66

7+
[![Java CI](https://github.com/itsallcode/simple-process/actions/workflows/build.yml/badge.svg)](https://github.com/itsallcode/simple-process/actions/workflows/build.yml)
8+
[![CodeQL](https://github.com/itsallcode/simple-process/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/itsallcode/simple-process/actions/workflows/codeql-analysis.yml)
9+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Asimple-process&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Asimple-process)
10+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Asimple-process&metric=coverage)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Asimple-process)
11+
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Asimple-process&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Asimple-process)
12+
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Asimple-process&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Asimple-process)
13+
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Asimple-process&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Asimple-process)
14+
[![Maven Central](https://img.shields.io/maven-central/v/org.itsallcode/simple-process)](https://search.maven.org/artifact/org.itsallcode/simple-process)
15+
16+
* [Changelog](CHANGELOG.md)
17+
* [API JavaDoc](https://blog.itsallcode.org/simple-process/javadoc/org.itsallcode.process/module-summary.html)
18+
* [Test report](https://blog.itsallcode.org/simple-process/reports/tests/test/index.html)
19+
* [Coverage report](https://blog.itsallcode.org/simple-process/reports/jacoco/test/html/index.html)
20+
21+
## Usage
22+
23+
This project requires Java 17 or later.
24+
25+
### Add Dependency
26+
27+
Add dependency to your Gradle project:
28+
29+
```groovy
30+
dependencies {
31+
implementation 'org.itsallcode:simple-process:0.1.0'
32+
}
33+
```
34+
35+
Add dependency to your Maven project:
36+
37+
```xml
38+
<dependency>
39+
<groupId>org.itsallcode</groupId>
40+
<artifactId>simple-process</artifactId>
41+
<version>0.1.0</version>
42+
</dependency>
43+
```
44+
45+
### Features
46+
47+
Simplified API for starting external processes and executable JARs. Allows easy capturing stdout and stderr and forwarding to log output.
48+
49+
## Development
50+
51+
### Check if dependencies are up-to-date
52+
53+
```sh
54+
./gradlew dependencyUpdates
55+
```
56+
57+
### Building
58+
59+
Install to local maven repository:
60+
61+
```sh
62+
./gradlew publishToMavenLocal
63+
```
64+
65+
### Test Coverage
66+
67+
To calculate and view test coverage:
68+
69+
```sh
70+
./gradlew check jacocoTestReport
71+
open build/reports/jacoco/test/html/index.html
72+
```
73+
74+
### View Generated Javadoc
75+
76+
```sh
77+
./gradlew javadoc
78+
open build/docs/javadoc/index.html
79+
```
80+
81+
### Publish to Maven Central
82+
83+
#### Preparations
84+
85+
1. Checkout the `main` branch, create a new branch.
86+
2. Update version number in `build.gradle` and `README.md`.
87+
3. Add changes in new version to `CHANGELOG.md`.
88+
4. Commit and push changes.
89+
5. Create a new pull request, have it reviewed and merged to `main`.
90+
91+
#### Perform the Release
92+
93+
1. Start the release workflow
94+
* Run command `gh workflow run release.yml --repo itsallcode/simple-process --ref main`
95+
* or go to [GitHub Actions](https://github.com/itsallcode/simple-process/actions/workflows/release.yml) and start the `release.yml` workflow on branch `main`.
96+
2. Update title and description of the newly created [GitHub release](https://github.com/itsallcode/simple-process/releases).
97+
3. After some time the release will be available at [Maven Central](https://repo1.maven.org/maven2/org/itsallcode/simple-process/).

build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
id 'jacoco-report-aggregation'
66
id 'signing'
77
id 'maven-publish'
8-
id 'org.sonarqube' version '6.0.1.5171'
8+
id 'org.sonarqube' version '6.2.0.5505'
99
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
1010
id 'com.github.ben-manes.versions' version '0.52.0'
1111
}
@@ -18,17 +18,21 @@ repositories {
1818
}
1919

2020
dependencies {
21-
// This dependency is exported to consumers, that is to say found on their compile classpath.
22-
api libs.commons.math3
23-
24-
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
25-
implementation libs.guava
2621
}
2722

2823
testing {
2924
suites {
3025
test {
3126
useJUnitJupiter(libs.versions.junitJupiter.get())
27+
dependencies {
28+
implementation libs.assertj
29+
implementation libs.mockitoJunit
30+
}
31+
targets.all {
32+
testTask.configure {
33+
systemProperty 'java.util.logging.config.file', file('src/test/resources/logging.properties')
34+
}
35+
}
3236
}
3337
}
3438
}
@@ -119,6 +123,8 @@ nexusPublishing {
119123
repositories {
120124
sonatype {
121125
stagingProfileId = "546ea6ce74787e"
126+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
127+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
122128
}
123129
}
124130
}

gradle/libs.versions.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
33

44
[versions]
5-
commons-math3 = "3.6.1"
6-
guava = "33.3.1-jre"
75
junitJupiter = "5.11.1"
6+
mockito = "5.18.0"
7+
assertj = "3.27.3"
8+
equalsverifier = "3.18.1"
9+
tostringverifier = "1.4.8"
810

911
[libraries]
10-
commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" }
11-
guava = { module = "com.google.guava:guava", version.ref = "guava" }
12-
12+
mockitoJunit = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" }
13+
equalsverifier = { module = "nl.jqno.equalsverifier:equalsverifier", version.ref = "equalsverifier" }
14+
tostringverifier = { module = "com.jparams:to-string-verifier", version.ref = "tostringverifier" }
15+
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }

gradle/wrapper/gradle-wrapper.jar

181 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)