Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deps edn #53

Merged
merged 9 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
/.cljs_rhino_repl
/out
/target
/node_modules
/package.json
/package-lock.json
/classes
/checkouts
pom.xml
pom.xml.asc
/pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.DS_Store
/resources/public/xapi_schema.js
.specljs-timestamp
/.cpcache
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: clojure
lein: 2.6.1
script:
- lein ci
language: java
before_install:
- curl -O https://download.clojure.org/install/linux-install-1.9.0.391.sh
- chmod +x linux-install-1.9.0.391.sh
- sudo ./linux-install-1.9.0.391.sh
script: make ci
notifications:
webhooks:
urls:
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.phony: clean repl test-clj test-cljs ci
clean:
rm -rf target pom.xml.asc logs out
repl:
clj -A:dev -r
test-clj:
clojure -A:dev -m xapi-schema.runner
test-cljs:
clojure -A:dev -m cljs.main -co build.test.edn -c
node out/main.js
ci: test-clj test-cljs
8 changes: 4 additions & 4 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can use xapi-schema to validate (and generate) statements in real-time [[htt
** Getting Started
1. Add to your project dependencies:
#+BEGIN_SRC clojure
[[com.yetanalytics/xapi-schema "1.0.0-alpha2"]]
[[com.yetanalytics/xapi-schema "1.0.0-alpha18"]]
#+END_SRC
2. Require in your project:
#+BEGIN_SRC clojure
Expand Down Expand Up @@ -138,15 +138,15 @@ xapi_schema.core.validate_statement_data_js(statement_json); // => statement JSO

*** Clojure

=$ lein test=
=$ make test-clj=

*** ClojureScript

=$ lein doo phantom test once=
=$ make test-cljs=

*** Both

=$ lein ci=
=$ make ci=

** License

Expand Down
4 changes: 4 additions & 0 deletions build.test.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{:main xapi-schema.runner
:target :nodejs
;; :verbose true
}
16 changes: 16 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{:paths ["src" "resources"]
:deps
{org.clojure/clojure {:mvn/version "1.9.0"}
org.clojure/clojurescript {:mvn/version "1.10.339" #_"1.9.946"}
org.clojure/data.json {:mvn/version "0.2.6"}}
:aliases
{:dev
{:extra-paths ["test" "dev" "dev-resources"]
:extra-deps
{org.clojure/tools.nrepl {:mvn/version "0.2.10"}
com.cemerick/piggieback {:mvn/version "0.2.2"}
org.clojure/test.check {:mvn/version "0.10.0-alpha2"}
com.walmartlabs/lacinia
{:mvn/version "0.25.0"
:exclusions [org.clojure/clojure
clojure-future-spec]}}}}}
54 changes: 54 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.yetanalytics</groupId>
<artifactId>xapi-schema</artifactId>
<packaging>jar</packaging>
<version>1.0.0-alpha18-SNAPSHOT</version>
<name>xapi-schema</name>
<description>Clojure(script) Schema for the Experience API v1.0.3</description>
<url>https://github.com/yetanalytics/xapi-schema</url>
<licenses>
<license>
<name>Eclipse Public License</name>
<url>http://www.eclipse.org/legal/epl-v10.html</url>
</license>
</licenses>
<scm>
<url>https://github.com/yetanalytics/xapi-schema</url>
<connection>scm:git:git://github.com/yetanalytics/xapi-schema.git</connection>
<developerConnection>scm:git:ssh://git@github.com/yetanalytics/xapi-schema.git</developerConnection>
<tag>e9d4af0a06fc327cbd966bd5640d150036067a4d</tag>
</scm>
<dependencies>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojurescript</artifactId>
<version>1.10.339</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>data.json</artifactId>
<version>0.2.6</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>clojars</id>
<url>https://repo.clojars.org/</url>
</repository>
</repositories>
</project>
47 changes: 0 additions & 47 deletions project.clj

This file was deleted.

41 changes: 31 additions & 10 deletions test/xapi_schema/runner.cljc
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
(ns xapi-schema.runner
#?(:cljs (:require [doo.runner :refer-macros [doo-tests]]
[xapi-schema.core-test]
[xapi-schema.spec-test]
[xapi-schema.spec.regex-test]
[xapi-schema.spec.resources-test])))
(:require [#?(:clj clojure.test
:cljs cljs.test) :refer [run-tests]]
xapi-schema.core-test
xapi-schema.spec-test
xapi-schema.spec.regex-test
xapi-schema.spec.resources-test
#?@(:clj [xapi-schema.graphql-test]
:cljs [[cljs.nodejs :refer [process]]])))
;; Exit properly for cljs tests
#?(:cljs (defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m]
(.exit process
(if (cljs.test/successful? m)
0
1))))

#?(:cljs (doo-tests 'xapi-schema.core-test
'xapi-schema.spec-test
'xapi-schema.spec.regex-test
'xapi-schema.spec.resources-test
))
#?(:clj (defn -main []
(let [{:keys [test pass fail error] :as result}
(run-tests 'xapi-schema.core-test
'xapi-schema.graphql-test
'xapi-schema.spec-test
'xapi-schema.spec.regex-test
'xapi-schema.spec.resources-test)]
(System/exit (if (= 0 fail error)
0
1))))
:cljs (set! *main-cli-fn*
(fn []
(run-tests 'xapi-schema.core-test
'xapi-schema.spec-test
'xapi-schema.spec.regex-test
'xapi-schema.spec.resources-test
))))
14 changes: 7 additions & 7 deletions test/xapi_schema/support/data.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -173,28 +173,28 @@
"version" version})

(def simple-statement
(load-json "resources/data/statements/simple.json"))
(load-json "dev-resources/data/statements/simple.json"))

(def long-statement
(load-json "resources/data/statements/long.json"))
(load-json "dev-resources/data/statements/long.json"))

(def completion-statement
(load-json "resources/data/statements/completion.json"))
(load-json "dev-resources/data/statements/completion.json"))

(def void-statement
(load-json "resources/data/statements/void.json"))
(load-json "dev-resources/data/statements/void.json"))

(def interaction-activity-defs
(load-json-map
"resources/data/objects/activity/definition/interaction/"
"dev-resources/data/objects/activity/definition/interaction/"
["choice" "fill-in" "likert" "long-fill-in"
"matching" "numeric" "other" "performance"
"sequencing" "true-false"]))

(def adl-sub-statement
(load-json
"resources/data/objects/sub-statement.json"))
"dev-resources/data/objects/sub-statement.json"))

(def authority-group
(load-json
"resources/data/objects/authority.json"))
"dev-resources/data/objects/authority.json"))