diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index df032a8..dcaa4da 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,8 +5,7 @@ Contribution welcome! ## How to prepare * You will need a [GitHub account](https://github.com/signup/free) - -* Submit an [issue ticket](https://github.com/creek-service/multi-module-template/issues/new) for your issue if the is no one yet. +* Submit an [issue ticket](https://github.com/creek-service/creek-platform/issues/new) for your issue if the is no one yet. * Describe the issue and include steps to reproduce if it's a bug. * Ensure to mention the earliest version that you know is affected. * If you are able and want to fix this, [fork the repository on GitHub](https://docs.github.com/en/get-started/quickstart/fork-a-repo) diff --git a/README.md b/README.md index 7865027..7e99bcc 100644 --- a/README.md +++ b/README.md @@ -1,91 +1,12 @@ - [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -[![Coverage Status](https://coveralls.io/repos/github/creek-service/multi-module-template/badge.svg?branch=main)](https://coveralls.io/github/creek-service/multi-module-template?branch=main) -[![build](https://github.com/creek-service/multi-module-template/actions/workflows/gradle.yml/badge.svg)](https://github.com/creek-service/multi-module-template/actions/workflows/gradle.yml) -[![CodeQL](https://github.com/creek-service/multi-module-template/actions/workflows/codeql.yml/badge.svg)](https://github.com/creek-service/multi-module-template/actions/workflows/codeql.yml) +[![Coverage Status](https://coveralls.io/repos/github/creek-service/creek-platform/badge.svg?branch=main)](https://coveralls.io/github/creek-service/creek-platform?branch=main) +[![build](https://github.com/creek-service/creek-platform/actions/workflows/gradle.yml/badge.svg)](https://github.com/creek-service/creek-platform/actions/workflows/gradle.yml) +[![CodeQL](https://github.com/creek-service/creek-platform/actions/workflows/codeql.yml/badge.svg)](https://github.com/creek-service/creek-platform/actions/workflows/codeql.yml) -# Multi-module template Repo -Template repo used to create other multi-module repos. +# Creek Platform -## Features +The base of the Creek platform. -The template sets up the following: +## Modules -* Multi-module Gradle Java project, including: - * Code formatting by [Spotless][1] - * Static code analysis by [Spotbugs][2] and [Checkstyle][3] - * Release versioning by the [Axion-release-plugin][4] - * Code coverage analysis by [Jacoco][5] - * Code coverage tracking by [Coveralls.io][6] - * Default set of test dependencies: - * [Unit5][7] - * [Mockito][8] - * [Hamcrest][9] - * [Guava TestLib][10] - * [Log4J 2.x][11] -* GitHub build workflow, including: - * Gradle build - * [Coveralls.io][6] reporting - * Release versioning -* GitHub code owners and PR template. - -## Usage - -### Creating a new repo from the template - -1. Click the "Use this template" button on the main page and follow the instructions. -2. Import the new repo into [Coveralls.io][12], noting the repo token. -3. Customise the repo in GitHub `Settings`->: - 1. `General`-> - 1. `Pull Requests`: - 1. un-tick: `Allow merge commits` and `Allow rebase merging`. - 2. tick: `Always suggest updating pull request branches`, `Allow auto-merging` and `Automatically delete head branches` - 2. `Collaborators and teams`-> - 1. `Manage access`: add `code-reviews` team with the `Write` role. - 3. `Secrets`->: - 1. `Actions`-> Add a new repository secret called `COVERALLS_REPO_TOKEN`, grabbing the value from Coveralls.io., - 2. `Dependabot`-> Add the same `COVERALLS_REPO_TOKEN` repository secret here too -4. Customise the files in the new repo: - 1. Replace the `multi-module-template` repo name with the name of the new project. - Each place is marked with a `ChangeMe` comment. - 2. Replace the [`example`](example) module with the repos first module. - 3. Replace the `creek.template.module.multi` module name with a suitable module name. - Each place is marked with a `ChangeMe` comment. - 4. Replace this README.md - 5. Commit changes as a PR (so you can test the PR build works!) -5. Finish customising the repo in GitHub `Settings`->`Branches` and protect the `main` branch: - 1. Tick `Require a pull request before merging` - 1. With `Require approvals` set to 1. - 2. Tick `Dismiss stale pull request approvals when new commits are pushed` - 3. Tick `Require status checks to pass before merging` - 1. With `Require branches to be up to date before merging` - 2. With status checks: - * `build` - * `codeQL` - * `coverage/coveralls` - 4. Click `Create`. -6. Finish customising the repo in Coveralls.io `Settings`->`Pull Request Alerts`: - 1. Tick `Leave comments` - 2. Set `COVERAGE THRESHOLD FOR FAILURE` to `80`% - 3. Set `COVERAGE DECREASE THRESHOLD FOR FAILURE` to `1`% - 4. Save changes. - -### Gradle commands - -* `./gradlew format` will format the code using [Spotless][1]. -* `./gradlew static` will run static code analysis, i.e. [Spotbugs][2] and [Checkstyle][3]. -* `./gradlew check` will run all checks and tests. -* `./gradlew coverage` will generate a cross-module [Jacoco][5] coverage report. - -[1]: https://github.com/diffplug/spotless -[2]: https://spotbugs.github.io/ -[3]: https://checkstyle.sourceforge.io/ -[4]: https://github.com/allegro/axion-release-plugin -[5]: https://www.jacoco.org/jacoco/trunk/doc/ -[6]: https://coveralls.io/ -[7]: https://junit.org/junit5/docs/current/user-guide/ -[8]: https://site.mockito.org/ -[9]: http://hamcrest.org/JavaHamcrest/index -[10]: https://github.com/google/guava/tree/master/guava-testlib -[11]: https://logging.apache.org/log4j/2.x/ -[12]: https://coveralls.io/ +* [metadata](metadata): A dependency-free library that defines the types used to describe platform components. diff --git a/example/src/main/java/module-info.java b/example/src/main/java/module-info.java deleted file mode 100644 index 823590f..0000000 --- a/example/src/main/java/module-info.java +++ /dev/null @@ -1,5 +0,0 @@ -// ChangeMe: to match the module, i.e. `creek..`: -// Also search for references to `reek.template.module.multi` and replace accordingly. -module creek.template.module.multi { - exports org.creekservice.api.example; -} diff --git a/example/README.md b/metadata/README.md similarity index 100% rename from example/README.md rename to metadata/README.md diff --git a/example/build.gradle.kts b/metadata/build.gradle.kts similarity index 100% rename from example/build.gradle.kts rename to metadata/build.gradle.kts diff --git a/metadata/src/main/java/module-info.java b/metadata/src/main/java/module-info.java new file mode 100644 index 0000000..ac01c73 --- /dev/null +++ b/metadata/src/main/java/module-info.java @@ -0,0 +1,3 @@ +module creek.platform.metadata { + exports org.creekservice.api.example; +} diff --git a/example/src/main/java/org/creekservice/api/example/Example.java b/metadata/src/main/java/org/creekservice/api/example/Example.java similarity index 100% rename from example/src/main/java/org/creekservice/api/example/Example.java rename to metadata/src/main/java/org/creekservice/api/example/Example.java diff --git a/example/src/main/java/org/creekservice/internal/example/ExampleImpl.java b/metadata/src/main/java/org/creekservice/internal/example/ExampleImpl.java similarity index 100% rename from example/src/main/java/org/creekservice/internal/example/ExampleImpl.java rename to metadata/src/main/java/org/creekservice/internal/example/ExampleImpl.java diff --git a/example/src/test/java/module-info.test b/metadata/src/test/java/module-info.test similarity index 70% rename from example/src/test/java/module-info.test rename to metadata/src/test/java/module-info.test index b961486..3a09ff4 100644 --- a/example/src/test/java/module-info.test +++ b/metadata/src/test/java/module-info.test @@ -2,7 +2,7 @@ org.junitpioneer,org.hamcrest,guava.testlib,creek.test.util,creek.test.hamcrest,creek.test.conformity --add-reads - creek.template.module.multi=org.junitpioneer,org.hamcrest,guava.testlib,creek.test.util,creek.test.hamcrest,creek.test.conformity + creek.platform.metadata=org.junitpioneer,org.hamcrest,guava.testlib,creek.test.util,creek.test.hamcrest,creek.test.conformity --add-opens org.junitpioneer/org.junitpioneer.jupiter=org.junit.platform.commons diff --git a/example/src/test/java/org/creekservice/ModuleTest.java b/metadata/src/test/java/org/creekservice/ModuleTest.java similarity index 100% rename from example/src/test/java/org/creekservice/ModuleTest.java rename to metadata/src/test/java/org/creekservice/ModuleTest.java diff --git a/example/src/test/java/org/creekservice/internal/example/ExampleImplTest.java b/metadata/src/test/java/org/creekservice/internal/example/ExampleImplTest.java similarity index 100% rename from example/src/test/java/org/creekservice/internal/example/ExampleImplTest.java rename to metadata/src/test/java/org/creekservice/internal/example/ExampleImplTest.java diff --git a/settings.gradle.kts b/settings.gradle.kts index f9ef803..1b1440c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,5 @@ -rootProject.name = "multi-module-template" // ChangeMe: set the root project name with the module name. +rootProject.name = "creek-platform" include( - "example" + "metadata" )