Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #3

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
21cdff7
Added namespace documentation conforming to better practice; added GPL
simon-brooke Aug 13, 2016
944b54f
Deleted version.clj, which did not work anyway.
simon-brooke Aug 13, 2016
f1b35dc
Standardised header documentation in line with current best practice.
simon-brooke Aug 21, 2016
39b7cd6
Added Docker stuff; corrected usage message.
simon-brooke Dec 27, 2016
47caea3
Don't do anything with mw-explore during buildall - it contains unrel…
simon-brooke Dec 27, 2016
3ca247e
Upversioned from 0.1.5-SNAPSHOT to 0.1.5 for release
simon-brooke Dec 27, 2016
519ca4e
Upversioned from 0.1.5 to 0.1.6-SNAPSHOT
simon-brooke Dec 27, 2016
2f2463d
Sweep up of minor changes
simon-brooke Jun 3, 2020
1cb613e
#2: Minor preparatory changes.
simon-brooke Jun 6, 2020
2cb3a6a
Trying to address bit-rot
simon-brooke Dec 9, 2021
6303097
Merge branch 'feature/2' into develop
simon-brooke Dec 9, 2021
67a4327
Fix linting issues
simon-brooke Dec 9, 2021
f4d4e9b
Upgraded everything. This may be a mistake!
simon-brooke Jul 8, 2023
5ef93ef
Work on flows, close to complete but no cigar.
simon-brooke Jul 9, 2023
f60fdb9
Executing flows now works.
simon-brooke Jul 10, 2023
8b3639e
Logging of flows; better `member?`
simon-brooke Jul 10, 2023
4f35557
Upversioning whole system to 0.2.0, for flow feature
simon-brooke Jul 10, 2023
866c00b
Some work on flow, but mainly tidyup.
simon-brooke Jul 11, 2023
68298cf
More work on flow rules. All rules must now have metadata
simon-brooke Jul 18, 2023
321e6ed
Logging rule errors.
simon-brooke Jul 18, 2023
ff6bbad
Major overhaul of rule metadata, so upversioned to 0.3.0
simon-brooke Jul 19, 2023
ac25969
Major overhaul of rule metadata, so upversioned to 0.3.0
simon-brooke Jul 19, 2023
85d6620
Much better error logging on rule execution.
simon-brooke Jul 21, 2023
4b1472d
New cell history feature
simon-brooke Jul 22, 2023
3e1e305
More on history; more error trapping on flows.
simon-brooke Jul 26, 2023
93dab80
Work in support of new development in `the-great-game`, q.v.
simon-brooke Apr 5, 2024
e19ce2e
drainage/flow-world-nr now works; drainage/flow-world still doesn't
simon-brooke Apr 6, 2024
c739dd7
Drainage is now *mostly* working...
simon-brooke Apr 6, 2024
716eb94
More work on drainage and rendering.
simon-brooke Apr 6, 2024
a44e954
comment out test code we don't want run every time the library is loa…
simon-brooke Apr 7, 2024
29d9c2e
Allow zero coordinates in cells (d'oh!)
simon-brooke May 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.calva/
target/

pom.xml

.lein-repl-history

.lein-failures

eastwood.txt

.clj-kondo/
.lsp/
.project
.settings/
.nrepl-port
.classpath

test.html
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ You can see MicroWorld in action [here](http://www.journeyman.cc/microworld/) -
but please don't be mean to my poor little server. If you want to run big maps
or complex rule-sets, please run it on your own machines.

### Version compatibility

There are substantial changes in how rule functions are evaluated between 0.1.x
versions of MicroWorld libraries and 0.3.x versions. In particular, in 0.3.x
metadata is held on rule functions which is essential to the functioning of the
engine. Consequently, you cannot mix 0.1.x and 0.3.x libraries: it will not work.

## Usage

Primary entry points are make-world and run-world, both in mw-engine.core. See
Expand Down
270 changes: 141 additions & 129 deletions buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ if [ $# -lt 1 ]
then
cat <<-EOF 1>&2
Usage:
-archive Create a tar archive of the current state of the source.
-build Build all components and commit to master.
-archive Create a tar archive of the current state of the source.
-build Build all components, commit and push to origin.
-docker Build and push a Docker image.
-email [ADDRESS] Your email address, to be recorded in the build signature.
-fullname [NAME] Your full name, to be recorded in the build signature.
-pull Pull from remote git repository
Expand All @@ -87,12 +88,14 @@ fi
while (( "$#" ))
do
case $1 in
-a|-archive)
archive="TRUE";;
-a|-archive)
archive="TRUE";;
-b|-build)
# 'build' is the expected normal case.
trial="FALSE";
;;
-d|-docker)
docker="TRUE";;
-e|-email)
shift;
email=$1;;
Expand Down Expand Up @@ -126,7 +129,7 @@ do
shift
done

echo "Trial: ${trial}; email: ${email}; fullname ${fullname}; release: ${release}; webapps: $webappsdir"
echo "Trial: ${trial}; docker: ${docker}; email: ${email}; fullname ${fullname}; release: ${release}; webapps: $webappsdir"

ls mw-* > /dev/null 2>&1
if [ $? -ne 0 ]
Expand All @@ -137,132 +140,141 @@ fi

for dir in mw-*
do
pushd ${dir}

# Make a temporary directory to keep the work-in-progress files.
if [ ! -d "${tmp}" ]
then
rm -f "${tmp}"
mkdir "${tmp}"
fi

cat project.clj > ${tmp}/project.bak.1
old=`cat project.clj | grep 'defproject mw' | sed 's/.*defproject mw-[a-z]* "\([A-Za-z0-9_.-]*\)".*/\1/'`

if [ "${release}" != "" ]
then
message="Preparing ${old} for release"

# Does the 'old' version tag end with the token "-SNAPSHOT"? it probably does!
echo "${old}" | grep 'SNAPSHOT'
if [ $? -eq 0 ]
then
# It does...
interim=`echo ${old} | sed 's/\([A-Za-z0-9_.-]*\)-SNAPSHOT.*/\1/'`
if [ "${interim}" = "" ]
then
echo "Failed to compute interim version tag from '${old}'" 1>&2
exit 1;
fi
setup-build-sig "${old}" "${interim}" "${fullname}" "${email}"
message="Upversioned from ${old} to ${interim} for release"
old=${interim}
else
setup-build-sig "unset" "${old}" "${fullname}" "${email}"
fi
else
setup-build-sig "unset" "${old}" "${fullname}" "${email}"
fi

sed -f ${tmp}/manifest.sed ${tmp}/project.bak.1 > project.clj

echo $message

lein clean
lein compile
if [ $? -ne 0 ]
then
echo "Sub-project ${dir} failed in compile" 1>&2
exit 1
fi

lein test
if [ $? -ne 0 ]
then
echo "Sub-project ${dir} failed in test" 1>&2
exit 1
fi

lein marg
lein install

# If we're in the UI project, build the uberwar - and should
# probably deploy it to local Tomcat for test
if [ "${dir}" = "mw-ui" -a "${webappsdir}" != "" ]
then
lein ring uberwar
sudo cp target/microworld.war "${webappsdir}"
echo "Deployed new WAR file to local Tomcat at ${webappsdir}"
fi

# Then unset manifest properties prior to committing.
cat project.clj > ${tmp}/project.bak.2
setup-build-sig
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.2 > project.clj

if [ "${trial}" = "FALSE" ]
then
if [ "${message}" = "" ]
then
git commit -a
else
git commit -a -m "$message"
fi
git push origin master
fi
if [ "${dir}" != "mw-explore" ]
then
pushd ${dir}

if [ "${release}" != "" ]
then
branch="${old}_MAINTENANCE"
if [ "${trial}" = "FALSE" ]
then
git branch "${branch}"
git push origin "${branch}"
fi

cat project.clj > ${tmp}/project.bak.3
setup-build-sig "${old}" "${release}-SNAPSHOT" "${fullname}" "${email}"
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.3 > project.clj
message="Upversioned from ${interim} to ${release}-SNAPSHOT"

echo $message

lein clean
lein compile
if [ $? -ne 0 ]
then
echo "Sub-project ${dir} failed in compile after branch to ${release}!" 1>&2
exit 1
fi
lein marg
lein install

# Then unset manifest properties prior to committing.
cat project.clj > ${tmp}/project.bak.4
setup-build-sig
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.4 > project.clj

if [ "${trial}" = "FALSE" ]
then
git commit -a -m "${message}"
echo ${message}
git push origin master
fi
fi
# Make a temporary directory to keep the work-in-progress files.
if [ ! -d "${tmp}" ]
then
rm -f "${tmp}"
mkdir "${tmp}"
fi

cat project.clj > ${tmp}/project.bak.1
old=`cat project.clj | grep 'defproject mw' | sed 's/.*defproject mw-[a-z]* "\([A-Za-z0-9_.-]*\)".*/\1/'`

if [ "${release}" != "" ]
then
message="Preparing ${old} for release"

# Does the 'old' version tag end with the token "-SNAPSHOT"? it probably does!
echo "${old}" | grep 'SNAPSHOT'
if [ $? -eq 0 ]
then
# It does...
interim=`echo ${old} | sed 's/\([A-Za-z0-9_.-]*\)-SNAPSHOT.*/\1/'`
if [ "${interim}" = "" ]
then
echo "Failed to compute interim version tag from '${old}'" 1>&2
exit 1;
fi
setup-build-sig "${old}" "${interim}" "${fullname}" "${email}"
message="Upversioned from ${old} to ${interim} for release"
old=${interim}
else
setup-build-sig "unset" "${old}" "${fullname}" "${email}"
fi
else
setup-build-sig "unset" "${old}" "${fullname}" "${email}"
fi

sed -f ${tmp}/manifest.sed ${tmp}/project.bak.1 > project.clj

echo $message

# if nothing broke so far, clean up...
rm -rf "${tmp}"
popd
lein clean
lein compile
if [ $? -ne 0 ]
then
echo "Sub-project ${dir} failed in compile" 1>&2
exit 1
fi

lein test
if [ $? -ne 0 ]
then
echo "Sub-project ${dir} failed in test" 1>&2
exit 1
fi

lein marg
lein install

# If we're in the UI project, build the uberwar - and should
# probably deploy it to local Tomcat for test
if [ "${dir}" = "mw-ui" -a "${webappsdir}" != "" ]
then
lein ring uberwar
sudo cp target/microworld.war "${webappsdir}"
echo "Deployed new WAR file to local Tomcat at ${webappsdir}"
fi

if [ "${dir}" = "mw-ui" -a "${docker}" = "TRUE" ]
then
lein docker build
lein docker push
fi

# Then unset manifest properties prior to committing.
cat project.clj > ${tmp}/project.bak.2
setup-build-sig
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.2 > project.clj

if [ "${trial}" = "FALSE" ]
then
if [ "${message}" = "" ]
then
git commit -a
else
git commit -a -m "$message"
fi
git push origin master
fi

if [ "${release}" != "" ]
then
branch="${old}_MAINTENANCE"
if [ "${trial}" = "FALSE" ]
then
git branch "${branch}"
git push origin "${branch}"
fi

cat project.clj > ${tmp}/project.bak.3
setup-build-sig "${old}" "${release}-SNAPSHOT" "${fullname}" "${email}"
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.3 > project.clj
message="Upversioned from ${interim} to ${release}-SNAPSHOT"

echo $message

lein clean
lein compile
if [ $? -ne 0 ]
then
echo "Sub-project ${dir} failed in compile after branch to ${release}!" 1>&2
exit 1
fi
lein marg
lein install

# Then unset manifest properties prior to committing.
cat project.clj > ${tmp}/project.bak.4
setup-build-sig
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.4 > project.clj

if [ "${trial}" = "FALSE" ]
then
git commit -a -m "${message}"
echo ${message}
git push origin master
fi
fi

# if nothing broke so far, clean up...
rm -rf "${tmp}"
popd
fi
done


Expand Down
40 changes: 40 additions & 0 deletions docs/cloverage/coverage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.covered {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: #558B55;
}

.not-covered {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: red;
}

.partial {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: orange;
}

.not-tracked {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
}

.blank {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
}

td {
padding-right: 10px;
}

td.with-bar {
width: 250px;
text-align: center;
}

td.with-number {
text-align: right;
}

td.ns-name {
min-width: 150px;
padding-right: 25px;
}
Loading