Skip to content

Commit 2c7834b

Browse files
authored
Merge pull request #69 from cicirello/development
Updates to build process, CI/CD, workflows, etc
2 parents 1b69e38 + a2caff1 commit 2c7834b

File tree

112 files changed

+2608
-4973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+2608
-4973
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ version: 2
77
updates:
88
- package-ecosystem: "maven" # See documentation for possible values
99
directory: "/" # Location of package manifests
10-
target-branch: "development"
10+
target-branch: "master"
1111
schedule:
1212
interval: "daily"
1313
- package-ecosystem: "github-actions" # See documentation for possible values
1414
directory: "/" # Location of package manifests
15-
target-branch: "development"
15+
target-branch: "master"
1616
schedule:
1717
interval: "daily"

.github/workflows/ant.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up JDK 1.11
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.11
20+
21+
- name: Build with Maven
22+
run: mvn -B package -Pcoverage
23+
24+
- name: Generate Jacoco Badge
25+
id: jacoco
26+
uses: cicirello/[email protected]
27+
28+
- name: Log coverage percentage
29+
run: |
30+
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
31+
32+
- name: Create pull request
33+
if: ${{ github.event_name == 'push' }}
34+
uses: peter-evans/[email protected]
35+
with:
36+
title: "Autogenerated Jacoco Coverage Badge"
37+
body: >
38+
Autogenerated Jacoco coverage badge, generated by
39+
the [jacoco-badge-generator](https://github.com/cicirello/jacoco-badge-generator)
40+
GitHub action. Automated pull-request generated by
41+
[create-pull-request](https://github.com/peter-evans/create-pull-request)
42+
GitHub action.
43+
commit-message: "Autogenerated Jacoco Coverage Badge"
44+
author: Vincent A Cicirello <[email protected]>
45+
committer: Vincent A Cicirello <[email protected]>
46+
branch: create-pull-request/badge
47+
delete-branch: true
48+
49+
- name: Upload Jacoco coverage report
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: jacoco-report
53+
path: target/site/jacoco/
Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ name: docs
22

33
on:
44
push:
5-
branches: [ development ]
5+
branches: [ master ]
6+
paths: [ '**.java' ]
7+
pull_request:
8+
branches: [ master ]
69
paths: [ '**.java' ]
710

811
jobs:
9-
api-website:
12+
docs:
1013
runs-on: ubuntu-latest
1114
steps:
1215
- name: Checkout the repo
@@ -18,38 +21,29 @@ jobs:
1821
uses: actions/setup-java@v1
1922
with:
2023
java-version: 1.11
21-
22-
- name: Clean docs
23-
run: ant -noinput -buildfile build/builddocs.xml clean
2424

25-
- name: Build docs with Ant
26-
run: ant -noinput -buildfile build/builddocs.xml
27-
25+
- name: Build docs with Maven
26+
run: mvn javadoc:javadoc
27+
28+
- name: Copy to Documentation Website Location
29+
run: |
30+
rm -rf docs/api
31+
cp -rf target/site/apidocs/. docs/api
32+
2833
- name: Tidy up the javadocs
2934
id: tidy
3035
uses: cicirello/[email protected]
3136
with:
32-
path-to-root: docs
3337
base-url-path: https://jpt.cicirello.org/
34-
38+
path-to-root: docs
39+
3540
- name: Log javadoc-cleanup output
3641
run: |
3742
echo "modified-count = ${{ steps.tidy.outputs.modified-count }}"
38-
43+
3944
- name: Commit documentation changes
4045
run: |
41-
if [ $(git status | grep -c "**/*.html") == "0" ]; then
42-
git checkout .
43-
else
44-
if [ $(git status | grep -c "**/member-search-index.*") == "1" ]; then
45-
git checkout -- docs/api/member-search-index.zip
46-
fi
47-
if [ $(git status | grep -c "**/package-search-index.*") == "1" ]; then
48-
git checkout -- docs/api/package-search-index.zip
49-
fi
50-
if [ $(git status | grep -c "**/type-search-index.*") == "1" ]; then
51-
git checkout -- docs/api/type-search-index.zip
52-
fi
46+
if [[ `git status --porcelain` ]]; then
5347
git config --global user.name 'Vincent A Cicirello'
5448
git config --global user.email '[email protected]'
5549
git add -A
@@ -70,7 +64,8 @@ jobs:
7064
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
7165
7266
- name: Create Pull Request
73-
uses: peter-evans/[email protected]
67+
if: ${{ github.event_name == 'push' }}
68+
uses: peter-evans/[email protected]
7469
with:
7570
title: "Automated API website updates."
7671
body: >
@@ -83,5 +78,5 @@ jobs:
8378
commit-message: "Automated API documentation website updates."
8479
author: Vincent A Cicirello <[email protected]>
8580
committer: Vincent A Cicirello <[email protected]>
81+
branch: create-pull-request/docs
8682
delete-branch: true
87-

.github/workflows/maven-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
with:
6868
upload_url: ${{ steps.get.outputs.upload_url }}
69-
asset_path: dist/${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}.jar
69+
asset_path: target/${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}.jar
7070
asset_name: ${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}.jar
7171
asset_content_type: application/java-archive
7272

@@ -77,7 +77,7 @@ jobs:
7777
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7878
with:
7979
upload_url: ${{ steps.get.outputs.upload_url }}
80-
asset_path: dist/${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}-sources.jar
80+
asset_path: target/${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}-sources.jar
8181
asset_name: ${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}-sources.jar
8282
asset_content_type: application/java-archive
8383

@@ -88,6 +88,6 @@ jobs:
8888
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8989
with:
9090
upload_url: ${{ steps.get.outputs.upload_url }}
91-
asset_path: dist/${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}-javadoc.jar
91+
asset_path: target/${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}-javadoc.jar
9292
asset_name: ${{ env.artifact_name }}-${{ steps.get_version.outputs.VERSION }}-javadoc.jar
9393
asset_content_type: application/java-archive

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
bin/
22
exbin/
33
testbin/
4+
target/
5+
member-search-index.zip
6+
type-search-index.zip
7+
package-search-index.zip
8+
module-search-index.zip
9+
tag-search-index.zip

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased] - 2020-09-22
7+
## [Unreleased] - 2021-01-27
8+
89
### Added
910

1011
### Changed
@@ -13,9 +14,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1314
### Deprecated
1415

1516
### Removed
17+
* Moved the example programs to a new repository. They were previously found in directories examples and replication, both of which have been removed. All of the examples are now located in the repository: https://github.com/cicirello/jpt-examples.
18+
* Removed jars of the library from the repo. These have been available from Maven Central, GitHub Packages, and GitHub Releases, for quite some time. No need to store in repo, and it is inefficient to do so.
19+
* Removed the zip files generated by javadoc of the indexes for the api website. These are not needed for search functionality, as javadoc also stores and uses the js files contained in these zips. Later versions of javadoc no longer generate these. Also gitignored these to prevent future storage.
1620

1721
### Fixed
1822

23+
### CI/CD
24+
* Migrated build process from Ant to Maven, including GitHub workflows.
25+
* Migrated workflow for generating library website from Ant to Maven.
26+
* Added test coverage via JaCoCo.
27+
1928

2029
## [2.2.0] - 2020-09-18
2130

README.md

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JavaPermutationTools (JPT): A Java library for computation on permutations and sequences
22

3-
Copyright (C) 2018-2020 Vincent A. Cicirello.
3+
Copyright (C) 2018-2021 Vincent A. Cicirello.
44

55
https://www.cicirello.org/
66

@@ -9,7 +9,7 @@ Website: https://jpt.cicirello.org/
99
| __Publications About the Library__ | [![DOI](http://joss.theoj.org/papers/10.21105/joss.00950/status.svg)](https://doi.org/10.21105/joss.00950) |
1010
| :--- | :--- |
1111
| __Packages and Releases__ | [![Maven Central](https://img.shields.io/maven-central/v/org.cicirello/jpt.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.cicirello/jpt) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/cicirello/JavaPermutationTools?logo=GitHub)](https://github.com/cicirello/JavaPermutationTools/releases) [![DOI](https://zenodo.org/badge/139182095.svg)](https://zenodo.org/badge/latestdoi/139182095) |
12-
| __Source and Build Info__ | [![build](https://github.com/cicirello/JavaPermutationTools/workflows/build/badge.svg)](https://github.com/cicirello/JavaPermutationTools/actions?query=workflow%3Abuild) [![docs](https://github.com/cicirello/JavaPermutationTools/workflows/docs/badge.svg)](https://github.com/cicirello/JavaPermutationTools/actions?query=workflow%3Adocs) [![GitHub](https://img.shields.io/github/license/cicirello/JavaPermutationTools)](https://github.com/cicirello/JavaPermutationTools/blob/master/LICENSE) |
12+
| __Source and Build Info__ | [![build](https://github.com/cicirello/JavaPermutationTools/workflows/build/badge.svg)](https://github.com/cicirello/JavaPermutationTools/actions?query=workflow%3Abuild) [![coverage](https://github.com/cicirello/JavaPermutationTools/blob/master/.github/badges/jacoco.svg)](https://github.com/cicirello/JavaPermutationTools/actions?query=workflow%3Abuild) [![docs](https://github.com/cicirello/JavaPermutationTools/workflows/docs/badge.svg)](https://github.com/cicirello/JavaPermutationTools/actions?query=workflow%3Adocs) [![GitHub](https://img.shields.io/github/license/cicirello/JavaPermutationTools)](https://github.com/cicirello/JavaPermutationTools/blob/master/LICENSE) |
1313

1414
## How to Cite
1515

@@ -28,13 +28,9 @@ arrays, and other ordered data types).
2828
## Repository Organization
2929

3030
The GitHub repository is organized as follows:
31-
* The [/build](build) directory contains an ant build file, and other resources related to building the library.
32-
* The [/dist](dist) directory contains the compiled jar files of the library.
33-
* The [/docs](docs) directory contains the javadoc documentation in a sub-directory [/docs/api](docs/api). The /docs directory is also the location of the website for the project hosted via GitHub pages at https://jpt.cicirello.org/.
34-
* The [/examples](examples) directory contains several example programs that use the library, and which demonstrate usage of various features.
35-
* The [/replication](replication) directory includes source code that recreates results found in publications associated with the library.
36-
* The [/src](src) directory contains all of the source code.
31+
* The [/src](src) directory contains all of the source code for JavaPermutationTools.
3732
* The [/tests](tests) directory contains JUnit test cases for all functionality of the library.
33+
* The [/docs](docs) directory contains the javadoc documentation in a sub-directory /docs/api. The /docs directory is also the location of the website for the project hosted via GitHub pages at https://jpt.cicirello.org/.
3834

3935
## Java 8
4036

@@ -48,38 +44,30 @@ correspond to incompatible API changes, differences in MINOR correspond
4844
to introduction of backwards compatible new functionality, and PATCH
4945
corresponds to backwards compatible bug fixes.
5046

51-
## Building the Library (with ant)
47+
## Building the Library (with Maven)
5248

53-
The /build directory contains an ant build file. The build file
54-
also executes the JUnit tests, and the build directory contains
55-
the relevant jar files for the JUnit libraries. If you prefer,
56-
you can replace these with the latest versions available
57-
from https://junit.org/junit4/ (just be sure to edit the property
58-
fields in the build.xml to point to the locations of the JUnit jar files).
49+
The JavaPermutationTools library is built using Maven. The root of the
50+
repository contains a Maven `pom.xml`. To build the library,
51+
execute `mvn package` at the root of the repository, which
52+
will compile all classes, run all tests, run javadoc, and generate
53+
jar files of the library, the sources, and the javadocs. All build
54+
outputs will then be found in the directory `target`.
5955

60-
To execute the build process do one of the following. If your working
61-
directory is the build directory, then simply execute
62-
`ant` from the command line. If your working directory is the
63-
parent of build, then execute: `ant -f build/build.xml`
56+
To include generation of a code coverage report during the build,
57+
execute `mvn package -Pcoverage` at the root of the repository to
58+
enable a Maven profile that executes JaCoCo during the test
59+
phase. The JaCoCo report will also be found in the target directory.
6460

65-
The default of the provided ant build file, compiles all source
66-
files and all JUnit tests, executes all test cases,
67-
generates the jar file of the library, and compiles the example
68-
programs and the experiment replication programs. The
69-
build process will terminate on any test case failures.
61+
## Example Programs
7062

71-
If you use the ant build file, the build will generate the
72-
following directories: bin (for the compiled Java classes),
73-
testbin (for the compiled JUnit tests), dist (for the jar file of the library),
74-
and exbin (for the compiled example
75-
programs and experiment replication programs).
76-
77-
## Running the Example Programs
78-
79-
The examples directory contains example usage of several of the classes of the API.
80-
The replication directory additionally contains more complex examples that replicate the
81-
experiments from published papers that have used the library. Those directories contain
82-
READMEs that provide more detail on the examples, including on running the examples.
63+
There are several example programs available in a separate
64+
repository: [cicirello/jpt-examples](https://github.com/cicirello/jpt-examples). The
65+
examples repository contains example usage of several of the classes of the
66+
library. Each of the examples contains detailed comments within the source
67+
code explaining the example. Running the examples without reading the source
68+
comments is not advised. Some of the example in the examples repository are
69+
based on the experiments from published papers that have either used the library
70+
directly, or which led to some of the code in the library.
8371

8472
## Importing the Library from Maven Central
8573

@@ -91,7 +79,7 @@ Central since version 2.1.2).
9179
<dependency>
9280
<groupId>org.cicirello</groupId>
9381
<artifactId>jpt</artifactId>
94-
<version>2.1.2</version>
82+
<version>2.2.0</version>
9583
</dependency>
9684
```
9785

@@ -111,6 +99,12 @@ and (2) add the following to the repositories section of your pom.xml:
11199
</repository>
112100
```
113101

102+
## Downloading Jar Files
103+
104+
If you don't use a dependency manager that supports importing from Maven Central,
105+
or if you simply prefer to download manually, prebuilt jars are also attached to
106+
each [GitHub Release](https://github.com/cicirello/JavaPermutationTools).
107+
114108
## License
115109

116110
The JPT library is licensed under the [GNU General Public License 3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).

0 commit comments

Comments
 (0)