Skip to content

Commit

Permalink
Merge pull request #49 from kittinunf/support-1.0.0-rc-1036
Browse files Browse the repository at this point in the history
Support latest Kotlin version 1.0.0-rc-1036
  • Loading branch information
Kittinun Vantasin committed Feb 5, 2016
2 parents 7a35b6b + 3103ec2 commit 4e46928
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 41 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fuel

[ ![Kotlin](https://img.shields.io/badge/Kotlin-1.0.0--beta--4589-blue.svg)](http://kotlinlang.org) [ ![jcenter](https://api.bintray.com/packages/kittinunf/maven/Fuel-Android/images/download.svg) ](https://bintray.com/kittinunf/maven/Fuel-Android/_latestVersion) [![Build Status](https://travis-ci.org/kittinunf/Fuel.svg?branch=master)](https://travis-ci.org/kittinunf/Fuel)
[ ![Kotlin](https://img.shields.io/badge/Kotlin-1.0.0--rc--1036-blue.svg)](http://kotlinlang.org) [ ![jcenter](https://api.bintray.com/packages/kittinunf/maven/Fuel-Android/images/download.svg) ](https://bintray.com/kittinunf/maven/Fuel-Android/_latestVersion) [![Build Status](https://travis-ci.org/kittinunf/Fuel.svg?branch=master)](https://travis-ci.org/kittinunf/Fuel)

The easiest HTTP networking library for Kotlin/Android.

Expand All @@ -27,8 +27,8 @@ repositories {
}
dependencies {
compile 'com.github.kittinunf.fuel:fuel:0.71' //for JVM
compile 'com.github.kittinunf.fuel:fuel-android:0.71' //for Android
compile 'com.github.kittinunf.fuel:fuel:1.0.0-rc-1036' //for JVM
compile 'com.github.kittinunf.fuel:fuel-android:1.0.0-rc-1036' //for Android
}
```

Expand Down
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ buildscript {

allprojects {
ext {
publishVersion = '0.71'
publish_version = '1.0.0-rc-1036'

//dependencies version
kotlin_version = '1.0.0-rc-1036'
result_version = '1.0.0-rc-1036'

//test dependencies version
junit_version = '4.12'
robolectric_version = '3.0'
}

repositories {
Expand Down
21 changes: 6 additions & 15 deletions fuel-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName parent.ext.publishVersion
versionName parent.ext.publish_version
}

sourceSets {
Expand Down Expand Up @@ -46,30 +46,21 @@ android {
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$parent.ext.kotlin_version"

compile project(':fuel')

testCompile "junit:junit:$junit_version"
testCompile "org.robolectric:robolectric:$robolectric_version"
testCompile "junit:junit:$parent.ext.junit_version"
testCompile "org.robolectric:robolectric:$parent.ext.robolectric_version"
}

buildscript {
ext {
//dependencies version
kotlin_version = '1.0.0-beta-4589'

//test dependencies version
junit_version = '4.12'
robolectric_version = '3.0'
}

repositories {
mavenCentral()
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$parent.ext.kotlin_version"
}
}

Expand All @@ -79,7 +70,7 @@ publish {
desc = 'The easiest HTTP networking library in Kotlin/Android'
groupId = 'com.github.kittinunf.fuel'
licences = ['MIT']
publishVersion = parent.ext.publishVersion
publishVersion = parent.ext.publish_version
uploadName = 'Fuel-Android'
website = 'https://github.com/kittinunf/Fuel'
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class RequestAndroidHandlerTest : BaseTestCase() {
override fun deserialize(content: String): HttpBinHeadersModel {
val json = JSONObject(content)
val headers = json.getJSONObject("headers")
val results = headers.keys().asSequence().toMapBy({ it }, { headers.getString(it) })
val results = headers.keys().asSequence().associate { Pair(it, headers.getString(it)) }
val model = HttpBinHeadersModel()
model.headers = results
return model
Expand Down
19 changes: 5 additions & 14 deletions fuel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,19 @@ repositories {
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "com.github.kittinunf.result:result:$result_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$parent.ext.kotlin_version"
compile "com.github.kittinunf.result:result:$parent.ext.result_version"

testCompile "junit:junit:$junit_version"
testCompile "junit:junit:$parent.ext.junit_version"
}

buildscript {
ext {
//dependencies version
kotlin_version = '1.0.0-beta-4589'
result_version = '0.31'

//test dependencies version
junit_version = '4.12'
}

repositories {
mavenCentral()
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$parent.ext.kotlin_version"
}
}

Expand All @@ -43,7 +34,7 @@ publish {
desc = 'The easiest HTTP networking library in Kotlin/Android'
groupId = 'com.github.kittinunf.fuel'
licences = ['MIT']
publishVersion = parent.ext.publishVersion
publishVersion = parent.ext.publish_version
uploadName = 'Fuel-Android'
website = 'https://github.com/kittinunf/Fuel'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.github.kittinunf.fuel.util
import java.io.InputStream
import java.io.OutputStream

fun InputStream.copyTo(out: OutputStream, bufferSize: Int = defaultBufferSize, progress: ((Long) -> Unit)?): Long {
fun InputStream.copyTo(out: OutputStream, bufferSize: Int = DEFAULT_BUFFER_SIZE, progress: ((Long) -> Unit)?): Long {
var bytesCopied = 0L
val buffer = ByteArray(bufferSize)
var bytes = read(buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ class RequestTest : BaseTestCase() {
fun httpGetSyncRequest() {
var received: Received = Received()
manager.request(Method.GET, "http://httpbin.org/get").sync().responseString { req, res, result ->
received = Received(res, result.value, result.error)
val (value, error) = result
received = Received(res, value, error)
}

assertThat(received, notNullValue())
Expand Down
8 changes: 4 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 23
Expand Down Expand Up @@ -39,7 +40,7 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile "com.android.support:appcompat-v7:$android_support_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$parent.ext.kotlin_version"
compile "com.google.code.gson:gson:$gson_version"

compile project(':fuel-android')
Expand All @@ -48,7 +49,6 @@ dependencies {
buildscript {
ext {
android_support_version = '23.1.1'
kotlin_version = '1.0.0-beta-4589'
gson_version = '2.3.1'
}

Expand All @@ -57,7 +57,7 @@ buildscript {
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$parent.ext.kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$parent.ext.kotlin_version"
}
}
2 changes: 1 addition & 1 deletion sample/src/main/kotlin/com/example/fuel/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import kotlinx.android.synthetic.main.activity_main.*
import java.io.File
import java.io.Reader

public class MainActivity : AppCompatActivity() {
class MainActivity : AppCompatActivity() {

val TAG = "Main"

Expand Down

0 comments on commit 4e46928

Please sign in to comment.