Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5f96f94
Update travis
burn2delete Jan 27, 2019
80c0153
Update Makefile
burn2delete Jan 27, 2019
3be7d7e
Update Makefile
burn2delete Jan 27, 2019
8d636cd
Update .travis.yml
burn2delete Jan 27, 2019
17a0969
remove root check (bootstrap)
burn2delete Jan 27, 2019
30839de
move printVersion to bootstrap
burn2delete Feb 6, 2019
ed74de4
Update App.java
burn2delete Feb 9, 2019
13745cf
refactor for bootstrap
burn2delete Feb 10, 2019
061507f
continue refactor
burn2delete Feb 10, 2019
ca2f093
add boot.host ns
burn2delete Feb 10, 2019
3acd1bc
refacrot host os checks
burn2delete Feb 10, 2019
59deedf
Update project.clj
burn2delete Feb 10, 2019
49ca48b
Update project.clj
burn2delete Feb 10, 2019
d48c6da
Update project.clj
burn2delete Feb 10, 2019
aadc90b
bump version fix ns typo
burn2delete Feb 10, 2019
26ce63c
fix ns typo
burn2delete Feb 10, 2019
8812148
fix typos
burn2delete Feb 10, 2019
008592b
move boot.host
burn2delete Feb 10, 2019
c901855
Update util.clj
burn2delete Feb 10, 2019
10d7807
start rewriting boot.app in clojure
burn2delete Feb 11, 2019
5910991
wip
burn2delete Feb 13, 2019
60dbff2
Update .gitignore
burn2delete Apr 14, 2019
7332bea
wip
burn2delete Apr 14, 2019
5ea9ab7
wip
burn2delete Apr 14, 2019
799da8e
wip
burn2delete Apr 14, 2019
9356b29
wip
burn2delete Apr 14, 2019
1163647
wip
burn2delete Apr 14, 2019
13b644d
wip
burn2delete Apr 14, 2019
4538652
wip
burn2delete Apr 14, 2019
b9157b8
disable testing
burn2delete Apr 14, 2019
3bd19c7
remove boot-shim
burn2delete Apr 14, 2019
deca6a4
restore stash
burn2delete Apr 14, 2019
eee3ed2
restore newPod
burn2delete Apr 14, 2019
bbd6caa
restore boot.app
burn2delete Apr 14, 2019
5959142
add clojure to source paths
burn2delete Apr 14, 2019
c951161
update cojure source location
burn2delete Apr 14, 2019
1bdf7d3
restore working boot
burn2delete Apr 14, 2019
701aa64
wip
burn2delete Apr 14, 2019
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
.installed
.tested

### MAVEN (include pom.xml in /base) ###########################################
### MAVEN ###########################################

*.jar
*.war
#pom.xml
pom.xml
pom.xml.asc

### NREPL ######################################################################
Expand Down
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ jdk:
- openjdk12
- openjdk13

services:
- docker
install: make --file=.travis/Makefile deps
script: make --file=.travis/Makefile install

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
cache:
directories:
- $HOME/.m2
- $HOME/.boot/cache
- $HOME/bin
13 changes: 5 additions & 8 deletions Makefile → .travis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down Expand Up @@ -44,11 +44,8 @@ bin/boot: mkdirs

deps: bin/lein bin/boot

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): 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)
Expand All @@ -64,8 +61,8 @@ $(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)
Expand Down
1 change: 1 addition & 0 deletions boot.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
BOOT_VERSION=3.0.0-SNAPSHOT
BOOT_AS_ROOT=yes
1 change: 1 addition & 0 deletions boot/aether/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
:dependencies [[org.clojure/clojure "1.9.0" :scope "compile"]
[boot/base ~version :scope "provided"]
[boot/pod ~version :scope "compile"]
[boot/bootstrap "3.0.0-SNAPSHOT" :scope "compile"]
[com.cemerick/pomegranate "1.0.0" :scope "compile"]
[org.apache.maven.wagon/wagon-http "2.12" :scope "compile"
:exclusions [org.apache.maven.wagon/wagon-provider-api]]])
11 changes: 5 additions & 6 deletions boot/aether/src/boot/aether.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
[boot.pod :as pod]
[boot.gpg :as gpg]
[boot.from.io.aviso.ansi :as ansi]
[boot.kahnsort :as ksort])
[boot.kahnsort :as ksort]
[bootstrap.config :as conf])
(:import
[boot App]
[java.io File]
Expand All @@ -20,12 +21,10 @@
(def offline? (atom false))
(def update? (atom :daily))
(def local-repo (atom nil))
(def default-repositories (delay (let [c (boot.App/config "BOOT_CLOJARS_REPO")
m (boot.App/config "BOOT_MAVEN_CENTRAL_REPO")]
(def default-repositories (delay (let [{c :boot-clojars-repo m :boot-maven-central-repo} (conf/config)]
[["clojars" {:url (or c "https://repo.clojars.org/")}]
["maven-central" {:url (or m "https://repo1.maven.org/maven2/")}]])))
(def default-mirrors (delay (let [c (boot.App/config "BOOT_CLOJARS_MIRROR")
m (boot.App/config "BOOT_MAVEN_CENTRAL_MIRROR")
(def default-mirrors (delay (let [{c :boot-clojars-mirror m :boot-maven-central-mirror} (conf/config)
f #(when %1 {%2 {:name (str %2 " mirror") :url %1}})]
(merge {} (f c "clojars") (f m "maven-central")))))

Expand Down Expand Up @@ -391,7 +390,7 @@
context (make-context (into (default-certs) certs))]
(override-wagon-registry! (https-registry context)))))

(when-let [certs (boot.App/config "BOOT_CERTIFICATES")]
(when-let [certs (:boot-certificates (conf/config))]
(let [certs (string/split certs #":")]
(util/dbug "Using SSL certificates: %s\n" certs)
(load-certificates! certs)))
5 changes: 4 additions & 1 deletion boot/base/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:aot [#"^(?!boot\.repl-server).*$"]
:jar-exclusions [#"^clojure/core/"]
:java-source-paths ["src/main/java"]
:resource-paths ["src/main/resources"]
: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 "../../"}
Expand All @@ -16,5 +17,7 @@
["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"]
:dependencies [[org.clojure/clojure "1.9.0" :scope "provided"]
[boot/bootstrap "3.0.0-SNAPSHOT" :scope "compile"]
[org.projectodd.shimdandy/shimdandy-api "1.2.1" :scope "compile"]
[junit/junit "3.8.1" :scope "test"]])
40 changes: 7 additions & 33 deletions boot/base/src/main/java/boot/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,6 @@ public class App {
try { core.get().close(); }
catch (InterruptedException ie) {}}}

public static String
readVersion() throws Exception {
Properties p = new Properties();
try (InputStream in = resource("boot/base/version.properties")) {
p.load(in); }
return p.getProperty("version"); }

public static void
printVersion() throws Exception {
Properties p = new Properties();
Expand All @@ -446,14 +439,6 @@ public class App {
&& ! (asroot.equals("yes") || asroot.equals("1") || asroot.equals("true")))
throw new Exception("refusing to run as root (set BOOT_AS_ROOT=yes to force)");

// BOOT_VERSION is decided by the loader; it will respect the
// boot.properties files, env vars, system properties, etc.
// or it will use the latest installed version.
//
// Since 2.4.0 we can assume that bootversion and appversion
// are the same (or boot.main will throw an exception).
bootversion = appversion = readVersion();

File cachehome = mkFile(bootdir(), "cache");
File bootprops = mkFile(bootdir(), "boot.properties");
File jardir = mkFile(cachehome, "lib", appversion);
Expand All @@ -466,24 +451,6 @@ public class App {

readProps(bootprops, true);

if (args.length > 0
&& ((args[0]).equals("-u")
|| (args[0]).equals("--update"))) {
updateBoot(bootprops, (args.length > 1) ? args[1] : null, "RELEASE");
System.exit(0); }

if (args.length > 0
&& ((args[0]).equals("-U")
|| (args[0]).equals("--update-snapshot"))) {
updateBoot(bootprops, null, "(0,)");
System.exit(0); }

if (args.length > 0
&& ((args[0]).equals("-V")
|| (args[0]).equals("--version"))) {
printVersion();
System.exit(0); }

String repo = (localrepo == null)
? "default"
: md5hash((new File(localrepo)).getCanonicalFile().getPath());
Expand All @@ -498,3 +465,10 @@ public class App {
Thread shutdown = new Thread() { public void run() { ex.shutdown(); }};
Runtime.getRuntime().addShutdownHook(shutdown);
System.exit(runBoot(newCore(null), newWorker(), args)); }}

// public static void
// main(String[] args) throws Exception {

// Thread shutdown = new Thread() { public void run() { ex.shutdown(); }};
// Runtime.getRuntime().addShutdownHook(shutdown);
// System.exit(runBoot(newCore(null), newWorker(), args)); }}
2 changes: 1 addition & 1 deletion boot/base/src/main/resources/boot/base/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=${pom.version}
version=3.0.0-SNAPSHOT
40 changes: 20 additions & 20 deletions boot/core/build.boot
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
(set-env!
:source-paths #{"src" "test"}
:dependencies '[[org.clojure/tools.reader "1.0.0-alpha2"]
[metosin/boot-alt-test "0.3.2" :scope "test"]])
:dependencies '[[org.clojure/tools.reader "1.0.0-alpha2"]])
;[metosin/boot-alt-test "0.3.2" :scope "test"]])

(ns-unmap 'boot.user 'test)
;(ns-unmap 'boot.user 'test)

(require '[boot.test :refer [runtests test-report test-exit]]
'[metosin.boot-alt-test :refer [alt-test]]
'boot.test-test)
;(require '[boot.test :refer [runtests test-report test-exit]]
; '[metosin.boot-alt-test :refer [alt-test]]
; 'boot.test-test)

(import boot.App)
;(import boot.App)

(deftask integration-test []
(comp
(runtests)
(test-report)
(test-exit)))
;(deftask integration-test []
; (comp
; (runtests)
; (test-report)
; (test-exit))

(deftask unit-test []
(alt-test :test-matcher #"boot\.cli-test"))
;(deftask unit-test []
; (alt-test :test-matcher #"boot\.cli-test"))

(deftask test []
(comp
(with-pass-thru [fs]
(boot.util/info "Testing against version %s\n" (App/config "BOOT_VERSION")))
(unit-test)
(integration-test)))
;(deftask test []
; (comp
; (with-pass-thru [fs]
; (boot.util/info "Testing against version %s\n" (App/config "BOOT_VERSION"))
; (unit-test)
; (integration-test))
3 changes: 2 additions & 1 deletion boot/core/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0" :scope "provided"]
[boot/base ~version :scope "provided"]
[boot/pod ~version :scope "compile"]])
[boot/pod ~version :scope "compile"]
[boot/bootstrap "3.0.0-SNAPSHOT" :scope "provided"]])
78 changes: 78 additions & 0 deletions boot/core/src/boot/app.clj_
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
(ns boot.app
(:require [clojure.java.io :as io]
[bootstrap.config :as conf])
(:import [java.net URLClassLoader]
[java.util.concurrent Executors]
[org.projectodd.shimdandy ClojureRuntimeShim])
(:gen-class))

(defn- invoke-hooks [runtime hooks]
(reduce #(when (.exists %2) (.invoke %1 "clojure.core/load-file" (.getPath %2)) %1) runtime hooks))

(def ^:private pods (atom []))

(defn- mkshim [name exec data jars]
(let [urls (map #(.toURL (.toURI %)) jars)
classldr (URLClassLoader. urls (ClassLoader/getPlatformClassLoader))
runtime (ClojureRuntimeShim/newRuntime classldr)
hooks [(io/file (conf/boot-dir) "boot-shim.clj") (io/file "boot-shim.clj")]]
(doto runtime
(.setName (or name "anonymous"))
(invoke-hooks hooks)
(.require "boot.pod")
(.invoke "boot.pod/seal-app-classloader")
(.invoke "boot.pod/extend-addable-classloader")
(.invoke "boot.pod/set-data!" data)
(.invoke "boot.pod/set-pods!" pods)
(.invoke "boot.pod/set-this-pod!" runtime)
#(swap! pods conj %))))

(defn- set-pod-repo! [pod repo]
(if-not repo pod
(doto (.get pod)
(.require "boot.aether")
(.invoke "boot.aether/set-local-repo!" repo))))

(defn- resolve-dep-jars [shim sym] ;bootver cljname cljver]
(let [repo (:boot-local-repo (conf/config) "default")]
(doto shim
(.require "boot.aether")
(.invoke "boot.aether/set-local-repo!" repo)
(.invoke "boot.aether/update-always!")
(.invoke "boot.aether/resolve-dependency-jars" sym "3.0.0-SNAPSHOT" "org.clojure/clojure" "1.10.0"))))

(def ^:private pid (atom 0))

(defn Exit [code msg]
(ex-info msg {:error-code code}))

(defn- run-boot [corepod workerpod args]
(let [hooks (atom [])
core (.get @corepod)]
(try
(let [repo (:boot-local-repo (conf/config) "default")
worker (set-pod-repo! @workerpod repo)
pid (and (swap! pid inc) @pid)]
(.require core "boot.main")
(.invoke core "boot.main/-main" pid worker hooks args)
-1)
(catch Throwable t
(println "Boot failed to start:")
(if-let [exdata (ex-data t)]
(:error-code exdata)
(and (.printStackTrace t) -2)))
(finally
(doseq [hook hooks] @hook)
(try (.close core)
(catch InterruptedException ie -3))))))

(defn -main [& args]
(let [exec (Executors/newCachedThreadPool)
shutdown (future (.shutdown exec))
aetherpod (future (mkshim "aether" exec nil "aether.uber.jar"))
corejars (resolve-dep-jars aetherpod "boot/core")
corepod (future (mkshim "core" exec nil corejars))
workerjars (resolve-dep-jars aetherpod "boot/worker")
workerpod (future (mkshim "worker" exec nil workerjars))]
(.addShutdownHook (Runtime/getRuntime) (fn [] @shutdown))
(System/exit (run-boot corepod workerpod args))))
16 changes: 8 additions & 8 deletions boot/core/src/boot/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
[boot.util :as util]
[boot.from.io.aviso.exception :as ex]
[boot.from.clojure.tools.cli :as cli]
[boot.from.backtick :as bt])
[boot.from.backtick :as bt]
[bootstrap.config :as conf])
(:import
[boot App]
;[boot App]
[java.io File]
[java.nio.file Path Paths]
[java.net URLClassLoader URL]
Expand All @@ -45,7 +46,7 @@
.getCanonicalFile
file/split-path
rest
(apply io/file (App/getBootDir) "cache" "tmp")
(apply io/file (conf/boot-dir) "cache" "tmp")
tmp/registry
tmp/init!
delay))
Expand All @@ -60,8 +61,7 @@
(def ^:private checkout-dirs (atom #{}))
(def ^:private default-repos [["clojars" {:url "https://repo.clojars.org/"}]
["maven-central" {:url "https://repo1.maven.org/maven2"}]])
(def ^:private default-mirrors (delay (let [c (boot.App/config "BOOT_CLOJARS_MIRROR")
m (boot.App/config "BOOT_MAVEN_CENTRAL_MIRROR")
(def ^:private default-mirrors (delay (let [{c :boot-clojars-mirror m :boot-maven-central-mirror} (conf/config)
f #(when %1 {%2 {:name (str %2 " mirror") :url %1}})]
(merge {} (f c "clojars") (f m "maven-central")))))

Expand Down Expand Up @@ -230,7 +230,7 @@
"compute a seq of [name new-coord old-coord] elements describing version conflicts
when resolving the 'old' dependency vector and the 'new' dependency vector"
[old new env]
(let [clj-name (symbol (boot.App/getClojureName))
(let [clj-name (symbol (:boot-clojure-name (conf/config)))
old-deps (-> (map-of-deps env old)
(assoc clj-name (clojure-version)))]
(->> (map-of-deps env new) (keep (fn [[name coord]]
Expand All @@ -241,7 +241,7 @@
"Warn, when the version of a dependency changes. Call this with the
result of find-version-conflicts as arguments"
[coll]
(let [clj-name (symbol (boot.App/getClojureName))]
(let [clj-name (symbol (:boot-clojure-name (conf/config)))]
(doseq [[name new-coord old-coord] coll]
(let [op (if (= name clj-name) "NOT" "ALSO")]
(-> "Classpath conflict: %s version %s already loaded, %s loading version %s\n"
Expand Down Expand Up @@ -368,7 +368,7 @@
.getCanonicalFile
file/split-path
(when-not global)
(into [(App/getBootDir) "cache" "cache" (if global "global" "project")])
(into [(conf/boot-dir) "cache" "cache" (if global "global" "project")])
(#(into % ((juxt namespace name) key)))
(apply io/file)
(#(doto % .mkdirs))))
Expand Down
Loading