Skip to content

Commit bd0bad3

Browse files
committed
mixed-java-kotlin-hello-world: don't depend on SNAPSHOT, don't use Guava
1 parent 0f486d9 commit bd0bad3

File tree

6 files changed

+10
-25
lines changed

6 files changed

+10
-25
lines changed
Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
buildscript {
2+
ext.kotlin_version = '1.0.0-rc-1036'
23
repositories {
34
mavenCentral()
4-
maven {
5-
url 'http://oss.sonatype.org/content/repositories/snapshots'
6-
}
75
}
86
dependencies {
9-
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.1-SNAPSHOT'
7+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
108
}
119
}
1210

@@ -21,21 +19,16 @@ sourceSets {
2119

2220
repositories {
2321
mavenCentral()
24-
maven {
25-
url 'http://oss.sonatype.org/content/repositories/snapshots'
26-
}
2722
}
2823

2924
dependencies {
30-
compile 'com.google.guava:guava:12.0'
31-
compile 'org.jetbrains.kotlin:kotlin-stdlib:0.1-SNAPSHOT'
32-
deployCompile 'com.google.guava:guava:12.0'
25+
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
3326
testCompile 'org.testng:testng:6.8'
34-
testCompile 'org.jetbrains.kotlin:kotlin-test-junit:0.1-SNAPSHOT'
27+
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
3528
}
3629

3730
test.testClassesDir = project.tasks.compileTestKotlin.destinationDir
3831

3932
task wrapper(type: Wrapper) {
40-
gradleVersion="1.6"
33+
gradleVersion="2.7"
4134
}
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed May 28 14:39:29 MSK 2014
1+
#Thu Feb 04 17:38:08 CET 2016
22
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.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip

gradle/mixed-java-kotlin-hello-world/gradlew

100644100755
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ case "`uname`" in
4242
;;
4343
esac
4444

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
5045
# Attempt to set APP_HOME
5146
# Resolve links: $0 may be a link
5247
PRG="$0"
@@ -114,6 +109,7 @@ fi
114109
if $cygwin ; then
115110
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116111
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112+
JAVACMD=`cygpath --unix "$JAVACMD"`
117113

118114
# We build the pattern for arguments to be converted via cygpath
119115
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package demo
22

3-
import com.google.common.base.Joiner
4-
import java.util.ArrayList
3+
import java.util.*
54

65
class KotlinGreetingJoiner(val greeter: Greeter) {
76

@@ -12,7 +11,6 @@ class KotlinGreetingJoiner(val greeter: Greeter) {
1211
}
1312

1413
fun getJoinedGreeting(): String {
15-
val joiner = Joiner.on(" and ").skipNulls()
16-
return "${greeter.getGreeting()} ${joiner.join(names)}"
14+
return "${greeter.getGreeting()} ${names.filterNotNull().joinToString(separator = " and ")}"
1715
}
1816
}

gradle/mixed-java-kotlin-hello-world/src/test/kotlin/tests.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package demo
22

3-
import com.google.common.primitives.Ints
4-
import com.google.common.base.Joiner
53
import kotlin.test.assertEquals
64
import org.junit.Test as test
75

0 commit comments

Comments
 (0)