Skip to content

Commit 6e58701

Browse files
Merge pull request ReactiveX#132 from benjchristensen/language-tests-and-examples
Refactoring language tests and examples layout
2 parents 1f48ae1 + e52bcda commit 6e58701

File tree

12 files changed

+358
-341
lines changed

12 files changed

+358
-341
lines changed

language-adaptors/rxjava-clojure/build.gradle

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java'
2+
apply plugin: 'clojure'
23
apply plugin: 'eclipse'
34
apply plugin: 'idea'
45

@@ -7,8 +8,43 @@ dependencies {
78
provided 'org.clojure:clojure:1.4.+'
89
provided 'junit:junit:4.10'
910
provided 'org.mockito:mockito-core:1.8.5'
11+
12+
// clojure
13+
testCompile 'clj-http:clj-http:0.6.4' // https://clojars.org/clj-http
1014
}
1115

16+
/*
17+
* Clojure
18+
*/
19+
aotCompile = true
20+
warnOnReflection = true
21+
22+
buildscript {
23+
repositories { maven { url "http://clojars.org/repo" } }
24+
dependencies { classpath "clojuresque:clojuresque:1.5.4" }
25+
}
26+
27+
repositories {
28+
mavenCentral()
29+
clojarsRepo()
30+
}
31+
32+
/*
33+
* Add Counterclockwise and include 'provided' dependencies
34+
*/
35+
eclipse {
36+
project {
37+
natures "ccw.nature"
38+
}
39+
classpath {
40+
plusConfigurations += configurations.provided
41+
downloadSources = true
42+
downloadJavadoc = true
43+
}
44+
}
45+
46+
47+
// setup Eclipse
1248
eclipse {
1349
classpath {
1450
//you can tweak the classpath of the Eclipse project by adding extra configurations:
@@ -18,3 +54,19 @@ eclipse {
1854
downloadJavadoc = true
1955
}
2056
}
57+
58+
// include /src/examples folder
59+
sourceSets {
60+
examples
61+
}
62+
63+
// make 'examples' use the same classpath
64+
configurations {
65+
examplesCompile.extendsFrom compile
66+
examplesRuntime.extendsFrom runtime
67+
}
68+
69+
// include 'examples' in build task
70+
build.dependsOn examplesClasses
71+
72+

rxjava-examples/src/main/clojure/rx/examples/clojure/rx_examples.clj renamed to language-adaptors/rxjava-clojure/src/examples/clojure/rx/lang/clojure/examples/rx_examples.clj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
(ns rx.examples.clojure.rx-examples
1+
(ns rx.lang.clojure.examples.rx-examples
22
(import rx.Observable)
33
(:require [clj-http.client :as http]))
44

55
; NOTE on naming conventions. I'm using camelCase names (against clojure convention)
66
; in this file as I'm purposefully keeping functions and methods across
77
; different language implementations in-sync for easy comparison.
8-
;
9-
; See rx.examples.groovy.RxExamples, rx.examples.java.RxExamples, etc.
108

119
; --------------------------------------------------
1210
; Hello World!
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(ns rx.lang.clojure.observable-tests
2+
(import rx.Observable))
3+
4+
;; still need to get this wired up in build.gradle to run as tests
5+
; (-> (rx.Observable/toObservable [\"one\" \"two\" \"three\"]) (.take 2) (.subscribe (fn [arg] (println arg))))
Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
apply plugin: 'java'
2+
apply plugin: 'groovy'
23
apply plugin: 'eclipse'
34
apply plugin: 'idea'
45

56
dependencies {
67
compile project(':rxjava-core')
7-
provided 'org.codehaus.groovy:groovy-all:2.+'
8+
groovy 'org.codehaus.groovy:groovy-all:2.+'
89
provided 'junit:junit:4.10'
910
provided 'org.mockito:mockito-core:1.8.5'
1011
}
1112

12-
eclipse {
13-
classpath {
14-
//you can tweak the classpath of the Eclipse project by adding extra configurations:
15-
plusConfigurations += configurations.provided
13+
// include /src/examples folder
14+
sourceSets {
15+
examples
16+
}
17+
18+
// make 'examples' use the same classpath
19+
configurations {
20+
examplesCompile.extendsFrom compile
21+
examplesRuntime.extendsFrom runtime
22+
}
23+
24+
// include 'examples' in build task
25+
build.dependsOn examplesClasses
1626

17-
downloadSources = true
18-
downloadJavadoc = true
19-
}
27+
// setup Eclipse
28+
eclipse {
29+
classpath {
30+
//you can tweak the classpath of the Eclipse project by adding extra configurations:
31+
plusConfigurations += configurations.provided
32+
33+
downloadSources = true
34+
downloadJavadoc = true
35+
}
2036
}

rxjava-examples/src/main/groovy/rx/examples/groovy/RxExamples.groovy renamed to language-adaptors/rxjava-groovy/src/examples/groovy/rx/lang/groovy/examples/RxExamples.groovy

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
package rx.examples.groovy;
1+
/**
2+
* Copyright 2013 Netflix, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package rx.lang.groovy.examples;
217

318
import rx.Observable;
419
import rx.Observer;

rxjava-examples/src/main/groovy/rx/examples/groovy/VideoExample.groovy renamed to language-adaptors/rxjava-groovy/src/examples/groovy/rx/lang/groovy/examples/VideoExample.groovy

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
package rx.examples.groovy;
1+
/**
2+
* Copyright 2013 Netflix, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package rx.lang.groovy.examples;
217

318
import rx.Observable;
419
import rx.Observer;

0 commit comments

Comments
 (0)