Skip to content

Commit ba768a9

Browse files
committed
Reworked Scala adaptor to use implicits in RxImplicits, rather than code generation
1 parent 6e1a1f7 commit ba768a9

File tree

6 files changed

+653
-258
lines changed

6 files changed

+653
-258
lines changed

build.gradle

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
apply from: file('gradle/convention.gradle')
2+
apply from: file('gradle/maven.gradle')
3+
//apply from: file('gradle/check.gradle')
4+
apply from: file('gradle/license.gradle')
5+
apply from: file('gradle/release.gradle')
6+
17
ext.githubProjectName = rootProject.name
28

39
buildscript {
@@ -9,20 +15,51 @@ allprojects {
915
repositories { mavenCentral() }
1016
}
1117

12-
apply from: file('gradle/convention.gradle')
13-
apply from: file('gradle/maven.gradle')
14-
//apply from: file('gradle/check.gradle')
15-
apply from: file('gradle/license.gradle')
16-
apply from: file('gradle/release.gradle')
1718

1819
subprojects {
20+
apply plugin: 'java'
21+
apply plugin: 'eclipse'
22+
apply plugin: 'idea'
1923

2024
group = "com.netflix.${githubProjectName}"
2125

26+
// make 'examples' use the same classpath
27+
configurations {
28+
examplesCompile.extendsFrom compile
29+
examplesRuntime.extendsFrom runtime
30+
}
31+
2232
sourceSets.test.java.srcDir 'src/main/java'
2333

2434
tasks.withType(Javadoc).each {
2535
it.classpath = sourceSets.main.compileClasspath
2636
}
37+
38+
//include /src/examples folder
39+
sourceSets {
40+
examples
41+
}
42+
43+
//include 'examples' in build task
44+
tasks.build {
45+
dependsOn(examplesClasses)
46+
}
47+
48+
eclipse {
49+
classpath {
50+
// include 'provided' dependencies on the classpath
51+
plusConfigurations += configurations.provided
52+
53+
downloadSources = true
54+
downloadJavadoc = true
55+
}
56+
}
57+
58+
idea {
59+
module {
60+
// include 'provided' dependencies on the classpath
61+
scopes.PROVIDED.plus += configurations.provided
62+
}
63+
}
2764
}
2865

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=http\://services.gradle.org/distributions/gradle-1.3-bin.zip
6+
distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip

language-adaptors/rxjava-scala/build.gradle

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,49 @@
11
apply plugin: 'scala'
2-
apply plugin: 'eclipse'
3-
apply plugin: 'idea'
42
apply plugin: 'osgi'
53

64
tasks.withType(ScalaCompile) {
75
scalaCompileOptions.fork = true
86
scalaCompileOptions.unchecked = true
7+
scalaCompileOptions.setAdditionalParameters(['-feature'])
98

109
configure(scalaCompileOptions.forkOptions) {
1110
memoryMaximumSize = '1g'
1211
jvmArgs = ['-XX:MaxPermSize=512m']
1312
}
1413
}
1514

15+
sourceSets {
16+
test {
17+
scala {
18+
srcDir 'src/main/scala'
19+
}
20+
}
21+
}
22+
1623
dependencies {
17-
// Scala compiler and related tools
18-
scalaTools 'org.scala-lang:scala-compiler:2.10+'
19-
scalaTools 'org.scala-lang:scala-library:2.10+'
20-
provided 'org.scalatest:scalatest_2.10:1.9.1'
24+
compile 'org.scala-lang:scala-library:2.10+'
2125

2226
compile project(':rxjava-core')
27+
2328
provided 'junit:junit-dep:4.10'
2429
provided 'org.mockito:mockito-core:1.8.5'
30+
provided 'org.scalatest:scalatest_2.10:1.9.1'
31+
}
2532

26-
testCompile 'org.scalatest:scalatest_2.10:1.9.1'
33+
tasks.compileScala {
34+
classpath = classpath + (configurations.compile + configurations.provided)
2735
}
2836

2937
task test(overwrite: true, dependsOn: testClasses) << {
3038
ant.taskdef(name: 'scalatest',
3139
classname: 'org.scalatest.tools.ScalaTestAntTask',
32-
classpath: sourceSets.test.runtimeClasspath.asPath
40+
classpath: configurations.provided.asPath + ':' + configurations.testRuntime.asPath + ":" + compileScala.destinationDir
3341
)
34-
ant.scalatest(runpath: sourceSets.test.classesDir,
42+
ant.scalatest(runpath: sourceSets.test.output.classesDir,
3543
haltonfailure: 'true',
3644
fork: 'false') {reporter(type: 'stdout')}
3745
}
3846

39-
eclipse {
40-
classpath {
41-
// include 'provided' dependencies on the classpath
42-
plusConfigurations += configurations.provided
43-
44-
downloadSources = true
45-
downloadJavadoc = true
46-
}
47-
}
48-
49-
idea {
50-
module {
51-
// include 'provided' dependencies on the classpath
52-
scopes.PROVIDED.plus += configurations.provided
53-
}
54-
}
55-
5647
jar {
5748
manifest {
5849
name = 'rxjava-scala'

0 commit comments

Comments
 (0)