Skip to content

Commit

Permalink
project: remove aliases, review scripts
Browse files Browse the repository at this point in the history
this was needed for recent leiningen changes
  • Loading branch information
darwin committed Feb 25, 2019
1 parent 2388f6d commit df6e2f7
Show file tree
Hide file tree
Showing 27 changed files with 93 additions and 198 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ before_script:
- sudo apt-get install -y nodejs colordiff
- sudo npm install -g [email protected]

script: lein test-all
script: ./scripts/test-all.sh
49 changes: 4 additions & 45 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"test/resources/.compiled"]

:plugins [[lein-cljsbuild "1.1.7"]
[lein-shell "0.5.0"]
[lein-figwheel "0.5.17"]]

; this is just for IntelliJ + Cursive to play well
Expand All @@ -46,13 +45,10 @@

:cljsbuild {:builds {}} ; prevent https://github.com/emezeske/lein-cljsbuild/issues/413

:profiles {:nuke-aliases
{:aliases ^:replace {}}

:profiles {
:lib
^{:pom-scope :provided} ; ! to overcome default jar/pom behaviour, our :dependencies replacement would be ignored for some reason
[:nuke-aliases
{:dependencies ~(with-meta lib-deps {:replace true})
[{:dependencies ~(with-meta lib-deps {:replace true})
:source-paths ^:replace ["src/lib"]
:resource-paths ^:replace []
:test-paths ^:replace []}]
Expand Down Expand Up @@ -154,43 +150,6 @@

:dev-basic-onone
{:cooper {"server" ["scripts/launch-fixtures-server.sh"]
"figwheel" ["lein" "fig-basic-onone"]
"figwheel" ["scripts/fig-basic-onone.sh"]
"repl-agent" ["scripts/launch-repl-with-agent.sh"]
"browser" ["scripts/launch-test-browser.sh"]}}}

:aliases {"test" ["do"
["clean"]
["shell" "scripts/test.sh"]]
"test-all" ["shell" "scripts/test-all.sh"]
"dev-functional-tests" ["shell" "scripts/dev-functional-tests.sh"]
"run-functional-tests" ["do"
["clean"]
["shell" "scripts/run-functional-tests.sh"]]
"run-circus-tests" ["do"
["clean"]
["shell" "scripts/run-circus-tests.sh"]]
"build-tests" ["do"
["with-profile" "+testing-basic-onone" "cljsbuild" "once" "basic-onone"]
["with-profile" "+testing-basic-oadvanced-core" "cljsbuild" "once" "basic-oadvanced-core"]
["with-profile" "+testing-basic-oadvanced-goog" "cljsbuild" "once" "basic-oadvanced-goog"]]
"auto-build-tests" ["do"
["with-profile" "+testing-basic-onone,+auto-testing" "cljsbuild" "once" "basic-onone"]
["with-profile" "+testing-basic-oadvanced-core,+auto-testing" "cljsbuild" "once" "basic-oadvanced-core"]
["with-profile" "+testing-basic-oadvanced-goog,+auto-testing" "cljsbuild" "once" "basic-oadvanced-goog"]]
"fig-basic-onone" ["with-profile" "+testing-basic-onone,+dirac,+figwheel" "figwheel"]
"auto-basic-onone" ["with-profile" "+testing-basic-onone,+auto-testing" "cljsbuild" "auto" "basic-onone"]
"auto-test" ["do"
["clean"]
["auto-build-tests"]]
"toc" ["shell" "scripts/generate-toc.sh"]
"install" ["do"
["shell" "scripts/prepare-jar.sh"]
["shell" "scripts/local-install.sh"]]
"jar" ["shell" "scripts/prepare-jar.sh"]
"deploy" ["shell" "scripts/deploy-clojars.sh"]
"release" ["do"
["clean"]
["shell" "scripts/check-versions.sh"]
["shell" "scripts/prepare-jar.sh"]
["shell" "scripts/check-release.sh"]
["shell" "scripts/deploy-clojars.sh"]]})
"browser" ["scripts/launch-test-browser.sh"]}}})
7 changes: 7 additions & 0 deletions scripts/auto-basic-onone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e

cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

lein with-profile +testing-basic-onone,+auto-testing cljsbuild auto basic-onone
8 changes: 8 additions & 0 deletions scripts/auto-build-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

lein clean
./scripts/build-tests.sh +auto-testing
15 changes: 15 additions & 0 deletions scripts/build-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

if [[ -z "$1" ]]; then
PROFILES=""
else
PROFILES="$1,"
fi

lein with-profile "$PROFILES+testing-basic-onone" cljsbuild once basic-onone
lein with-profile "$PROFILES+testing-basic-oadvanced-core" cljsbuild once basic-oadvanced-core
lein with-profile "$PROFILES+testing-basic-oadvanced-goog" cljsbuild once basic-oadvanced-goog
7 changes: 1 addition & 6 deletions scripts/check-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

./scripts/list-jar.sh

Expand All @@ -15,5 +12,3 @@ if [[ "$LEIN_VERSION" =~ "SNAPSHOT" ]]; then
echo "Publishing SNAPSHOT versions is not allowed. Bump current version $LEIN_VERSION to a non-snapshot version."
exit 2
fi

popd
13 changes: 3 additions & 10 deletions scripts/check-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,21 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

LEIN_VERSION=`cat "$PROJECT_FILE" | grep "defproject" | cut -d' ' -f3 | cut -d\" -f2`

# same version must be in src/version.clj

PROJECT_VERSION=`cat "$PROJECT_VERSION_FILE" | grep "(def current-version" | cut -d" " -f3 | cut -d\" -f2`
if [ -z "$PROJECT_VERSION" ] ; then
if [[ -z "$PROJECT_VERSION" ]] ; then
echo "Unable to retrieve 'current-version' string from '$PROJECT_VERSION_FILE'"
popd
exit 1
fi

if [ ! "$LEIN_VERSION" = "$PROJECT_VERSION" ] ; then
if [[ ! "$LEIN_VERSION" = "$PROJECT_VERSION" ]] ; then
echo "Lein's project.clj version differs from version in '$PROJECT_VERSION_FILE': '$LEIN_VERSION' != '$PROJECT_VERSION'"
popd
exit 2
fi

echo "All version strings are consistent: '$LEIN_VERSION'"

popd
9 changes: 1 addition & 8 deletions scripts/deploy-clojars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

./scripts/list-jar.sh

Expand All @@ -19,7 +16,3 @@ if [[ "$REPLY" =~ ^[Yy]$ ]]; then
else
exit 1
fi

popd

popd
9 changes: 1 addition & 8 deletions scripts/dev-functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

export OOPS_DISABLE_TEST_RUNNER_ANSI=1
lein with-profile +cooper,+dev-basic-onone cooper

popd

popd
7 changes: 7 additions & 0 deletions scripts/fig-basic-onone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e

cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

lein with-profile +testing-basic-onone,+dirac,+figwheel figwheel
9 changes: 1 addition & 8 deletions scripts/generate-toc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

# using https://github.com/ekalinin/github-markdown-toc.go
# brew install github-markdown-toc

gh-md-toc readme.md --depth 3

popd

popd
9 changes: 2 additions & 7 deletions scripts/launch-fixtures-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

pushd "$DEV_FIXTURES_SERVER_ROOT"
cd "$DEV_FIXTURES_SERVER_ROOT"

echo "launching fixtures server for development (silent mode) in '$DEV_FIXTURES_SERVER_ROOT' on port $DEV_FIXTURES_SERVER_PORT"

python -m SimpleHTTPServer "$DEV_FIXTURES_SERVER_PORT" >/dev/null 2>&1

popd

popd
9 changes: 1 addition & 8 deletions scripts/launch-repl-with-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

echo "launching dirac agent with repl"

lein with-profile +repl-with-agent repl :headless

popd

popd
19 changes: 6 additions & 13 deletions scripts/launch-test-browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

pushd "$ROOT"

if [ ! -d "$OOPS_BROWSER_TESTS_USER_PROFILE" ] ; then
if [[ ! -d "$OOPS_BROWSER_TESTS_USER_PROFILE" ]] ; then
mkdir -p "$OOPS_BROWSER_TESTS_USER_PROFILE"
fi

EXE="/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"
if [ -f /usr/bin/google-chrome-unstable ] ; then
if [[ -f /usr/bin/google-chrome-unstable ]] ; then
EXE="/usr/bin/google-chrome-unstable" # this is for ubuntu
fi
if [ -n "$OOPS_USE_CHROME" ] ; then
if [[ -n "$OOPS_USE_CHROME" ]] ; then
EXE="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
fi
if [ -n "$OOPS_USE_CHROMIUM" ] ; then
if [[ -n "$OOPS_USE_CHROMIUM" ]] ; then
EXE="/Applications/Chromium.app/Contents/MacOS/Chromium"
fi
if [ -n "$OOPS_USE_CUSTOM_CHROME" ] ; then
if [[ -n "$OOPS_USE_CUSTOM_CHROME" ]] ; then
EXE="$OOPS_USE_CUSTOM_CHROME"
fi

Expand All @@ -43,7 +40,3 @@ set -x
--disable-gpu \
"http://localhost:$DEV_FIXTURES_SERVER_PORT/main.html?script=basic_onone" 2> /dev/null
set +x

popd

popd
9 changes: 1 addition & 8 deletions scripts/list-jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

./scripts/check-versions.sh

Expand All @@ -26,7 +23,3 @@ cat "$INSPECT_DIR/$POM_PATH" | grep -E -i "artifactId|version"
echo
echo "----------------------------"
echo

popd

popd
11 changes: 2 additions & 9 deletions scripts/local-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

./scripts/prepare-jar.sh
./scripts/list-jar.sh

lein with-profile lib install

popd

popd
9 changes: 1 addition & 8 deletions scripts/prepare-jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

lein with-profile lib jar

popd

popd
11 changes: 11 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -e

cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

lein clean
./scripts/check-versions.sh
./scripts/prepare-jar.sh
./scripts/check-release.sh
./scripts/deploy-clojars.sh
7 changes: 2 additions & 5 deletions scripts/rerun-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

pushd "$ROOT/test/resources"
cd "$ROOT/test/resources"

phantomjs phantom.js "$@"

popd
8 changes: 2 additions & 6 deletions scripts/run-circus-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

set -e

pushd `dirname "${BASH_SOURCE[0]}"` > /dev/null
source "./config.sh"

pushd "$ROOT"
cd `dirname "${BASH_SOURCE[0]}"` && source "./config.sh" && cd "$ROOT"

export OOPS_ELIDE_DEVTOOLS=1

if [[ ! -z "$1" ]]; then
export OOPS_FT_FILTER="$1"
fi

lein clean
lein with-profile +circus run -m "oops.circus"

popd
Loading

0 comments on commit df6e2f7

Please sign in to comment.