-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/target | ||
/classes | ||
/checkouts | ||
pom.xml | ||
pom.xml.asc | ||
*.jar | ||
*.class | ||
/.lein-* | ||
/.nrepl-port | ||
/.prepl-port | ||
.hgignore | ||
.hg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(defproject com.github.clojure-finance/lein-template.datajure "1.1.0" | ||
:description "Leiningen template for a Datajure application." | ||
:url "https://github.com/clojure-finance/datajure/tree/main/lein-template" | ||
:license {:name "The MIT License" | ||
:url "http://opensource.org/licenses/MIT"} | ||
:eval-in-leiningen true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# {{name}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns {{namespace}}.core | ||
(:require | ||
[datajure.dsl :as dtj])) | ||
|
||
(defn -main | ||
[] | ||
(dtj/set-backend "tech.ml.dataset") | ||
(def data {:age [31 25 18 18 25] | ||
:name ["a" "b" "c" "c" "d"] | ||
:salary [200 500 200 370 3500]}) | ||
(-> data | ||
(dtj/dataset) | ||
(dtj/query [[:salary #(< 300 %)] [:age #(> 20 %)]] []) | ||
(dtj/print))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pom.xml | ||
pom.xml.asc | ||
*.jar | ||
*.class | ||
/lib/ | ||
/classes/ | ||
/target/ | ||
/checkouts/ | ||
.lein-deps-sum | ||
.lein-repl-history | ||
.lein-plugins/ | ||
.lein-failures | ||
.nrepl-port | ||
.cpcache/ |
19 changes: 19 additions & 0 deletions
19
lein-template/resources/leiningen/new/datajure/project.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(defproject {{raw-name}} "0.1.0-SNAPSHOT" | ||
:description "FIXME: write description" | ||
:url "http://example.com/FIXME" | ||
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" | ||
:url "https://www.eclipse.org/legal/epl-2.0/"} | ||
:jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED" | ||
"--add-opens=java.base/java.net=ALL-UNNAMED" | ||
"--add-opens=java.base/java.lang=ALL-UNNAMED" | ||
"--add-opens=java.base/java.util=ALL-UNNAMED" | ||
"--add-opens=java.base/java.util.concurrent=ALL-UNNAMED" | ||
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"] | ||
:dependencies [[com.github.clojure-finance/datajure "1.1.0"] | ||
[org.apache.logging.log4j/log4j-core "2.21.0"] | ||
[org.clojure/clojure "1.11.1"]] | ||
:jar-name "{{raw-name}}.jar" | ||
:uberjar-name "{{raw-name}}-standalone.jar" | ||
:profiles {:uberjar {:aot :all}} | ||
:main ^:skip-aot {{namespace}}.core | ||
:target-path "target/%s") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(ns leiningen.new.datajure | ||
(:require [leiningen.new.templates :as tmpl] | ||
[leiningen.core.main :as main])) | ||
|
||
(def render (tmpl/renderer "datajure")) | ||
|
||
(defn datajure | ||
"A Datajure project template." | ||
[name] | ||
(let [main-ns (tmpl/sanitize-ns name) | ||
data {:raw-name name | ||
:name (tmpl/project-name name) | ||
:namespace main-ns | ||
:nested-dirs (tmpl/name-to-path main-ns)}] | ||
(main/info "Generating fresh 'lein new' com.github.clojure-finance/datajure project.") | ||
(tmpl/->files data | ||
[".gitignore" (render "gitignore" data)] | ||
["README.md" (render "README.md" data)] | ||
["project.clj" (render "project.clj" data)] | ||
["src/{{nested-dirs}}/core.clj" (render "core.clj" data)]))) |