diff --git a/.github/boot-clj.png b/.github/boot-clj.png new file mode 100644 index 00000000..516ac50b Binary files /dev/null and b/.github/boot-clj.png differ diff --git a/.gitignore b/.gitignore index c70ce52a..2d372135 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ *.jar *.war -pom.xml +#pom.xml pom.xml.asc ### NREPL ###################################################################### diff --git a/.travis.yml b/.travis.yml index 9b0a1fb4..1a1856b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,8 @@ jdk: - openjdk12 - openjdk13 -install: make deps -script: make test +services: + - docker -cache: - directories: - - $HOME/.m2 - - $HOME/.boot/cache - - $HOME/bin +install: curl https://raw.githubusercontent.com/boot-clj/docker-boot/master/boot/3/Dockerfile | docker build -t bootclj/boot:latest -f - . +script: docker run -t bootclj/boot:latest cd ~/.boot/cache/bin/3.0.0-SNAPSHOT/ && ls -a diff --git a/Makefile b/Makefile index ee6b9c52..4aeaa863 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ aetheruber = aether.uber.jar workerjar = boot/worker/target/worker-$(version).jar corejar = boot/core/target/core-$(version).jar basejar = boot/base/target/base-$(version).jar -baseuber = boot/base/target/base-$(version)-jar-with-dependencies.jar +baseuber = boot/base/target/base-$(version)-standalone.jar alljars = $(podjar) $(aetherjar) $(workerjar) $(corejar) $(baseuber) $(bootjar) java_version = $(shell java -version 2>&1 | awk -F '"' '/version/ {print $$2}' |awk -F. '{print $$1 "." $$2}') @@ -23,7 +23,7 @@ help: @echo "Usage: make {help|deps|install|deploy|test|clean}" 1>&2 && false clean: - (cd boot/base && mvn -q clean && rm -f src/main/resources/$(aetheruber)) + (cd boot/base && lein clean && rm -f src/main/resources/$(aetheruber)) (cd boot/core && lein clean) (cd boot/aether && lein clean) (cd boot/pod && lein clean) @@ -44,14 +44,8 @@ bin/boot: mkdirs deps: bin/lein bin/boot -$(bootjar): $(verfile) boot/boot/project.clj - (cd boot/boot && lein install) - -boot/base/pom.xml: $(verfile) boot/base/pom.in.xml - (cd boot/base && cat pom.in.xml |sed 's/__VERSION__/$(version)/' > pom.xml) - -$(basejar): boot/base/pom.xml $(shell find boot/base/src/main/java) - (cd boot/base && mvn -q install) +$(basejar): $(verfile) boot/base/project.clj $(shell find boot/base/src/main/java) + (cd boot/base && lein install) $(podjar): $(verfile) boot/pod/project.clj $(shell find boot/pod/src) (cd boot/pod && lein install) @@ -67,8 +61,11 @@ $(workerjar): $(verfile) boot/worker/project.clj $(shell find boot/worker/src) $(corejar): $(verfile) boot/core/project.clj $(shell find boot/core/src) (cd boot/core && lein install) -$(baseuber): boot/base/pom.xml $(shell find boot/base/src/main) - (cd boot/base && mvn -q assembly:assembly -DdescriptorId=jar-with-dependencies) +$(baseuber): boot/base/project.clj $(shell find boot/base/src/main) + (cd boot/base && lein uberjar) + +$(bootjar): $(verfile) boot/boot/project.clj + (cd boot/boot && lein install) .installed: mkdirs $(basejar) $(alljars) cp $(baseuber) $(distjar) diff --git a/README.md b/README.md index f78ff084..63971700 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,4 @@ - - Boot Logo - - -# Boot +

boot-clj

[![Build Status](https://travis-ci.org/boot-clj/boot.svg?branch=master)](https://travis-ci.org/boot-clj/boot) [![Stories in Ready][waffle-badge]][waffle-board] [![Backers on Open Collective](https://opencollective.com/boot-clj/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/boot-clj/sponsors/badge.svg)](#sponsors) @@ -174,7 +170,7 @@ boot -r src -d me.raynes/conch:0.8.0 -- pom -p my-project -v 0.1.0 -- jar -M Foo ``` What we did here was we built a pipeline on the command line and ran it to -build our project. +build our project. * We specified the resource directory (files that will end up in the jar) via boot's `-r` option. * We added the `conch` dependency via boot's `-d` option. @@ -205,7 +201,7 @@ First we'll set some global boot options–we'll set the source directory and ad the `conch` dependency to the build environment: ```clojure -boot.user=> (set-env! +boot.user=> (set-env! #_=> :resource-paths #{"src"} #_=> :dependencies '[[me.raynes/conch "0.8.0"]]) ``` diff --git a/boot.properties b/boot.properties new file mode 100644 index 00000000..f7026cba --- /dev/null +++ b/boot.properties @@ -0,0 +1 @@ +BOOT_AS_ROOT=yes diff --git a/boot/aether/project.clj b/boot/aether/project.clj index 1c6e2a30..2c41d7a3 100644 --- a/boot/aether/project.clj +++ b/boot/aether/project.clj @@ -13,7 +13,7 @@ :repositories [["clojars" {:url "https://clojars.org/repo" :creds :gpg :sign-releases false}]] :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :dependencies [[org.clojure/clojure "1.6.0" :scope "compile"] + :dependencies [[org.clojure/clojure "1.9.0" :scope "compile"] [boot/base ~version :scope "provided"] [boot/pod ~version :scope "compile"] [com.cemerick/pomegranate "1.0.0" :scope "compile"] diff --git a/boot/base/pom.in.xml b/boot/base/pom.in.xml deleted file mode 100644 index 75bdfd1f..00000000 --- a/boot/base/pom.in.xml +++ /dev/null @@ -1,98 +0,0 @@ - - 4.0.0 - boot - base - jar - __VERSION__ - base - https://github.com/boot-clj/boot - Boot Java application loader and class. - - scm:git:git://github.com/boot-clj/boot.git - scm:git:ssh://git@github.com/boot-clj/boot.git - HEAD - https://github.com/boot-clj/boot.git - - - - Eclipse Public License 1.0 - http://opensource.org/licenses/eclipse-1.0.php - repo - - - - - sonatype - https://oss.sonatype.org/content/repositories/releases/ - - - sonatype-snaps - https://oss.sonatype.org/content/repositories/snapshots/ - - - clojars - https://repo.clojars.org/ - - - maven-central - http://repo1.maven.org/maven2/ - - - - UTF-8 - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - - boot.App - - - - - - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - - - - - src/main/resources - true - - **/*.properties - - - - src/main/resources - false - - **/*.properties - - - - - - - org.projectodd.shimdandy - shimdandy-api - 1.2.0 - - - junit - junit - 3.8.1 - test - - - diff --git a/boot/base/project.clj b/boot/base/project.clj new file mode 100644 index 00000000..2cc8a49d --- /dev/null +++ b/boot/base/project.clj @@ -0,0 +1,20 @@ +(import [java.util Properties]) +(require '[clojure.java.io :as io]) +(def propsfile "../../version.properties") +(def version (-> (doto (Properties.) (.load (io/input-stream propsfile))) + (.getProperty "version"))) + +(defproject boot/base version + :aot [#"^(?!boot\.repl-server).*$"] + :jar-exclusions [#"^clojure/core/"] + :java-source-paths ["src/main/java"] + :description "Boot base module–this is the classloader shim." + :url "https://github.com/boot-clj/boot" + :scm {:url "https://github.com/boot-clj/boot.git" :dir "../../"} + :repositories [["clojars" {:url "https://clojars.org/repo" :creds :gpg :sign-releases false}] + ["sonatype" {:url "https://oss.sonatype.org/content/repositories/releases"}] + ["sonatype-snaps" {:url "https://oss.sonatype.org/content/repositories/snapshots"}]] + :license {:name "Eclipse Public License" + :url "http://www.eclipse.org/legal/epl-v10.html"} + :dependencies [[org.projectodd.shimdandy/shimdandy-api "1.2.1" :scope "compile"] + [junit/junit "3.8.1" :scope "test"]]) diff --git a/boot/core/build.boot b/boot/core/build.boot index 65c7dc8a..491a7ca9 100644 --- a/boot/core/build.boot +++ b/boot/core/build.boot @@ -7,7 +7,6 @@ (require '[boot.test :refer [runtests test-report test-exit]] '[metosin.boot-alt-test :refer [alt-test]] - 'boot.task.built-in-test 'boot.test-test) (import boot.App) diff --git a/boot/core/project.clj b/boot/core/project.clj index 4b22347c..371fd692 100644 --- a/boot/core/project.clj +++ b/boot/core/project.clj @@ -13,7 +13,6 @@ :repositories [["clojars" {:url "https://clojars.org/repo" :creds :gpg :sign-releases false}]] :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"] + :dependencies [[org.clojure/clojure "1.9.0" :scope "provided"] [boot/base ~version :scope "provided"] [boot/pod ~version :scope "compile"]]) - diff --git a/boot/core/src/boot/help.clj b/boot/core/src/boot/help.clj new file mode 100644 index 00000000..c2d30554 --- /dev/null +++ b/boot/core/src/boot/help.clj @@ -0,0 +1,52 @@ +(ns boot.help + (:require [boot.core :as core] + [boot.main :as main] + [boot.task-helpers :as helpers] + [boot.from.table.core :as table] + [clojure.string :as string])) + + +(core/deftask help + "Print usage info and list available tasks." + [] + (core/with-pass-thru [_] + (let [tasks (#'helpers/available-tasks 'boot.user) + opts (->> main/cli-opts (mapv (fn [[x y z]] ["" (str x " " y) z]))) + envs [["" "BOOT_AS_ROOT" "Set to 'yes' to allow boot to run as root."] + ["" "BOOT_CERTIFICATES" "Specify certificate file paths."] + ["" "BOOT_CLOJARS_REPO" "Specify the url for the 'clojars' Maven repo."] + ["" "BOOT_CLOJARS_MIRROR" "Specify the mirror url for the 'clojars' Maven repo."] + ["" "BOOT_CLOJURE_VERSION" "The version of Clojure boot will provide (1.8.0)."] + ["" "BOOT_CLOJURE_NAME" "The artifact name of Clojure boot will provide (org.clojure/clojure)."] + ["" "BOOT_COLOR" "Set to 'no' to turn colorized output off."] + ["" "BOOT_FILE" "Build script name (build.boot)."] + ["" "BOOT_GPG_COMMAND" "System gpg command (gpg)."] + ["" "BOOT_HOME" "Directory where boot stores global state (~/.boot)."] + ["" "BOOT_WATCHERS_DISABLE" "Set to 'yes' to turn off inotify/FSEvents watches."] + ["" "BOOT_JAVA_COMMAND" "Specify the Java executable (java)."] + ["" "BOOT_JVM_OPTIONS" "Specify JVM options (Unix/Linux/OSX only)."] + ["" "BOOT_LOCAL_REPO" "The local Maven repo path (~/.m2/repository)."] + ["" "BOOT_MAVEN_CENTRAL_REPO" "Specify the url for the 'maven-central' Maven repo."] + ["" "BOOT_MAVEN_CENTRAL_MIRROR" "Specify the mirror url for the 'maven-central' Maven repo."] + ["" "BOOT_VERSION" "Specify the version of boot core to use."] + ["" "BOOT_WARN_DEPRECATED" "Set to 'no' to suppress deprecation warnings."]] + files [["" "./boot.properties" "Specify boot options for this project."] + ["" "./profile.boot" "A script to run after the global profile.boot but before the build script."] + ["" "BOOT_HOME/boot.properties" "Specify global boot options."] + ["" "BOOT_HOME/profile.boot" "A script to run before running the build script."]] + br #(conj % ["" "" ""])] + (printf "\n%s\n" + (-> [["" ""] ["Usage:" "boot OPTS TASK_OPTS TASK_OPTS ..."]] + (table/table :style :none) + with-out-str)) + (printf "%s\n\nDo `boot -h` to see usage info and TASK_OPTS for .\n" + (->> (-> [["" "" ""]] + (into (#'helpers/set-title opts "OPTS:")) (br) + (into (#'helpers/set-title (#'helpers/tasks-table tasks) "Tasks:")) (br) + (into (#'helpers/set-title envs "Env:")) (br) + (into (#'helpers/set-title files "Files:")) + (table/table :style :none) + with-out-str + (string/split #"\n")) + (map string/trimr) + (string/join "\n")))))) diff --git a/boot/core/src/boot/main.clj b/boot/core/src/boot/main.clj index cddb8e79..70efdaf3 100644 --- a/boot/core/src/boot/main.clj +++ b/boot/core/src/boot/main.clj @@ -89,7 +89,7 @@ (with-out-str (pp/write form :dispatch pp/code-dispatch))))) (defn emit [boot? argv userscript localscript bootscript import-ns inits] - (let [boot-use '[boot.core boot.util boot.task.built-in]] + (let [boot-use '[boot.core boot.util boot.help]] (str (string/join "\n\n" @@ -104,7 +104,7 @@ `(let [boot?# ~boot?] (if-not boot?# (when-let [main# (resolve 'boot.user/-main)] (main# ~@argv)) - (core/boot ~@(or (seq argv) ["boot.task.built-in/help"])))))])) + (core/boot ~@(or (seq argv) ["boot.help/help"])))))])) "\n"))) (defn shebang? [arg] diff --git a/boot/pod/project.clj b/boot/pod/project.clj index b8601db2..3000848b 100644 --- a/boot/pod/project.clj +++ b/boot/pod/project.clj @@ -16,6 +16,6 @@ :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[boot/base ~version :scope "provided"] - [org.clojure/clojure "1.6.0" :scope "provided"] + [org.clojure/clojure "1.9.0" :scope "provided"] [org.tcrawley/dynapath "1.0.0" :scope "compile"] [org.projectodd.shimdandy/shimdandy-impl "1.2.0" :scope "compile"]]) diff --git a/boot/pod/src/boot/util/spec.clj b/boot/pod/src/boot/util/spec.clj new file mode 100644 index 00000000..2309c9af --- /dev/null +++ b/boot/pod/src/boot/util/spec.clj @@ -0,0 +1,8 @@ +(ns boot.util.spec + (:require + [clojure.spec.alpha :as s] + [boot.util :as util])) + +(s/fdef util/dep-as-map + :args (s/coll-of any?) + :ret map?) diff --git a/boot/pod/test/boot/util_test.clj b/boot/pod/test/boot/util_test.clj index 90646476..ff6144e5 100644 --- a/boot/pod/test/boot/util_test.clj +++ b/boot/pod/test/boot/util_test.clj @@ -1,16 +1,20 @@ (ns boot.util-test (:require [clojure.test :refer :all] - [boot.util :as util :refer :all])) + [clojure.spec.alpha :as spec] + [clojure.spec.test.alpha :as stest] + [boot.util :as util :refer :all] + [boot.util.spec])) (deftest dep-mgt-functions - + + (stest/check 'util/dep-as-map) (let [project 'com.example/project version "1.2.3" scope "test" exclusions [['com.example/excl1 :extension "jar"] 'com.example/excl2]] - + (testing "simple dep-as-map conversions" (are [input expected] (= expected (dep-as-map input)) @@ -23,22 +27,22 @@ {:project nil :version nil :scope "compile"} - + [project] {:project project :version nil :scope "compile"} - + [project version] {:project project :version version :scope "compile"} - + [project version :scope scope] {:project project :version version :scope scope} - + [project version :scope scope :exclusions exclusions] {:project project :version version @@ -58,28 +62,28 @@ {:project project :version nil :scope scope})) - - (testing "simple map-as-dep conversions" + + (testing "simple map-as-dep conversions" (are [input expected] (= expected (map-as-dep input)) {} [] - + {:project project :version nil :scope "compile"} [project] - + {:project project :version version :scope "compile"} [project version] - + {:project project :version version :scope scope} [project version :scope scope] - + {:project project :version version :exclusions exclusions} @@ -98,21 +102,21 @@ [project :scope scope])) (testing "roundtripping deps" - + (are [input] (= input (dep-as-map (map-as-dep input))) - + {:project project :version nil :scope "compile"} - + {:project project :version version :scope "compile"} - + {:project project :version version :scope scope} - + {:project project :version version :scope scope diff --git a/boot/tasks/build.boot b/boot/tasks/build.boot new file mode 100644 index 00000000..21d95bc6 --- /dev/null +++ b/boot/tasks/build.boot @@ -0,0 +1,4 @@ +(set-env! + :source-paths #{"test"} + :resource-paths #{"src"} + :dependencies '[[org.clojure/clojure "1.9.0"]]) diff --git a/boot/tasks/project.clj b/boot/tasks/project.clj new file mode 100644 index 00000000..7432c738 --- /dev/null +++ b/boot/tasks/project.clj @@ -0,0 +1,19 @@ +(import [java.util Properties]) +(require '[clojure.java.io :as io]) +(def propsfile "../../version.properties") +(def version (-> (doto (Properties.) (.load (io/input-stream propsfile))) + (.getProperty "version"))) + +(defproject boot/tasks version + :aot [#"^(?!boot\.repl-server).*$"] + :jar-exclusions [#"^clojure/core/"] + :description "Boot tasks module–this includes built-in tasks." + :url "https://github.com/boot-clj/boot" + :scm {:url "https://github.com/boot-clj/boot.git" :dir "../../"} + :repositories [["clojars" {:url "https://clojars.org/repo" :creds :gpg :sign-releases false}]] + :license {:name "Eclipse Public License" + :url "http://www.eclipse.org/legal/epl-v10.html"} + :dependencies [[boot/base ~version :scope "provided"] + [boot/core ~version :scope "provided"] + [boot/pod ~version :scope "provided"] + [org.clojure/clojure "1.9.0" :scope "provided"]]) diff --git a/boot/core/src/boot/task/built_in.clj b/boot/tasks/src/boot/task/built_in.clj similarity index 94% rename from boot/core/src/boot/task/built_in.clj rename to boot/tasks/src/boot/task/built_in.clj index ed6c7108..26ce6e1f 100644 --- a/boot/core/src/boot/task/built_in.clj +++ b/boot/tasks/src/boot/task/built_in.clj @@ -28,52 +28,6 @@ [javax.tools ToolProvider DiagnosticCollector Diagnostic$Kind])) ;; Tasks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(core/deftask help - "Print usage info and list available tasks." - [] - (core/with-pass-thru [_] - (let [tasks (#'helpers/available-tasks 'boot.user) - opts (->> main/cli-opts (mapv (fn [[x y z]] ["" (str x " " y) z]))) - envs [["" "BOOT_AS_ROOT" "Set to 'yes' to allow boot to run as root."] - ["" "BOOT_CERTIFICATES" "Specify certificate file paths."] - ["" "BOOT_CLOJARS_REPO" "Specify the url for the 'clojars' Maven repo."] - ["" "BOOT_CLOJARS_MIRROR" "Specify the mirror url for the 'clojars' Maven repo."] - ["" "BOOT_CLOJURE_VERSION" "The version of Clojure boot will provide (1.8.0)."] - ["" "BOOT_CLOJURE_NAME" "The artifact name of Clojure boot will provide (org.clojure/clojure)."] - ["" "BOOT_COLOR" "Set to 'no' to turn colorized output off."] - ["" "BOOT_FILE" "Build script name (build.boot)."] - ["" "BOOT_GPG_COMMAND" "System gpg command (gpg)."] - ["" "BOOT_HOME" "Directory where boot stores global state (~/.boot)."] - ["" "BOOT_WATCHERS_DISABLE" "Set to 'yes' to turn off inotify/FSEvents watches."] - ["" "BOOT_JAVA_COMMAND" "Specify the Java executable (java)."] - ["" "BOOT_JVM_OPTIONS" "Specify JVM options (Unix/Linux/OSX only)."] - ["" "BOOT_LOCAL_REPO" "The local Maven repo path (~/.m2/repository)."] - ["" "BOOT_MAVEN_CENTRAL_REPO" "Specify the url for the 'maven-central' Maven repo."] - ["" "BOOT_MAVEN_CENTRAL_MIRROR" "Specify the mirror url for the 'maven-central' Maven repo."] - ["" "BOOT_VERSION" "Specify the version of boot core to use."] - ["" "BOOT_WARN_DEPRECATED" "Set to 'no' to suppress deprecation warnings."]] - files [["" "./boot.properties" "Specify boot options for this project."] - ["" "./profile.boot" "A script to run after the global profile.boot but before the build script."] - ["" "BOOT_HOME/boot.properties" "Specify global boot options."] - ["" "BOOT_HOME/profile.boot" "A script to run before running the build script."]] - br #(conj % ["" "" ""])] - (printf "\n%s\n" - (-> [["" ""] ["Usage:" "boot OPTS TASK_OPTS TASK_OPTS ..."]] - (table/table :style :none) - with-out-str)) - (printf "%s\n\nDo `boot -h` to see usage info and TASK_OPTS for .\n" - (->> (-> [["" "" ""]] - (into (#'helpers/set-title opts "OPTS:")) (br) - (into (#'helpers/set-title (#'helpers/tasks-table tasks) "Tasks:")) (br) - (into (#'helpers/set-title envs "Env:")) (br) - (into (#'helpers/set-title files "Files:")) - (table/table :style :none) - with-out-str - (string/split #"\n")) - (map string/trimr) - (string/join "\n")))))) - (core/deftask ^{:deprecated "2.6.0"} checkout "Checkout dependencies task. DEPRECATED. (Use -c, --checkouts Boot option.) diff --git a/boot/core/test/boot/task/built_in_test.clj b/boot/tasks/test/task/built_in_test.clj similarity index 100% rename from boot/core/test/boot/task/built_in_test.clj rename to boot/tasks/test/task/built_in_test.clj diff --git a/boot/worker/build.boot b/boot/worker/build.boot index 38627bb2..7d6d84c9 100644 --- a/boot/worker/build.boot +++ b/boot/worker/build.boot @@ -4,7 +4,7 @@ [mvxcvi/puget "1.0.1"] [reply "0.4.1"] [cheshire "5.3.1"] - [clj-jgit "0.8.0"] + [clj-jgit "0.8.10"] [clj-yaml "0.4.0"] [javazoom/jlayer "1.0.1"] [net.java.dev.jna/jna "4.1.0"] diff --git a/boot/worker/project.clj b/boot/worker/project.clj index 454c9586..35216623 100644 --- a/boot/worker/project.clj +++ b/boot/worker/project.clj @@ -15,7 +15,7 @@ :url "http://www.eclipse.org/legal/epl-v10.html"} :java-source-paths ["third_party/barbarywatchservice/src"] :javac-options ["-target" "1.7" "-source" "1.7"] - :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"] + :dependencies [[org.clojure/clojure "1.9.0" :scope "provided"] [boot/base ~version :scope "provided"] [boot/aether ~version] ;; Suppress warnings from SLF4J via pomegranate via aether @@ -25,7 +25,7 @@ [mvxcvi/puget "1.0.1"] [reply "0.4.1"] [cheshire "5.6.0"] - [clj-jgit "0.8.0"] + [clj-jgit "0.8.10"] [clj-yaml "0.4.0"] [javazoom/jlayer "1.0.1"] [net.java.dev.jna/jna "4.1.0"] diff --git a/version.properties b/version.properties index ece21668..cd92d6b0 100644 --- a/version.properties +++ b/version.properties @@ -1 +1 @@ -version=2.8.2 +version=3.0.0-SNAPSHOT