Skip to content

Commit f3582c3

Browse files
committed
Merge pull request #2136 from xhh/logging-libs-fix
Java okhttp-gson: fix dependencies
2 parents af594ea + 908ab83 commit f3582c3

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') {
2323
2424
apply plugin: 'com.android.library'
2525
apply plugin: 'com.github.dcendents.android-maven'
26-
26+
2727
android {
2828
compileSdkVersion 22
2929
buildToolsVersion '22.0.0'
@@ -35,7 +35,7 @@ if(hasProperty('target') && target == 'android') {
3535
sourceCompatibility JavaVersion.VERSION_1_7
3636
targetCompatibility JavaVersion.VERSION_1_7
3737
}
38-
38+
3939
// Rename the aar correctly
4040
libraryVariants.all { variant ->
4141
variant.outputs.each { output ->
@@ -51,7 +51,7 @@ if(hasProperty('target') && target == 'android') {
5151
provided 'javax.annotation:jsr250-api:1.0'
5252
}
5353
}
54-
54+
5555
afterEvaluate {
5656
android.libraryVariants.all { variant ->
5757
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
@@ -63,12 +63,12 @@ if(hasProperty('target') && target == 'android') {
6363
artifacts.add('archives', task);
6464
}
6565
}
66-
66+
6767
task sourcesJar(type: Jar) {
6868
from android.sourceSets.main.java.srcDirs
6969
classifier = 'sources'
7070
}
71-
71+
7272
artifacts {
7373
archives sourcesJar
7474
}
@@ -77,16 +77,16 @@ if(hasProperty('target') && target == 'android') {
7777
7878
apply plugin: 'java'
7979
apply plugin: 'maven'
80-
80+
8181
sourceCompatibility = JavaVersion.VERSION_1_7
8282
targetCompatibility = JavaVersion.VERSION_1_7
83-
83+
8484
install {
8585
repositories.mavenInstaller {
8686
pom.artifactId = '{{artifactId}}'
8787
}
8888
}
89-
89+
9090
task execute(type:JavaExec) {
9191
main = System.getProperty('mainClass')
9292
classpath = sourceSets.main.runtimeClasspath
@@ -95,8 +95,8 @@ if(hasProperty('target') && target == 'android') {
9595

9696
dependencies {
9797
compile 'io.swagger:swagger-annotations:1.5.0'
98-
compile 'com.squareup.okhttp:okhttp:2.4.0'
98+
compile 'com.squareup.okhttp:okhttp:2.7.2'
99+
compile 'com.squareup.okhttp:logging-interceptor:2.7.2'
99100
compile 'com.google.code.gson:gson:2.3.1'
100-
compile 'com.brsanthu:migbase64:2.2'
101101
testCompile 'junit:junit:4.8.1'
102102
}

modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ lazy val root = (project in file(".")).
1010
resolvers += Resolver.mavenLocal,
1111
libraryDependencies ++= Seq(
1212
"io.swagger" % "swagger-annotations" % "1.5.0",
13-
"com.squareup.okhttp" % "okhttp" % "2.4.0",
13+
"com.squareup.okhttp" % "okhttp" % "2.7.2",
14+
"com.squareup.okhttp" % "logging-interceptor" % "2.7.2",
1415
"com.google.code.gson" % "gson" % "2.3.1",
15-
"com.brsanthu" % "migbase64" % "2.2",
1616
"junit" % "junit" % "4.8.1" % "test"
1717
)
1818
)

samples/client/petstore/java/okhttp-gson/build.gradle

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
apply plugin: 'idea'
2+
apply plugin: 'eclipse'
3+
14
group = 'io.swagger'
25
version = '1.0.0'
36

@@ -20,7 +23,7 @@ if(hasProperty('target') && target == 'android') {
2023

2124
apply plugin: 'com.android.library'
2225
apply plugin: 'com.github.dcendents.android-maven'
23-
26+
2427
android {
2528
compileSdkVersion 22
2629
buildToolsVersion '22.0.0'
@@ -32,7 +35,7 @@ if(hasProperty('target') && target == 'android') {
3235
sourceCompatibility JavaVersion.VERSION_1_7
3336
targetCompatibility JavaVersion.VERSION_1_7
3437
}
35-
38+
3639
// Rename the aar correctly
3740
libraryVariants.all { variant ->
3841
variant.outputs.each { output ->
@@ -48,7 +51,7 @@ if(hasProperty('target') && target == 'android') {
4851
provided 'javax.annotation:jsr250-api:1.0'
4952
}
5053
}
51-
54+
5255
afterEvaluate {
5356
android.libraryVariants.all { variant ->
5457
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
@@ -60,12 +63,12 @@ if(hasProperty('target') && target == 'android') {
6063
artifacts.add('archives', task);
6164
}
6265
}
63-
66+
6467
task sourcesJar(type: Jar) {
6568
from android.sourceSets.main.java.srcDirs
6669
classifier = 'sources'
6770
}
68-
71+
6972
artifacts {
7073
archives sourcesJar
7174
}
@@ -74,16 +77,16 @@ if(hasProperty('target') && target == 'android') {
7477

7578
apply plugin: 'java'
7679
apply plugin: 'maven'
77-
80+
7881
sourceCompatibility = JavaVersion.VERSION_1_7
7982
targetCompatibility = JavaVersion.VERSION_1_7
80-
83+
8184
install {
8285
repositories.mavenInstaller {
8386
pom.artifactId = 'swagger-petstore-okhttp-gson'
8487
}
8588
}
86-
89+
8790
task execute(type:JavaExec) {
8891
main = System.getProperty('mainClass')
8992
classpath = sourceSets.main.runtimeClasspath
@@ -92,8 +95,8 @@ if(hasProperty('target') && target == 'android') {
9295

9396
dependencies {
9497
compile 'io.swagger:swagger-annotations:1.5.0'
95-
compile 'com.squareup.okhttp:okhttp:2.4.0'
98+
compile 'com.squareup.okhttp:okhttp:2.7.2'
99+
compile 'com.squareup.okhttp:logging-interceptor:2.7.2'
96100
compile 'com.google.code.gson:gson:2.3.1'
97-
compile 'com.brsanthu:migbase64:2.2'
98101
testCompile 'junit:junit:4.8.1'
99102
}

samples/client/petstore/java/okhttp-gson/build.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ lazy val root = (project in file(".")).
1010
resolvers += Resolver.mavenLocal,
1111
libraryDependencies ++= Seq(
1212
"io.swagger" % "swagger-annotations" % "1.5.0",
13-
"com.squareup.okhttp" % "okhttp" % "2.4.0",
13+
"com.squareup.okhttp" % "okhttp" % "2.7.2",
14+
"com.squareup.okhttp" % "logging-interceptor" % "2.7.2",
1415
"com.google.code.gson" % "gson" % "2.3.1",
15-
"com.brsanthu" % "migbase64" % "2.2",
1616
"junit" % "junit" % "4.8.1" % "test"
1717
)
1818
)

0 commit comments

Comments
 (0)