This commit adds documentation in the CONTRIBUTING.md file about how
releases of matchbot are made and published on Maven Central, and how
the version number changes between releases are determined.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit adds documentation in the CONTRIBUTING.md file about how to
generate POM, JAR and uberjar files using matchbot's build system.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit adds support for generating POM files and builds of matchbot
as JAR or uberjar (standalone JAR) files.
Resolves issue LibreGaming/matchbot#3
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit creates a new alias :build in deps.edn, adding the
tools.build and tools-pom libraries as dependencies. These are needed
for generating proper JAR and POM files with a Clojure build system.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
Since defn evaluates the expressions it its body in the same way as do,
this commit removes the superfluous uses of do where it appears directly
as a function body.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit sets in deps.edn the default main function to be run when
using the :test alias, making the command to run tests shorter, and
documents this shorter command in README.md.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit changes the internal representation of game names in the
state data to be strings instead of keywords. This fixes a potential
memory leak relating to games that no longer have any players, since
strings, unlike keywords, are garbage collected when no longer in use.
Resolves issue LibreGaming/matchbot#2
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit removes from the call to clojure.data.json/read the
conversion of the serialised list of players into a Clojure set, and
adds an independent function to do this task instead.
Since the structure of the serialised data is known in advance, the
recursive characteristics of clojure.data.json are not needed.
Resolves issue LibreGaming/matchbot#4
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit changes the binding name of system/start's argument to
_ (since it is currently not used within the function), and simplifies
the system/restart function by not swapping the system Var's content
with nil before filling it with the new-created system state.
Eventually, these changes will be reverted when the initialisation of
the system is separated from the starting of that system, which will
mean that system/start will read its argument and that system/restart
will have to reinitialise the system state before restarting it.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
A nil value acts as an empty map wherever a map value is expected. For
this reason, this commit removes the system/system function (which
returns an empty map), since a call to it can safely be replaced with a
nil value.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
The Atom's swap! function may run its provided function multiple
times. Because of this, using an Atom for the system state can
occasionally result in duplicate TCP connections being opened when the
system is started. These connections remain open until they
timeout (this is typically 5 minutes for IRC).
This commit changes the container for the system state from an Atom to a
Var, whose alter-var-root function (analogous to swap!) does not have
this issue.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
Since the main function will only ever start and stop one system, this
commit simplifies the main function to use a single lexical binding for
the system state rather than creating an Atom.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>