[Java][Retrofit2] update gradle, sbt build file with latest dependencies (#5238)

* update build.gradle for retrofit2

* update retrofit2 rx2 sample

* update gradle and sbt build file for retrofit2
This commit is contained in:
wing328
2017-03-28 21:05:12 +08:00
committed by GitHub
parent 55e648c0b1
commit 996acc05f5
31 changed files with 120 additions and 76 deletions

View File

@@ -95,17 +95,24 @@ if(hasProperty('target') && target == 'android') {
ext {
oltu_version = "1.0.1"
retrofit_version = "2.0.2"
swagger_annotations_version = "1.5.8"
{{^usePlay24WS}}
retrofit_version = "2.2.0"
{{/usePlay24WS}}
{{#usePlay24WS}}
retrofit_version = "2.1.0"
jackson_version = "2.7.5"
play_version = "2.4.11"
{{/usePlay24WS}}
swagger_annotations_version = "1.5.12"
junit_version = "4.12"
{{#useRxJava}}
rx_java_version = "1.1.3"
rx_java_version = "1.2.9"
{{/useRxJava}}
{{#useRxJava2}}
rx_java_version = "2.0.5"
rx_java_version = "2.0.7"
{{/useRxJava2}}
{{^java8}}
jodatime_version = "2.9.3"
jodatime_version = "2.9.4"
{{/java8}}
}
@@ -126,6 +133,13 @@ dependencies {
{{^java8}}
compile "joda-time:joda-time:$jodatime_version"
{{/java8}}
{{#usePlay24WS}}
compile "com.typesafe.play:play-java-ws_2.11:$play_version"
compile "com.squareup.retrofit2:converter-jackson:$retrofit_version"
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}:$jackson_version"
{{/usePlay24WS}}
testCompile "junit:junit:$junit_version"
}

View File

@@ -9,23 +9,35 @@ lazy val root = (project in file(".")).
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"com.squareup.retrofit2" % "retrofit" % "2.0.2" % "compile",
"com.squareup.retrofit2" % "converter-scalars" % "2.0.2" % "compile",
"com.squareup.retrofit2" % "converter-gson" % "2.0.2" % "compile",
{{^usePlay24WS}}
"com.squareup.retrofit2" % "retrofit" % "2.2.0" % "compile",
"com.squareup.retrofit2" % "converter-scalars" % "2.2.0" % "compile",
"com.squareup.retrofit2" % "converter-gson" % "2.2.0" % "compile",
{{/usePlay24WS}}
{{#usePlay24WS}}
"com.typesafe.play" % "play-java-ws_2.11" % "2.4.11" % "compile",
"com.squareup.retrofit2" % "retrofit" % "2.1.0" % "compile",
"com.squareup.retrofit2" % "converter-scalars" % "2.1.0" % "compile",
"com.squareup.retrofit2" % "converter-gson" % "2.1.0" % "compile",
"com.squareup.retrofit2" % "converter-jackson" % "2.1.0" % "compile",
"com.fasterxml.jackson.core" % "jackson-core" % "2.7.5" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5" % "compile",
{{/usePlay24WS}}
{{#useRxJava}}
"com.squareup.retrofit2" % "adapter-rxjava" % "2.0.2" % "compile",
"io.reactivex" % "rxjava" % "1.1.3" % "compile",
"com.squareup.retrofit2" % "adapter-rxjava" % "{{^usePlay24WS}}2.2.0{{/usePlay24WS}}{{#usePlay24WS}}2.1.0{{/usePlay24WS}}" % "compile",
"io.reactivex" % "rxjava" % "1.2.9" % "compile",
{{/useRxJava}}
{{#useRxJava2}}
"com.jakewharton.retrofit" % "retrofit2-rxjava2-adapter" % "1.0.0" % "compile",
"io.reactivex.rxjava2" % "rxjava" % "2.0.5" % "compile",
"io.reactivex.rxjava2" % "rxjava" % "2.0.7" % "compile",
{{/useRxJava2}}
"io.swagger" % "swagger-annotations" % "1.5.8" % "compile",
"io.swagger" % "swagger-annotations" % "1.5.12" % "compile",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile",
{{^java8}}
"joda-time" % "joda-time" % "2.9.3" % "compile",
"joda-time" % "joda-time" % "2.9.4" % "compile",
{{/java8}}
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
"com.novocode" % "junit-interface" % "0.11" % "test"
)
)