Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Sebastian Crane | b1079768ee | |
Sebastian Crane | 9ed4b34083 | |
Sebastian Crane | 0a939da401 | |
Sebastian Crane | 93306d6d34 | |
Sebastian Crane | bfd321cdb3 | |
Sebastian Crane | 69e154ea87 | |
Sebastian Crane | 7fc472c269 | |
Sebastian Crane | 428c9318fd |
|
@ -5,6 +5,12 @@
|
||||||
|
|
||||||
`matchbot` uses [version 2.0.0 of the Semantic Versioning](https://semver.org/spec/v2.0.0.html) scheme.
|
`matchbot` uses [version 2.0.0 of the Semantic Versioning](https://semver.org/spec/v2.0.0.html) scheme.
|
||||||
|
|
||||||
|
## [1.1.0] - 2022-05-14
|
||||||
|
|
||||||
|
* Add build system for generating POM, JAR and uberjar (standalone JAR) files
|
||||||
|
|
||||||
|
* Improve code quality
|
||||||
|
|
||||||
## [1.0.1] - 2022-04-01
|
## [1.0.1] - 2022-04-01
|
||||||
|
|
||||||
* Fix vulnerability that causes serialised data to be deleted when it contains certain user input
|
* Fix vulnerability that causes serialised data to be deleted when it contains certain user input
|
||||||
|
@ -17,5 +23,6 @@
|
||||||
|
|
||||||
* Initial release
|
* Initial release
|
||||||
|
|
||||||
|
[1.1.0]: https://git.libregaming.org/LibreGaming/matchbot/releases/tag/1.1.0
|
||||||
[1.0.1]: https://git.libregaming.org/LibreGaming/matchbot/releases/tag/1.0.1
|
[1.0.1]: https://git.libregaming.org/LibreGaming/matchbot/releases/tag/1.0.1
|
||||||
[1.0.0]: https://git.libregaming.org/LibreGaming/matchbot/releases/tag/1.0.0
|
[1.0.0]: https://git.libregaming.org/LibreGaming/matchbot/releases/tag/1.0.0
|
||||||
|
|
|
@ -40,3 +40,37 @@ For example:
|
||||||
> `;; SPDX-FileCopyrightText: 2022 Joe Bloggs <joe@example.com>`
|
> `;; SPDX-FileCopyrightText: 2022 Joe Bloggs <joe@example.com>`
|
||||||
|
|
||||||
If the copyright to your contributions is held by your employer, put your employer's name in brackets after your own name.
|
If the copyright to your contributions is held by your employer, put your employer's name in brackets after your own name.
|
||||||
|
|
||||||
|
## Build system
|
||||||
|
|
||||||
|
### Building a POM file
|
||||||
|
|
||||||
|
The POM file lists the dependencies needed to run `matchbot` as well as some additional information that can help people learn more about `matchbot`.
|
||||||
|
To generate a POM file, run `clojure -T:build pom`; you should find the generated `POM.xml` file in the `target/` directory.
|
||||||
|
|
||||||
|
### Building a JAR file
|
||||||
|
|
||||||
|
A JAR file contains all the source code of `matchbot` in a form that the JVM can load and pass to the Clojure compiler to run.
|
||||||
|
To generate a JAR file, run `clojure -T:build jar`; again, you should find the JAR file called something like `matchbot-x.x.x.jar` in the `target/` directory.
|
||||||
|
|
||||||
|
### Building an uberjar
|
||||||
|
|
||||||
|
An uberjar is much like a normal JAR file, but comes with all the dependencies of `matchbot` bundled in it.
|
||||||
|
This means that it can run directly on the JVM without Clojure being installed (it contains a copy of the Clojure compiler itself).
|
||||||
|
To generate an uberjar, run `clojure -T:build uber`; you should find the uberjar called something like `matchbot-x.x.x-standalone.jar` in the `target/` directory.
|
||||||
|
Please note that if you distribute an uberjar, you must not only comply with the licence of `matchbot`, but also the licences of all `matchbot`'s dependencies, both transitive and intransitive.
|
||||||
|
|
||||||
|
## Versioning and release process
|
||||||
|
|
||||||
|
### Semantic Versioning
|
||||||
|
|
||||||
|
`matchbot` uses [version 2.0.0 of the Semantic Versioning](https://semver.org/spec/v2.0.0.html) scheme, but there is still ambiguity in what exactly comprises the 'Public API' (used for determining the right part of the version to increment) for something like `matchbot`.
|
||||||
|
This 'Public API' is defined for `matchbot` as everything that is accessible by the end user or administrator of a `matchbot` instance.
|
||||||
|
For example, a change that requires the configuration file to be updated warrants a major version increment because it effects the administrator; however, a change to the structure of the internal namespaces would only require a patch level version increment because it doesn't affect either the administrator or the end user.
|
||||||
|
|
||||||
|
### Release process
|
||||||
|
|
||||||
|
At some point after a new feature has been added to `matchbot` or a bug has been fixed, a release will be made.
|
||||||
|
Once a suitable version increment for the type of changes has been determined, the `CHANGELOG.md` file at the root of the repository will be updated with release notes documenting the changes made in that version.
|
||||||
|
Then, a JAR file and a POM file will be produced using the build system (see above for more information), signed using GPG and finally uploaded to [Maven Central](https://central.sonatype.org/).
|
||||||
|
Currently this process is done by [Sebastian Crane](https://git.libregaming.org/seabass); if you would like to help with making releases, please familiarise yourself with the process (you can try everything locally except upload to Maven Central) and get in contact! 😀
|
||||||
|
|
|
@ -55,7 +55,7 @@ clojure -M -m system
|
||||||
Running the tests is a similar process to running the main application:
|
Running the tests is a similar process to running the main application:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
clojure -M:test -m kaocha.runner
|
clojure -M:test
|
||||||
```
|
```
|
||||||
|
|
||||||
### Starting a development REPL
|
### Starting a development REPL
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
;; SPDX-License-Identifier: Apache-2.0
|
||||||
|
;; SPDX-FileCopyrightText: 2022 Sebastian Crane <seabass-labrax@gmx.com>
|
||||||
|
|
||||||
|
(ns build
|
||||||
|
(:require [clojure.tools.build.api :as b]
|
||||||
|
[tools-pom.tasks :as pom]))
|
||||||
|
|
||||||
|
(def application 'org.libregaming/matchbot)
|
||||||
|
(def version "1.1.1-SNAPSHOT")
|
||||||
|
(def src-dirs ["src"])
|
||||||
|
(def target-dir "target")
|
||||||
|
(def class-dir (format "%s/%s" target-dir "classes"))
|
||||||
|
(def basis (b/create-basis {:project "deps.edn"}))
|
||||||
|
(def pom-file (format "%s/pom.xml" target-dir))
|
||||||
|
(def jar-file (format "%s/%s-%s.jar" target-dir (name application) version))
|
||||||
|
(def uber-file (format "%s/%s-%s-standalone.jar" target-dir (name application) version))
|
||||||
|
|
||||||
|
(defn clean [_]
|
||||||
|
(b/delete {:path target-dir}))
|
||||||
|
|
||||||
|
(defn uber [_]
|
||||||
|
(b/delete {:path class-dir})
|
||||||
|
(b/copy-dir {:src-dirs src-dirs
|
||||||
|
:target-dir class-dir})
|
||||||
|
(b/compile-clj {:basis basis
|
||||||
|
:src-dirs src-dirs
|
||||||
|
:class-dir class-dir})
|
||||||
|
(b/uber {:class-dir class-dir
|
||||||
|
:uber-file uber-file
|
||||||
|
:basis basis
|
||||||
|
:main 'system}))
|
||||||
|
|
||||||
|
(defn jar [_]
|
||||||
|
(b/delete {:path class-dir})
|
||||||
|
(b/copy-dir {:src-dirs src-dirs
|
||||||
|
:target-dir class-dir})
|
||||||
|
(b/jar {:class-dir class-dir
|
||||||
|
:jar-file jar-file}))
|
||||||
|
|
||||||
|
(defn pom [_]
|
||||||
|
(pom/pom
|
||||||
|
{:lib application
|
||||||
|
:version version
|
||||||
|
:write-pom true
|
||||||
|
:validate-pom true
|
||||||
|
:pom
|
||||||
|
{:description
|
||||||
|
"A chatbot for announcing upcoming matches and finding fellow players, written for the LibreGaming community"
|
||||||
|
:url
|
||||||
|
"https://git.libregaming.org/LibreGaming/matchbot"
|
||||||
|
:licenses
|
||||||
|
[:license
|
||||||
|
{:name "Apache-2.0"
|
||||||
|
:url "https://www.apache.org/licenses/LICENSE-2.0.html"}]
|
||||||
|
:developers
|
||||||
|
[:developer
|
||||||
|
{:id "seabass"
|
||||||
|
:name "Sebastian Crane"
|
||||||
|
:email "seabass-labrax@gmx.com"
|
||||||
|
:organization "LibreGaming"
|
||||||
|
:organization-url "https://libregaming.org"
|
||||||
|
:roles [:role "Maintainer"]
|
||||||
|
:timezone "Europe/London"}]
|
||||||
|
:scm
|
||||||
|
{:url "https://git.libregaming.org/LibreGaming/matchbot"
|
||||||
|
:connection "scm:git:https://git.libregaming.org/LibreGaming/matchbot.git"
|
||||||
|
:developer-connection "scm:git:ssh://git@git.libregaming.org/LibreGaming/matchbot.git"}
|
||||||
|
:issue-management
|
||||||
|
{:system "Gitea"
|
||||||
|
:url "https://git.libregaming.org/LibreGaming/matchbot/issues"}}})
|
||||||
|
(b/copy-file {:src "pom.xml" :target pom-file})
|
||||||
|
(b/delete {:path "pom.xml"}))
|
||||||
|
|
||||||
|
(defn all [_]
|
||||||
|
(jar nil)
|
||||||
|
(uber nil)
|
||||||
|
(pom nil))
|
6
deps.edn
6
deps.edn
|
@ -6,4 +6,8 @@
|
||||||
clj-commons/clj-yaml {:mvn/version "0.7.107"}
|
clj-commons/clj-yaml {:mvn/version "0.7.107"}
|
||||||
irclj/irclj {:mvn/version "0.5.0-alpha4"}}
|
irclj/irclj {:mvn/version "0.5.0-alpha4"}}
|
||||||
:aliases {:test {:extra-paths ["test"]
|
:aliases {:test {:extra-paths ["test"]
|
||||||
:extra-deps {lambdaisland/kaocha {:mvn/version "1.60.972"}}}}}
|
:extra-deps {lambdaisland/kaocha {:mvn/version "1.60.972"}}
|
||||||
|
:main-opts ["-m" "kaocha.runner"]}
|
||||||
|
:build {:deps {io.github.clojure/tools.build {:git/tag "v0.8.1" :git/sha "7d40500"}
|
||||||
|
com.github.pmonks/tools-pom {:mvn/version "1.0.74"}}
|
||||||
|
:ns-default build}}}
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
(:require [irc]
|
(:require [irc]
|
||||||
[clojure.data.json :as json]
|
[clojure.data.json :as json]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[clj-yaml.core :as yaml]))
|
[clj-yaml.core :as yaml])
|
||||||
|
(:gen-class))
|
||||||
|
|
||||||
(defn setify-vals [x]
|
(defn setify-vals [x]
|
||||||
(reduce #(assoc %1
|
(reduce #(assoc %1
|
||||||
|
@ -46,16 +47,14 @@
|
||||||
:irc irc}))
|
:irc irc}))
|
||||||
|
|
||||||
(defn stop [system]
|
(defn stop [system]
|
||||||
(do
|
(save-state
|
||||||
(save-state
|
(get-in system [:config :data-file])
|
||||||
(get-in system [:config :data-file])
|
(deref (:state system)))
|
||||||
(deref (:state system)))
|
(irclj.core/quit (system :irc)))
|
||||||
(irclj.core/quit (system :irc))))
|
|
||||||
|
|
||||||
(defn restart [system-var]
|
(defn restart [system-var]
|
||||||
(do
|
(stop (deref system-var))
|
||||||
(stop (deref system-var))
|
(alter-var-root system-var start))
|
||||||
(alter-var-root system-var start)))
|
|
||||||
|
|
||||||
(defn -main [& args]
|
(defn -main [& args]
|
||||||
(let [main-system (system/start nil)]
|
(let [main-system (system/start nil)]
|
||||||
|
|
Loading…
Reference in New Issue