forked from pfn/kotlin-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get Kotlin 1.2.x and 1.3.x to compile (pfn#26)
- Loading branch information
1 parent
91f234b
commit f72112b
Showing
18 changed files
with
96 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
src/sbt-test/kotlin/extensions-android/project/build.properties
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kotlinLib("stdlib") | ||
|
||
kotlinVersion := "1.1.4-3" | ||
|
||
val listClasses = taskKey[Unit]("listClasses") | ||
|
||
listClasses := { | ||
val classes = (classDirectory in Compile).value.listFiles() | ||
streams.value.log.info("classes: " + classes) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.hanhuy.sbt" % "kotlin-plugin" % sys.props("plugin.version")) |
10 changes: 10 additions & 0 deletions
10
src/sbt-test/kotlin/kotlin-1.1-compat/src/main/kotlin/simple.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package demo | ||
fun main(args: Array<String>) { | ||
val map = mapOf("key" to 42) | ||
val emptyMap = map - "key" | ||
|
||
val list1 = listOf("a", "b") | ||
val list2 = listOf("x", "y", "z") | ||
val minSize = minOf(list1.size, list2.size) | ||
val longestList = maxOf(list1, list2, compareBy { it.size }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> compile | ||
> listClasses | ||
$ exists target/scala-2.10/classes/demo/SimpleKt.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kotlinLib("stdlib") | ||
|
||
kotlinVersion := "1.2.71" | ||
|
||
val listClasses = taskKey[Unit]("listClasses") | ||
|
||
listClasses := { | ||
val classes = (classDirectory in Compile).value.listFiles() | ||
streams.value.log.info("classes: " + classes) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.hanhuy.sbt" % "kotlin-plugin" % sys.props("plugin.version")) |
13 changes: 13 additions & 0 deletions
13
src/sbt-test/kotlin/kotlin-1.2-compat/src/main/kotlin/simple.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package demo | ||
fun main(args: Array<String>) { | ||
// Test some Kotlin 1.2 features | ||
val items = (1..9).map { it * it } | ||
|
||
val chunkedIntoLists = items.chunked(4) | ||
val points3d = items.chunked(3) { (x, y, z) -> Triple(x, y, z) } | ||
val windowed = items.windowed(4) | ||
val slidingAverage = items.windowed(4) { it.average() } | ||
val pairwiseDifferences = items.zipWithNext { a, b -> b - a } | ||
|
||
println("Hello, world!") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> compile | ||
> listClasses | ||
$ exists target/scala-2.10/classes/demo/SimpleKt.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kotlinLib("stdlib") | ||
|
||
kotlinVersion := "1.3.41" | ||
|
||
val listClasses = taskKey[Unit]("listClasses") | ||
|
||
listClasses := { | ||
val classes = (classDirectory in Compile).value.listFiles() | ||
streams.value.log.info("classes: " + classes) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.hanhuy.sbt" % "kotlin-plugin" % sys.props("plugin.version")) |
7 changes: 7 additions & 0 deletions
7
src/sbt-test/kotlin/kotlin-1.3-compat/src/main/kotlin/simple.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package demo | ||
fun main(args: Array<String>) { | ||
// Test some Kotlin 1.3 features | ||
val keys = 'a'..'f' | ||
val map = keys.associateWith { it.toString().repeat(5).capitalize() } | ||
map.forEach { println(it) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> compile | ||
> listClasses | ||
$ exists target/scala-2.10/classes/demo/SimpleKt.class |