// Compiled by ClojureScript 1.9.293 {:target :nodejs}
goog.provide('eginez.calvin.core');
goog.require('cljs.core');
goog.require('eginez.huckleberry.core');
goog.require('cljs.pprint');
goog.require('cljs.core.async');
goog.require('cljs.tools.cli');
goog.require('cljs.analyzer');
goog.require('cljs.nodejs');
goog.require('clojure.string');
goog.require('cljs.reader');
eginez.calvin.core.fs = cljs.nodejs.require.call(null,"fs");
eginez.calvin.core.npath = cljs.nodejs.require.call(null,"path");
eginez.calvin.core.nchild = cljs.nodejs.require.call(null,"child_process");
eginez.calvin.core.nproc = cljs.nodejs.require.call(null,"process");
eginez.calvin.core.build_preface = cljs.core.list(new cljs.core.Symbol(null,"require","require",1172530194,null),cljs.core.list(new cljs.core.Symbol(null,"quote","quote",1377916282,null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"lumo.build.api","lumo.build.api",1252131409,null),new cljs.core.Keyword(null,"as","as",1148689641),new cljs.core.Symbol(null,"b","b",-1172211299,null)], null)));
eginez.calvin.core.debug_QMARK_ = cljs.core.atom.call(null,false);
eginez.calvin.core.println_err = (function eginez$calvin$core$println_err(var_args){
var args__7658__auto__ = [];
var len__7651__auto___20271 = arguments.length;
var i__7652__auto___20272 = (0);
while(true){
if((i__7652__auto___20272 < len__7651__auto___20271)){
args__7658__auto__.push((arguments[i__7652__auto___20272]));

var G__20273 = (i__7652__auto___20272 + (1));
i__7652__auto___20272 = G__20273;
continue;
} else {
}
break;
}

var argseq__7659__auto__ = ((((0) < args__7658__auto__.length))?(new cljs.core.IndexedSeq(args__7658__auto__.slice((0)),(0),null)):null);
return eginez.calvin.core.println_err.cljs$core$IFn$_invoke$arity$variadic(argseq__7659__auto__);
});

eginez.calvin.core.println_err.cljs$core$IFn$_invoke$arity$variadic = (function (args){
var _STAR_print_fn_STAR_20270 = cljs.core._STAR_print_fn_STAR_;
cljs.core._STAR_print_fn_STAR_ = cljs.core._STAR_print_err_fn_STAR_;

try{return cljs.core.apply.call(null,cljs.core.println,args);
}finally {cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR_20270;
}});

eginez.calvin.core.println_err.cljs$lang$maxFixedArity = (0);

eginez.calvin.core.println_err.cljs$lang$applyTo = (function (seq20269){
return eginez.calvin.core.println_err.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq20269));
});

eginez.calvin.core.warn = (function eginez$calvin$core$warn(var_args){
var args__7658__auto__ = [];
var len__7651__auto___20275 = arguments.length;
var i__7652__auto___20276 = (0);
while(true){
if((i__7652__auto___20276 < len__7651__auto___20275)){
args__7658__auto__.push((arguments[i__7652__auto___20276]));

var G__20277 = (i__7652__auto___20276 + (1));
i__7652__auto___20276 = G__20277;
continue;
} else {
}
break;
}

var argseq__7659__auto__ = ((((0) < args__7658__auto__.length))?(new cljs.core.IndexedSeq(args__7658__auto__.slice((0)),(0),null)):null);
return eginez.calvin.core.warn.cljs$core$IFn$_invoke$arity$variadic(argseq__7659__auto__);
});

eginez.calvin.core.warn.cljs$core$IFn$_invoke$arity$variadic = (function (args){
return cljs.core.apply.call(null,eginez.calvin.core.println_err,"WARNING:",args);
});

eginez.calvin.core.warn.cljs$lang$maxFixedArity = (0);

eginez.calvin.core.warn.cljs$lang$applyTo = (function (seq20274){
return eginez.calvin.core.warn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq20274));
});

eginez.calvin.core.fatal = (function eginez$calvin$core$fatal(var_args){
var args__7658__auto__ = [];
var len__7651__auto___20279 = arguments.length;
var i__7652__auto___20280 = (0);
while(true){
if((i__7652__auto___20280 < len__7651__auto___20279)){
args__7658__auto__.push((arguments[i__7652__auto___20280]));

var G__20281 = (i__7652__auto___20280 + (1));
i__7652__auto___20280 = G__20281;
continue;
} else {
}
break;
}

var argseq__7659__auto__ = ((((0) < args__7658__auto__.length))?(new cljs.core.IndexedSeq(args__7658__auto__.slice((0)),(0),null)):null);
return eginez.calvin.core.fatal.cljs$core$IFn$_invoke$arity$variadic(argseq__7659__auto__);
});

eginez.calvin.core.fatal.cljs$core$IFn$_invoke$arity$variadic = (function (args){
cljs.core.apply.call(null,eginez.calvin.core.println_err,"FATAL:",args);

return process.exit((1));
});

eginez.calvin.core.fatal.cljs$lang$maxFixedArity = (0);

eginez.calvin.core.fatal.cljs$lang$applyTo = (function (seq20278){
return eginez.calvin.core.fatal.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq20278));
});

eginez.calvin.core.debug = (function eginez$calvin$core$debug(var_args){
var args__7658__auto__ = [];
var len__7651__auto___20283 = arguments.length;
var i__7652__auto___20284 = (0);
while(true){
if((i__7652__auto___20284 < len__7651__auto___20283)){
args__7658__auto__.push((arguments[i__7652__auto___20284]));

var G__20285 = (i__7652__auto___20284 + (1));
i__7652__auto___20284 = G__20285;
continue;
} else {
}
break;
}

var argseq__7659__auto__ = ((((0) < args__7658__auto__.length))?(new cljs.core.IndexedSeq(args__7658__auto__.slice((0)),(0),null)):null);
return eginez.calvin.core.debug.cljs$core$IFn$_invoke$arity$variadic(argseq__7659__auto__);
});

eginez.calvin.core.debug.cljs$core$IFn$_invoke$arity$variadic = (function (args){
if(cljs.core.truth_(cljs.core.deref.call(null,eginez.calvin.core.debug_QMARK_))){
return cljs.core.apply.call(null,eginez.calvin.core.println_err,args);
} else {
return null;
}
});

eginez.calvin.core.debug.cljs$lang$maxFixedArity = (0);

eginez.calvin.core.debug.cljs$lang$applyTo = (function (seq20282){
return eginez.calvin.core.debug.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq20282));
});

eginez.calvin.core.find_file = (function eginez$calvin$core$find_file(fpath){
try{var files = eginez.calvin.core.fs.readdirSync(fpath);
var fname = cljs.core.first.call(null,cljs.core.filter.call(null,((function (files){
return (function (p1__20286_SHARP_){
return clojure.string.includes_QMARK_.call(null,p1__20286_SHARP_,"project.clj");
});})(files))
,files));
var or__6543__auto__ = eginez.calvin.core.npath.join(fpath,fname);
if(cljs.core.truth_(or__6543__auto__)){
return or__6543__auto__;
} else {
return null;
}
}catch (e20288){if((e20288 instanceof Error)){
var e = e20288;
return null;
} else {
throw e20288;

}
}});
eginez.calvin.core.samedep_QMARK_ = (function eginez$calvin$core$samedep_QMARK_(dep1,dep2){
return (cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"artifact","artifact",610074681).cljs$core$IFn$_invoke$arity$1(dep1),new cljs.core.Keyword(null,"artifact","artifact",610074681).cljs$core$IFn$_invoke$arity$1(dep2))) && (cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"version","version",425292698).cljs$core$IFn$_invoke$arity$1(dep1),new cljs.core.Keyword(null,"version","version",425292698).cljs$core$IFn$_invoke$arity$1(dep2))) && (cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"group","group",582596132).cljs$core$IFn$_invoke$arity$1(dep1),new cljs.core.Keyword(null,"group","group",582596132).cljs$core$IFn$_invoke$arity$1(dep2)));
});
eginez.calvin.core.dep_main_keys = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"artifact","artifact",610074681),new cljs.core.Keyword(null,"version","version",425292698),new cljs.core.Keyword(null,"group","group",582596132)], null);
eginez.calvin.core.load_content = (function eginez$calvin$core$load_content(file){
try{return eginez.calvin.core.fs.readFileSync(file).toString();
}catch (e20290){if((e20290 instanceof Error)){
var e = e20290;
return null;
} else {
throw e20290;

}
}});
eginez.calvin.core.find_lein_project_configuration = (function eginez$calvin$core$find_lein_project_configuration(lein_project_file){
if(cljs.core.truth_(lein_project_file)){
var content = eginez.calvin.core.load_content.call(null,lein_project_file);
var rcontent = cljs.reader.read_string.call(null,content);
var vec__20295 = rcontent;
var seq__20296 = cljs.core.seq.call(null,vec__20295);
var first__20297 = cljs.core.first.call(null,seq__20296);
var seq__20296__$1 = cljs.core.next.call(null,seq__20296);
var _ = first__20297;
var first__20297__$1 = cljs.core.first.call(null,seq__20296__$1);
var seq__20296__$2 = cljs.core.next.call(null,seq__20296__$1);
var name = first__20297__$1;
var first__20297__$2 = cljs.core.first.call(null,seq__20296__$2);
var seq__20296__$3 = cljs.core.next.call(null,seq__20296__$2);
var version = first__20297__$2;
var opts = seq__20296__$3;
var lopts = cljs.core.partition.call(null,(2),opts);
var mapopts = cljs.core.map.call(null,((function (content,rcontent,vec__20295,seq__20296,first__20297,seq__20296__$1,_,first__20297__$1,seq__20296__$2,name,first__20297__$2,seq__20296__$3,version,opts,lopts){
return (function (p1__20291_SHARP_){
return cljs.core.assoc.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.first.call(null,p1__20291_SHARP_),cljs.core.second.call(null,p1__20291_SHARP_));
});})(content,rcontent,vec__20295,seq__20296,first__20297,seq__20296__$1,_,first__20297__$1,seq__20296__$2,name,first__20297__$2,seq__20296__$3,version,opts,lopts))
,lopts);
var ret = cljs.core.reduce.call(null,cljs.core.merge,mapopts);
return ret;
} else {
return null;
}
});
eginez.calvin.core.resolve_dependencies = (function eginez$calvin$core$resolve_dependencies(coordinates,retrieve){
var dp = eginez.huckleberry.core.resolve_dependencies.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),coordinates,new cljs.core.Keyword(null,"local-repo","local-repo",764410280),new cljs.core.Keyword(null,"local","local",-1497766724).cljs$core$IFn$_invoke$arity$1(eginez.huckleberry.core.default_repos),new cljs.core.Keyword(null,"retrieve","retrieve",-657129560),retrieve);
return dp;
});
eginez.calvin.core.find_build_from_vector = (function eginez$calvin$core$find_build_from_vector(builds,id){
var build = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p1__20298_SHARP_){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(p1__20298_SHARP_),id);
}),builds));
if(cljs.core.truth_(build)){
return build;
} else {
eginez.calvin.core.warn.call(null,"No build with id",[cljs.core.str("`"),cljs.core.str(id),cljs.core.str("'")].join(''),"found, falling back to",[cljs.core.str("`"),cljs.core.str(new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,builds))),cljs.core.str("'")].join(''));

return cljs.core.first.call(null,builds);
}
});
eginez.calvin.core.find_build_from_map = (function eginez$calvin$core$find_build_from_map(builds,id){
var build = cljs.core.get.call(null,builds,id,cljs.core.get.call(null,builds,cljs.core.keyword.call(null,id)));
if(cljs.core.truth_(build)){
return build;
} else {
eginez.calvin.core.warn.call(null,"No build with id",[cljs.core.str("`"),cljs.core.str(id),cljs.core.str("'")].join(''),"found, falling back to",[cljs.core.str("`"),cljs.core.str(cljs.core.key.call(null,cljs.core.first.call(null,builds))),cljs.core.str("'")].join(''));

return cljs.core.val.call(null,cljs.core.first.call(null,builds));
}
});
eginez.calvin.core.find_cljsbuild_build = (function eginez$calvin$core$find_cljsbuild_build(project,id){
var builds = cljs.core.get_in.call(null,project,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cljsbuild","cljsbuild",-518195792),new cljs.core.Keyword(null,"builds","builds",-1946283802)], null));
if(cljs.core.not.call(null,cljs.core.seq.call(null,builds))){
eginez.calvin.core.fatal.call(null,"No cljsbuild :builds configured.");

return null;
} else {
if(cljs.core.vector_QMARK_.call(null,builds)){
return eginez.calvin.core.find_build_from_vector.call(null,builds,id);
} else {
if(cljs.core.map_QMARK_.call(null,builds)){
return eginez.calvin.core.find_build_from_map.call(null,builds,id);
} else {
return eginez.calvin.core.fatal.call(null,"cljsbuild :builds configuration must be a vector or a map, got",cljs.core.prn.call(null,builds));

}
}
}
});
eginez.calvin.core.find_source_path = (function eginez$calvin$core$find_source_path(build){
var source_paths = new cljs.core.Keyword(null,"source-paths","source-paths",-71903349).cljs$core$IFn$_invoke$arity$1(build);
var dropped = cljs.core.rest.call(null,source_paths);
if(cljs.core.vector_QMARK_.call(null,source_paths)){
} else {
eginez.calvin.core.fatal.call(null,":source-paths must be a vector, got",cljs.core.prn.call(null,source_paths));
}

if(cljs.core.seq.call(null,dropped)){
eginez.calvin.core.warn.call(null,"Current lumo api does not support multiple sources, dropping ",dropped);
} else {
}

return cljs.core.first.call(null,source_paths);
});
eginez.calvin.core.find_compiler_opts = (function eginez$calvin$core$find_compiler_opts(build){
var opts = new cljs.core.Keyword(null,"compiler","compiler",-267926731).cljs$core$IFn$_invoke$arity$1(build);
var main = new cljs.core.Keyword(null,"main","main",-2117802661).cljs$core$IFn$_invoke$arity$1(opts);
var target = new cljs.core.Keyword(null,"target","target",253001721).cljs$core$IFn$_invoke$arity$1(opts);
if(cljs.core._EQ_.call(null,target,new cljs.core.Keyword(null,"nodejs","nodejs",321212524))){
} else {
eginez.calvin.core.warn.call(null,"The compile target should be :nodejs, got",cljs.core.prn.call(null,target),". Try adding {:compiler {:target :nodejs}}.");
}

return cljs.core.assoc.call(null,opts,new cljs.core.Keyword(null,"main","main",-2117802661),cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,cljs.core._conj.call(null,cljs.core.List.EMPTY,new cljs.core.Symbol(null,"quote","quote",1377916282,null)),(function (){var x__7380__auto__ = main;
return cljs.core._conj.call(null,cljs.core.List.EMPTY,x__7380__auto__);
})()))));
});
eginez.calvin.core.build_build_command = (function eginez$calvin$core$build_build_command(src_projects,compiler_options){
var b = cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,cljs.core._conj.call(null,cljs.core.List.EMPTY,new cljs.core.Symbol("b","build","b/build",-1690039705,null)),(function (){var x__7380__auto__ = src_projects;
return cljs.core._conj.call(null,cljs.core.List.EMPTY,x__7380__auto__);
})(),(function (){var x__7380__auto__ = compiler_options;
return cljs.core._conj.call(null,cljs.core.List.EMPTY,x__7380__auto__);
})())));
return clojure.string.join.call(null," ",cljs.core.map.call(null,cljs.core.str,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [eginez.calvin.core.build_preface,b], null)));
});
eginez.calvin.core.resolve_classpath = (function eginez$calvin$core$resolve_classpath(project){
var c__13836__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__13836__auto__){
return (function (){
var f__13837__auto__ = (function (){var switch__13813__auto__ = ((function (c__13836__auto__){
return (function (state_20335){
var state_val_20336 = (state_20335[(1)]);
if((state_val_20336 === (1))){
var inst_20324 = (state_20335[(7)]);
var inst_20324__$1 = new cljs.core.Keyword(null,"dependencies","dependencies",1108064605).cljs$core$IFn$_invoke$arity$1(project);
var state_20335__$1 = (function (){var statearr_20337 = state_20335;
(statearr_20337[(7)] = inst_20324__$1);

return statearr_20337;
})();
if(cljs.core.truth_(inst_20324__$1)){
var statearr_20338_20349 = state_20335__$1;
(statearr_20338_20349[(1)] = (2));

} else {
var statearr_20339_20350 = state_20335__$1;
(statearr_20339_20350[(1)] = (3));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_20336 === (2))){
var inst_20324 = (state_20335[(7)]);
var inst_20326 = eginez.calvin.core.resolve_dependencies.call(null,inst_20324,true);
var state_20335__$1 = state_20335;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_20335__$1,(5),inst_20326);
} else {
if((state_val_20336 === (3))){
var state_20335__$1 = state_20335;
var statearr_20340_20351 = state_20335__$1;
(statearr_20340_20351[(2)] = null);

(statearr_20340_20351[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_20336 === (4))){
var inst_20333 = (state_20335[(2)]);
var state_20335__$1 = state_20335;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_20335__$1,inst_20333);
} else {
if((state_val_20336 === (5))){
var inst_20328 = (state_20335[(2)]);
var inst_20329 = cljs.core.map.call(null,eginez.huckleberry.core.dep__GT_path,inst_20328);
var inst_20330 = clojure.string.join.call(null,":",inst_20329);
var state_20335__$1 = state_20335;
var statearr_20341_20352 = state_20335__$1;
(statearr_20341_20352[(2)] = inst_20330);

(statearr_20341_20352[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
});})(c__13836__auto__))
;
return ((function (switch__13813__auto__,c__13836__auto__){
return (function() {
var eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto__ = null;
var eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto____0 = (function (){
var statearr_20345 = [null,null,null,null,null,null,null,null];
(statearr_20345[(0)] = eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto__);

(statearr_20345[(1)] = (1));

return statearr_20345;
});
var eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto____1 = (function (state_20335){
while(true){
var ret_value__13815__auto__ = (function (){try{while(true){
var result__13816__auto__ = switch__13813__auto__.call(null,state_20335);
if(cljs.core.keyword_identical_QMARK_.call(null,result__13816__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__13816__auto__;
}
break;
}
}catch (e20346){if((e20346 instanceof Object)){
var ex__13817__auto__ = e20346;
var statearr_20347_20353 = state_20335;
(statearr_20347_20353[(5)] = ex__13817__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_20335);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e20346;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__13815__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__20354 = state_20335;
state_20335 = G__20354;
continue;
} else {
return ret_value__13815__auto__;
}
break;
}
});
eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto__ = function(state_20335){
switch(arguments.length){
case 0:
return eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto____0.call(this);
case 1:
return eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto____1.call(this,state_20335);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$0 = eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto____0;
eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$1 = eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto____1;
return eginez$calvin$core$resolve_classpath_$_state_machine__13814__auto__;
})()
;})(switch__13813__auto__,c__13836__auto__))
})();
var state__13838__auto__ = (function (){var statearr_20348 = f__13837__auto__.call(null);
(statearr_20348[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__13836__auto__);

return statearr_20348;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__13838__auto__);
});})(c__13836__auto__))
);

return c__13836__auto__;
});
eginez.calvin.core.lumo_build_cmd = (function eginez$calvin$core$lumo_build_cmd(project,id,classpath){
var build = eginez.calvin.core.find_cljsbuild_build.call(null,project,id);
var src_path = eginez.calvin.core.find_source_path.call(null,build);
var compiler_options = eginez.calvin.core.find_compiler_opts.call(null,build);
var build_cmd = eginez.calvin.core.build_build_command.call(null,src_path,compiler_options);
var final_cmd = [cljs.core.str("\""),cljs.core.str(clojure.string.replace_all.call(null,build_cmd,/\"/,"\\\"")),cljs.core.str("\"")].join('');
eginez.calvin.core.debug.call(null,"build lumo cmd with ",final_cmd," and path ",classpath);

return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["lumo",new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, ["-c",[cljs.core.str(src_path),cljs.core.str(":"),cljs.core.str(classpath)].join(''),"-e",final_cmd], null)], null);
});
eginez.calvin.core.print_dep_tree = (function eginez$calvin$core$print_dep_tree(resolved_deps,head_dep,root,graph,depth){
var art = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p1__20355_SHARP_){
return eginez.calvin.core.samedep_QMARK_.call(null,root,p1__20355_SHARP_);
}),cljs.core.keys.call(null,graph)));
if(cljs.core.contains_QMARK_.call(null,resolved_deps,art)){
var deps = cljs.core.get.call(null,graph,art);
cljs.core.println.call(null,clojure.string.join.call(null,cljs.core.concat.call(null,cljs.core.repeat.call(null,depth,"*"),">")),eginez.huckleberry.core.dep__GT_coordinate.call(null,art));

var seq__20360 = cljs.core.seq.call(null,deps);
var chunk__20361 = null;
var count__20362 = (0);
var i__20363 = (0);
while(true){
if((i__20363 < count__20362)){
var d = cljs.core._nth.call(null,chunk__20361,i__20363);
eginez.calvin.core.print_dep_tree.call(null,resolved_deps,head_dep,d,graph,(depth + (1)));

var G__20364 = seq__20360;
var G__20365 = chunk__20361;
var G__20366 = count__20362;
var G__20367 = (i__20363 + (1));
seq__20360 = G__20364;
chunk__20361 = G__20365;
count__20362 = G__20366;
i__20363 = G__20367;
continue;
} else {
var temp__4657__auto__ = cljs.core.seq.call(null,seq__20360);
if(temp__4657__auto__){
var seq__20360__$1 = temp__4657__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__20360__$1)){
var c__7357__auto__ = cljs.core.chunk_first.call(null,seq__20360__$1);
var G__20368 = cljs.core.chunk_rest.call(null,seq__20360__$1);
var G__20369 = c__7357__auto__;
var G__20370 = cljs.core.count.call(null,c__7357__auto__);
var G__20371 = (0);
seq__20360 = G__20368;
chunk__20361 = G__20369;
count__20362 = G__20370;
i__20363 = G__20371;
continue;
} else {
var d = cljs.core.first.call(null,seq__20360__$1);
eginez.calvin.core.print_dep_tree.call(null,resolved_deps,head_dep,d,graph,(depth + (1)));

var G__20372 = cljs.core.next.call(null,seq__20360__$1);
var G__20373 = null;
var G__20374 = (0);
var G__20375 = (0);
seq__20360 = G__20372;
chunk__20361 = G__20373;
count__20362 = G__20374;
i__20363 = G__20375;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return cljs.core.println.call(null,[cljs.core.str("[FAILED]"),cljs.core.str(clojure.string.join.call(null,cljs.core.concat.call(null,cljs.core.repeat.call(null,depth,"*"),">")))].join(''),eginez.huckleberry.core.dep__GT_coordinate.call(null,root));
}
});
eginez.calvin.core.show_all_deps = (function eginez$calvin$core$show_all_deps(resolved_deps,graph){
while(true){
if(cljs.core.truth_(cljs.core.not_empty.call(null,graph))){
var resolved_deps__$1 = cljs.core.into.call(null,cljs.core.PersistentHashSet.EMPTY,cljs.core.map.call(null,((function (resolved_deps,graph){
return (function (p1__20376_SHARP_){
return cljs.core.select_keys.call(null,p1__20376_SHARP_,eginez.calvin.core.dep_main_keys);
});})(resolved_deps,graph))
,resolved_deps));
var root = cljs.core.select_keys.call(null,cljs.core.dissoc.call(null,cljs.core.first.call(null,graph),new cljs.core.Keyword(null,"exclusions","exclusions",1098729003)),eginez.calvin.core.dep_main_keys);
var dg = cljs.core.second.call(null,graph);
var head_dep = cljs.core.first.call(null,cljs.core.filter.call(null,((function (resolved_deps,graph,resolved_deps__$1,root,dg){
return (function (p1__20377_SHARP_){
return eginez.calvin.core.samedep_QMARK_.call(null,root,p1__20377_SHARP_);
});})(resolved_deps,graph,resolved_deps__$1,root,dg))
,cljs.core.keys.call(null,dg)));
cljs.core.println.call(null);

eginez.calvin.core.print_dep_tree.call(null,resolved_deps__$1,head_dep,root,dg,(0));

var G__20378 = resolved_deps__$1;
var G__20379 = cljs.core.drop.call(null,(2),graph);
resolved_deps = G__20378;
graph = G__20379;
continue;
} else {
return null;
}
break;
}
});
eginez.calvin.core.build_cmd_for_platform = (function eginez$calvin$core$build_cmd_for_platform(platform,classpath){
var classpath_cmd = (cljs.core.truth_(classpath)?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["-c",classpath], null):cljs.core.PersistentVector.EMPTY);
var G__20381 = platform;
switch (G__20381) {
case "lumo":
return cljs.core.conj.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["lumo"], null),classpath_cmd);

break;
case "planck":
return cljs.core.conj.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["planck"], null),classpath_cmd);

break;
default:
throw (new Error([cljs.core.str("No matching clause: "),cljs.core.str(platform)].join('')));

}
});
eginez.calvin.core.show_deps = (function eginez$calvin$core$show_deps(project){
var c__13836__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__13836__auto__){
return (function (){
var f__13837__auto__ = (function (){var switch__13813__auto__ = ((function (c__13836__auto__){
return (function (state_20449){
var state_val_20450 = (state_20449[(1)]);
if((state_val_20450 === (1))){
var inst_20425 = (state_20449[(7)]);
var inst_20424 = cljs.core.println.call(null,"Calculating dependencies");
var inst_20425__$1 = new cljs.core.Keyword(null,"dependencies","dependencies",1108064605).cljs$core$IFn$_invoke$arity$1(project);
var state_20449__$1 = (function (){var statearr_20451 = state_20449;
(statearr_20451[(8)] = inst_20424);

(statearr_20451[(7)] = inst_20425__$1);

return statearr_20451;
})();
if(cljs.core.truth_(inst_20425__$1)){
var statearr_20452_20464 = state_20449__$1;
(statearr_20452_20464[(1)] = (2));

} else {
var statearr_20453_20465 = state_20449__$1;
(statearr_20453_20465[(1)] = (3));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_20450 === (2))){
var inst_20425 = (state_20449[(7)]);
var inst_20430 = eginez.calvin.core.resolve_dependencies.call(null,inst_20425,false);
var state_20449__$1 = state_20449;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_20449__$1,(5),inst_20430);
} else {
if((state_val_20450 === (3))){
var inst_20445 = eginez.calvin.core.warn.call(null,"No dependencies file found are you missing a project.clj or boot.clj?");
var state_20449__$1 = state_20449;
var statearr_20454_20466 = state_20449__$1;
(statearr_20454_20466[(2)] = inst_20445);

(statearr_20454_20466[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_20450 === (4))){
var inst_20447 = (state_20449[(2)]);
var state_20449__$1 = state_20449;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_20449__$1,inst_20447);
} else {
if((state_val_20450 === (5))){
var inst_20425 = (state_20449[(7)]);
var inst_20432 = (state_20449[(2)]);
var inst_20433 = cljs.core.nth.call(null,inst_20432,(0),null);
var inst_20434 = cljs.core.nth.call(null,inst_20432,(1),null);
var inst_20435 = cljs.core.nth.call(null,inst_20432,(2),null);
var inst_20436 = cljs.core.first.call(null,inst_20434);
var inst_20437 = cljs.core.dissoc.call(null,inst_20436,new cljs.core.Keyword(null,"exclusions","exclusions",1098729003));
var inst_20438 = cljs.core.second.call(null,inst_20434);
var inst_20439 = (function (){var temp__4655__auto__ = inst_20425;
var coordinates = inst_20425;
var vec__20427 = inst_20432;
var status = inst_20433;
var dep_graph = inst_20434;
var resolved_deps = inst_20435;
var root = inst_20437;
var dg = inst_20438;
return ((function (temp__4655__auto__,coordinates,vec__20427,status,dep_graph,resolved_deps,root,dg,inst_20425,inst_20432,inst_20433,inst_20434,inst_20435,inst_20436,inst_20437,inst_20438,state_val_20450,c__13836__auto__){
return (function (p1__20383_SHARP_){
return eginez.calvin.core.samedep_QMARK_.call(null,root,p1__20383_SHARP_);
});
;})(temp__4655__auto__,coordinates,vec__20427,status,dep_graph,resolved_deps,root,dg,inst_20425,inst_20432,inst_20433,inst_20434,inst_20435,inst_20436,inst_20437,inst_20438,state_val_20450,c__13836__auto__))
})();
var inst_20440 = cljs.core.keys.call(null,inst_20438);
var inst_20441 = cljs.core.filter.call(null,inst_20439,inst_20440);
var inst_20442 = cljs.core.first.call(null,inst_20441);
var inst_20443 = eginez.calvin.core.show_all_deps.call(null,inst_20435,inst_20434);
var state_20449__$1 = (function (){var statearr_20455 = state_20449;
(statearr_20455[(9)] = inst_20442);

return statearr_20455;
})();
var statearr_20456_20467 = state_20449__$1;
(statearr_20456_20467[(2)] = inst_20443);

(statearr_20456_20467[(1)] = (4));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
});})(c__13836__auto__))
;
return ((function (switch__13813__auto__,c__13836__auto__){
return (function() {
var eginez$calvin$core$show_deps_$_state_machine__13814__auto__ = null;
var eginez$calvin$core$show_deps_$_state_machine__13814__auto____0 = (function (){
var statearr_20460 = [null,null,null,null,null,null,null,null,null,null];
(statearr_20460[(0)] = eginez$calvin$core$show_deps_$_state_machine__13814__auto__);

(statearr_20460[(1)] = (1));

return statearr_20460;
});
var eginez$calvin$core$show_deps_$_state_machine__13814__auto____1 = (function (state_20449){
while(true){
var ret_value__13815__auto__ = (function (){try{while(true){
var result__13816__auto__ = switch__13813__auto__.call(null,state_20449);
if(cljs.core.keyword_identical_QMARK_.call(null,result__13816__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__13816__auto__;
}
break;
}
}catch (e20461){if((e20461 instanceof Object)){
var ex__13817__auto__ = e20461;
var statearr_20462_20468 = state_20449;
(statearr_20462_20468[(5)] = ex__13817__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_20449);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e20461;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__13815__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__20469 = state_20449;
state_20449 = G__20469;
continue;
} else {
return ret_value__13815__auto__;
}
break;
}
});
eginez$calvin$core$show_deps_$_state_machine__13814__auto__ = function(state_20449){
switch(arguments.length){
case 0:
return eginez$calvin$core$show_deps_$_state_machine__13814__auto____0.call(this);
case 1:
return eginez$calvin$core$show_deps_$_state_machine__13814__auto____1.call(this,state_20449);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
eginez$calvin$core$show_deps_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$0 = eginez$calvin$core$show_deps_$_state_machine__13814__auto____0;
eginez$calvin$core$show_deps_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$1 = eginez$calvin$core$show_deps_$_state_machine__13814__auto____1;
return eginez$calvin$core$show_deps_$_state_machine__13814__auto__;
})()
;})(switch__13813__auto__,c__13836__auto__))
})();
var state__13838__auto__ = (function (){var statearr_20463 = f__13837__auto__.call(null);
(statearr_20463[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__13836__auto__);

return statearr_20463;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__13838__auto__);
});})(c__13836__auto__))
);

return c__13836__auto__;
});
eginez.calvin.core.run_build = (function eginez$calvin$core$run_build(project,id){
var c__13836__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__13836__auto__){
return (function (){
var f__13837__auto__ = (function (){var switch__13813__auto__ = ((function (c__13836__auto__){
return (function (state_20520){
var state_val_20521 = (state_20520[(1)]);
if((state_val_20521 === (1))){
var inst_20503 = eginez.calvin.core.resolve_classpath.call(null,project);
var state_20520__$1 = state_20520;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_20520__$1,(2),inst_20503);
} else {
if((state_val_20521 === (2))){
var inst_20505 = (state_20520[(2)]);
var inst_20506 = eginez.calvin.core.lumo_build_cmd.call(null,project,id,inst_20505);
var inst_20507 = cljs.core.nth.call(null,inst_20506,(0),null);
var inst_20508 = cljs.core.nth.call(null,inst_20506,(1),null);
var inst_20509 = cljs.core.clj__GT_js.call(null,inst_20508);
var inst_20510 = [new cljs.core.Keyword(null,"stdio","stdio",-1570777132),new cljs.core.Keyword(null,"shell","shell",1402941019)];
var inst_20511 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_20512 = [(0),(1),(2)];
var inst_20513 = (new cljs.core.PersistentVector(null,3,(5),inst_20511,inst_20512,null));
var inst_20514 = [inst_20513,true];
var inst_20515 = cljs.core.PersistentHashMap.fromArrays(inst_20510,inst_20514);
var inst_20516 = cljs.core.clj__GT_js.call(null,inst_20515);
var inst_20517 = eginez.calvin.core.nchild.spawn(inst_20507,inst_20509,inst_20516);
var inst_20518 = cljs.core.apply.call(null,eginez.calvin.core.debug,"Starting build:",inst_20507,inst_20508);
var state_20520__$1 = (function (){var statearr_20522 = state_20520;
(statearr_20522[(7)] = inst_20517);

return statearr_20522;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_20520__$1,inst_20518);
} else {
return null;
}
}
});})(c__13836__auto__))
;
return ((function (switch__13813__auto__,c__13836__auto__){
return (function() {
var eginez$calvin$core$run_build_$_state_machine__13814__auto__ = null;
var eginez$calvin$core$run_build_$_state_machine__13814__auto____0 = (function (){
var statearr_20526 = [null,null,null,null,null,null,null,null];
(statearr_20526[(0)] = eginez$calvin$core$run_build_$_state_machine__13814__auto__);

(statearr_20526[(1)] = (1));

return statearr_20526;
});
var eginez$calvin$core$run_build_$_state_machine__13814__auto____1 = (function (state_20520){
while(true){
var ret_value__13815__auto__ = (function (){try{while(true){
var result__13816__auto__ = switch__13813__auto__.call(null,state_20520);
if(cljs.core.keyword_identical_QMARK_.call(null,result__13816__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__13816__auto__;
}
break;
}
}catch (e20527){if((e20527 instanceof Object)){
var ex__13817__auto__ = e20527;
var statearr_20528_20530 = state_20520;
(statearr_20528_20530[(5)] = ex__13817__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_20520);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e20527;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__13815__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__20531 = state_20520;
state_20520 = G__20531;
continue;
} else {
return ret_value__13815__auto__;
}
break;
}
});
eginez$calvin$core$run_build_$_state_machine__13814__auto__ = function(state_20520){
switch(arguments.length){
case 0:
return eginez$calvin$core$run_build_$_state_machine__13814__auto____0.call(this);
case 1:
return eginez$calvin$core$run_build_$_state_machine__13814__auto____1.call(this,state_20520);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
eginez$calvin$core$run_build_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$0 = eginez$calvin$core$run_build_$_state_machine__13814__auto____0;
eginez$calvin$core$run_build_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$1 = eginez$calvin$core$run_build_$_state_machine__13814__auto____1;
return eginez$calvin$core$run_build_$_state_machine__13814__auto__;
})()
;})(switch__13813__auto__,c__13836__auto__))
})();
var state__13838__auto__ = (function (){var statearr_20529 = f__13837__auto__.call(null);
(statearr_20529[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__13836__auto__);

return statearr_20529;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__13838__auto__);
});})(c__13836__auto__))
);

return c__13836__auto__;
});
eginez.calvin.core.run_repl = (function eginez$calvin$core$run_repl(platform,project,rest_args,build_id){
var c__13836__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__13836__auto__){
return (function (){
var f__13837__auto__ = (function (){var switch__13813__auto__ = ((function (c__13836__auto__){
return (function (state_20602){
var state_val_20603 = (state_20602[(1)]);
if((state_val_20603 === (1))){
var inst_20576 = (state_20602[(7)]);
var inst_20576__$1 = eginez.calvin.core.find_cljsbuild_build.call(null,project,build_id);
var inst_20577 = eginez.calvin.core.find_source_path.call(null,inst_20576__$1);
var inst_20578 = eginez.calvin.core.resolve_classpath.call(null,project);
var state_20602__$1 = (function (){var statearr_20604 = state_20602;
(statearr_20604[(8)] = inst_20577);

(statearr_20604[(7)] = inst_20576__$1);

return statearr_20604;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_20602__$1,(2),inst_20578);
} else {
if((state_val_20603 === (2))){
var inst_20577 = (state_20602[(8)]);
var inst_20576 = (state_20602[(7)]);
var inst_20580 = (state_20602[(2)]);
var inst_20581 = (function (){var build = inst_20576;
var src_path = inst_20577;
var classpath = inst_20580;
return ((function (build,src_path,classpath,inst_20577,inst_20576,inst_20580,state_val_20603,c__13836__auto__){
return (function (p1__20532_SHARP_){
return ((p1__20532_SHARP_ == null)) || (cljs.core.empty_QMARK_.call(null,p1__20532_SHARP_));
});
;})(build,src_path,classpath,inst_20577,inst_20576,inst_20580,state_val_20603,c__13836__auto__))
})();
var inst_20582 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_20583 = [inst_20577,inst_20580];
var inst_20584 = (new cljs.core.PersistentVector(null,2,(5),inst_20582,inst_20583,null));
var inst_20585 = cljs.core.remove.call(null,inst_20581,inst_20584);
var inst_20586 = clojure.string.join.call(null,":",inst_20585);
var inst_20587 = eginez.calvin.core.build_cmd_for_platform.call(null,platform,inst_20586);
var inst_20588 = cljs.core.nth.call(null,inst_20587,(0),null);
var inst_20589 = cljs.core.nth.call(null,inst_20587,(1),null);
var inst_20590 = cljs.core.concat.call(null,inst_20589,rest_args);
var inst_20591 = cljs.core.apply.call(null,eginez.calvin.core.debug,"Starting REPL:",inst_20588,inst_20590);
var inst_20592 = cljs.core.clj__GT_js.call(null,inst_20590);
var inst_20593 = [new cljs.core.Keyword(null,"stdio","stdio",-1570777132)];
var inst_20594 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_20595 = [(0),(1),(2)];
var inst_20596 = (new cljs.core.PersistentVector(null,3,(5),inst_20594,inst_20595,null));
var inst_20597 = [inst_20596];
var inst_20598 = cljs.core.PersistentHashMap.fromArrays(inst_20593,inst_20597);
var inst_20599 = cljs.core.clj__GT_js.call(null,inst_20598);
var inst_20600 = eginez.calvin.core.nchild.spawn(inst_20588,inst_20592,inst_20599);
var state_20602__$1 = (function (){var statearr_20605 = state_20602;
(statearr_20605[(9)] = inst_20591);

return statearr_20605;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_20602__$1,inst_20600);
} else {
return null;
}
}
});})(c__13836__auto__))
;
return ((function (switch__13813__auto__,c__13836__auto__){
return (function() {
var eginez$calvin$core$run_repl_$_state_machine__13814__auto__ = null;
var eginez$calvin$core$run_repl_$_state_machine__13814__auto____0 = (function (){
var statearr_20609 = [null,null,null,null,null,null,null,null,null,null];
(statearr_20609[(0)] = eginez$calvin$core$run_repl_$_state_machine__13814__auto__);

(statearr_20609[(1)] = (1));

return statearr_20609;
});
var eginez$calvin$core$run_repl_$_state_machine__13814__auto____1 = (function (state_20602){
while(true){
var ret_value__13815__auto__ = (function (){try{while(true){
var result__13816__auto__ = switch__13813__auto__.call(null,state_20602);
if(cljs.core.keyword_identical_QMARK_.call(null,result__13816__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__13816__auto__;
}
break;
}
}catch (e20610){if((e20610 instanceof Object)){
var ex__13817__auto__ = e20610;
var statearr_20611_20613 = state_20602;
(statearr_20611_20613[(5)] = ex__13817__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_20602);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e20610;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__13815__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__20614 = state_20602;
state_20602 = G__20614;
continue;
} else {
return ret_value__13815__auto__;
}
break;
}
});
eginez$calvin$core$run_repl_$_state_machine__13814__auto__ = function(state_20602){
switch(arguments.length){
case 0:
return eginez$calvin$core$run_repl_$_state_machine__13814__auto____0.call(this);
case 1:
return eginez$calvin$core$run_repl_$_state_machine__13814__auto____1.call(this,state_20602);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
eginez$calvin$core$run_repl_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$0 = eginez$calvin$core$run_repl_$_state_machine__13814__auto____0;
eginez$calvin$core$run_repl_$_state_machine__13814__auto__.cljs$core$IFn$_invoke$arity$1 = eginez$calvin$core$run_repl_$_state_machine__13814__auto____1;
return eginez$calvin$core$run_repl_$_state_machine__13814__auto__;
})()
;})(switch__13813__auto__,c__13836__auto__))
})();
var state__13838__auto__ = (function (){var statearr_20612 = f__13837__auto__.call(null);
(statearr_20612[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__13836__auto__);

return statearr_20612;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__13838__auto__);
});})(c__13836__auto__))
);

return c__13836__auto__;
});
eginez.calvin.core.cli_options = new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["-h","--help"], null),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["-d","--debug","Show debug information",new cljs.core.Keyword(null,"default","default",-1987822328),false], null),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["-i","--build-id","Set the cljsbuild build id. Defaults to 'dev'",new cljs.core.Keyword(null,"default","default",-1987822328),"dev"], null),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["-p","--platform PLATFORM","Either planck or lumo",new cljs.core.Keyword(null,"default","default",-1987822328),"lumo"], null)], null);
eginez.calvin.core.help = clojure.string.join.call(null,"\n",cljs.core.flatten.call(null,new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Calvin a minimalistic build tool for clojurescript","Usage: calvin [options] args","Options:",cljs.core.map.call(null,(function (p1__20615_SHARP_){
return [cljs.core.str("\t"),cljs.core.str(clojure.string.join.call(null," ",cljs.core.take.call(null,(2),p1__20615_SHARP_)))].join('');
}),eginez.calvin.core.cli_options),"Arguments:","\tdeps Shows dependencies","\tbuild [id] Builds the project using the 'id' configuration","\trepl Starts a repl using either lumo or planck"], null)));
eginez.calvin.core._main = (function eginez$calvin$core$_main(var_args){
var args__7658__auto__ = [];
var len__7651__auto___20620 = arguments.length;
var i__7652__auto___20621 = (0);
while(true){
if((i__7652__auto___20621 < len__7651__auto___20620)){
args__7658__auto__.push((arguments[i__7652__auto___20621]));

var G__20622 = (i__7652__auto___20621 + (1));
i__7652__auto___20621 = G__20622;
continue;
} else {
}
break;
}

var argseq__7659__auto__ = ((((0) < args__7658__auto__.length))?(new cljs.core.IndexedSeq(args__7658__auto__.slice((0)),(0),null)):null);
return eginez.calvin.core._main.cljs$core$IFn$_invoke$arity$variadic(argseq__7659__auto__);
});

eginez.calvin.core._main.cljs$core$IFn$_invoke$arity$variadic = (function (args){
var map__20617 = cljs.tools.cli.parse_opts.call(null,args,eginez.calvin.core.cli_options,new cljs.core.Keyword(null,"in-order","in-order",-1605651796),true);
var map__20617__$1 = ((((!((map__20617 == null)))?((((map__20617.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__20617.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__20617):map__20617);
var options = cljs.core.get.call(null,map__20617__$1,new cljs.core.Keyword(null,"options","options",99638489));
var arguments$ = cljs.core.get.call(null,map__20617__$1,new cljs.core.Keyword(null,"arguments","arguments",-1182834456));
var errors = cljs.core.get.call(null,map__20617__$1,new cljs.core.Keyword(null,"errors","errors",-908790718));
var summ = cljs.core.get.call(null,map__20617__$1,new cljs.core.Keyword(null,"summ","summ",-1220398077));
var platform = new cljs.core.Keyword(null,"platform","platform",-1086422114).cljs$core$IFn$_invoke$arity$1(options);
var cwd = eginez.calvin.core.nproc.cwd();
var project = eginez.calvin.core.find_lein_project_configuration.call(null,eginez.calvin.core.find_file.call(null,eginez.calvin.core.nproc.cwd()));
cljs.core.reset_BANG_.call(null,eginez.calvin.core.debug_QMARK_,new cljs.core.Keyword(null,"debug","debug",-1608172596).cljs$core$IFn$_invoke$arity$1(options));

var G__20619 = cljs.core.first.call(null,arguments$);
if(cljs.core._EQ_.call(null,"deps",G__20619)){
return eginez.calvin.core.show_deps.call(null,project);
} else {
if(cljs.core._EQ_.call(null,"repl",G__20619)){
return eginez.calvin.core.run_repl.call(null,platform,project,cljs.core.next.call(null,arguments$),new cljs.core.Keyword(null,"build-id","build-id",1642831089).cljs$core$IFn$_invoke$arity$1(options));
} else {
if(cljs.core._EQ_.call(null,"build",G__20619)){
return eginez.calvin.core.run_build.call(null,project,(function (){var or__6543__auto__ = cljs.core.second.call(null,arguments$);
if(cljs.core.truth_(or__6543__auto__)){
return or__6543__auto__;
} else {
return new cljs.core.Keyword(null,"build-id","build-id",1642831089).cljs$core$IFn$_invoke$arity$1(options);
}
})());
} else {
if(cljs.core._EQ_.call(null,null,G__20619)){
return eginez.calvin.core.println_err.call(null,eginez.calvin.core.help);
} else {
throw (new Error([cljs.core.str("No matching clause: "),cljs.core.str(cljs.core.first.call(null,arguments$))].join('')));

}
}
}
}
});

eginez.calvin.core._main.cljs$lang$maxFixedArity = (0);

eginez.calvin.core._main.cljs$lang$applyTo = (function (seq20616){
return eginez.calvin.core._main.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq20616));
});

cljs.nodejs.enable_util_print_BANG_.call(null);
cljs.core._STAR_main_cli_fn_STAR_ = eginez.calvin.core._main;
