Permalink
Browse files

Merge pull request #3 from ReactiveX/slim-down-build

Slim down build
  • Loading branch information...
2 parents 50d7e94 + 451cf1b commit b84d57e311e886e6cd2e15725e87e9b9cd4c4ebd @benjchristensen benjchristensen committed Sep 5, 2014
View
@@ -1,39 +1,26 @@
buildscript {
repositories { jcenter() }
+ repositories { maven { url 'http://clojars.org/repo' } }
dependencies { classpath 'com.netflix.nebula:gradle-rxjava-project-plugin:1.12.+' }
+ repositories { maven { url 'http://dl.bintray.com/nebula/gradle-plugins' } } // Unlink nebula-clojure is linked to jcenter
+ dependencies { classpath 'com.netflix.nebula:nebula-clojure-plugin:1.12.+' }
}
-buildscript {
- repositories { maven { url "http://clojars.org/repo" } }
- dependencies { classpath "clojuresque:clojuresque:1.5.8" }
-}
+apply plugin: 'rxjava-project'
+apply plugin: 'nebula-clojure'
-repositories {
- clojarsRepo()
+clojure {
+ warnOnReflection = true
+ aotCompile = false
}
-
-
-
-apply plugin: 'rxjava-project'
-apply plugin: 'clojure'
-
dependencies {
compile 'io.reactivex:rxjava:1.0.+'
- compile 'org.clojure:clojure:1.4.+'
+ compile 'org.clojure:clojure:1.5.+'
- // this should be 'compile' for the 'examples' module
- testCompile 'clj-http:clj-http:0.6.4' // https://clojars.org/clj-http
+ examplesCompile 'clj-http:clj-http:0.6.4' // https://clojars.org/clj-http
}
-tasks.compileExamplesClojure.classpath = files(tasks.compileClojure.destinationDir) + tasks.compileClojure.classpath + configurations.testCompile
-
-/*
- * Clojure
- */
-aotCompile = true
-warnOnReflection = false
-
/*
* Add Counterclockwise and include 'testCompile' dependencies
*/
@@ -43,30 +30,9 @@ eclipse {
}
}
+/*
tasks.clojureTest {
classpath = classpath + configurations.testCompile
}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Define a task that runs an nrepl server. The port is given with the nreplPort
-// property:
-// gradlew nrepl -PnreplPort=9999
-// or put the property in ~/.gradle/gradle.properties
-
-def nreplPortValue = (project.hasProperty('nreplPort') && !project.nreplPort.isEmpty()) ? project.nreplPort : '9999'
-configurations { nrepl }
-dependencies { nrepl 'org.clojure:tools.nrepl:0.2.2' }
-task nrepl(type: JavaExec) {
- classpath configurations.nrepl,
- project.sourceSets.main.clojure.srcDirs,
- project.sourceSets.test.clojure.srcDirs,
- sourceSets.main.runtimeClasspath,
- sourceSets.test.runtimeClasspath
-
- main = "clojure.main"
- args '--eval', "(ns gradle-nrepl (:require [clojure.tools.nrepl.server :refer (start-server stop-server)]))",
- '--eval', "(println \"Starting nrepl server on port $nreplPortValue\")",
- '--eval', "(def server (start-server :port $nreplPortValue))"
-}
+*/
@@ -1,6 +1,6 @@
-#Wed Feb 05 12:05:54 CET 2014
+#Tue Sep 02 17:31:29 PDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
View
@@ -1,90 +1,90 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
@@ -33,7 +33,7 @@
[o]
(if (instance? BlockingObservable o)
o
- (.toBlockingObservable ^Observable o)))
+ (BlockingObservable/from ^Observable o)))
(defn o->seq
"Returns a lazy sequence of the items emitted by o
@@ -17,17 +17,8 @@
(let [f-name (gensym "rc")]
`(let [~f-name ~f]
(reify
- ; If they want Func1, give them onSubscribe as well so Observable/create can be
- ; used seemlessly with rx/fn.
- ; TODO remove this when OnSubscriberFunc is removed
- ~@(if (and (= prefix "rx.functions.Func")
- (some #{1} arities))
- `(rx.Observable$OnSubscribeFunc
- (~'onSubscribe [~'this observer#]
- (~f-name observer#))))
-
; OnSubscribe is just an Action1, so add it to the list of implemented interfaces
- ; so an action cab be used with Observable/create
+ ; so an action can be used with Observable/create
~@(if (and (= prefix "rx.functions.Action")
(some #{1} arities))
`(rx.Observable$OnSubscribe))
@@ -8,7 +8,6 @@
(deftest test-fn*
(testing "implements Func0-9"
(let [f (rx/fn* vector)]
- (is (instance? rx.Observable$OnSubscribeFunc f))
(is (instance? rx.functions.Func0 f))
(is (instance? rx.functions.Func1 f))
(is (instance? rx.functions.Func2 f))
@@ -115,29 +114,20 @@
(deftest test-basic-usage
- (testing "can create an observable with old style fn"
- (is (= 99
- (-> (Observable/create (rx/fn [^rx.Observer o]
- (.onNext o 99)
- (.onCompleted o)
- (rx.subscriptions.Subscriptions/empty)))
- .toBlockingObservable
- .single))))
-
(testing "can create an observable with new-style action"
(is (= 99
(-> (Observable/create (rx/action [^rx.Subscriber s]
(when-not (.isUnsubscribed s)
(.onNext s 99))
(.onCompleted s)))
- .toBlockingObservable
+ BlockingObservable/from
.single))))
(testing "can pass rx/fn to map and friends"
(is (= (+ 1 4 9)
(-> (Observable/from [1 2 3])
(.map (rx/fn [v] (* v v)))
(.reduce (rx/fn* +))
- .toBlockingObservable
+ BlockingObservable/from
.single))))
(testing "can pass rx/action to subscribe and friends"

0 comments on commit b84d57e

Please sign in to comment.