From e28471341cab6fb9e61efd24c2a2bb149beaa1aa Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 3 May 2017 16:41:58 +0800 Subject: [PATCH] add switcgh to determine java8, java7 (#5541) --- .../resources/Java/libraries/feign/build.gradle.mustache | 6 ++++++ .../Java/libraries/okhttp-gson/build.gradle.mustache | 6 ++++++ .../resources/Java/libraries/retrofit/build.gradle.mustache | 6 ++++++ .../src/main/resources/Java/libraries/retrofit/pom.mustache | 4 ++-- .../Java/libraries/retrofit2/build.gradle.mustache | 6 ++++++ .../src/main/resources/android/build.mustache | 6 ++++++ .../main/resources/android/libraries/volley/build.mustache | 6 ++++++ .../main/resources/android/libraries/volley/pom.mustache | 4 ++-- .../swagger-codegen/src/main/resources/android/pom.mustache | 4 ++-- samples/client/petstore/android/volley/pom.xml | 4 ++-- 10 files changed, 44 insertions(+), 8 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache index fd64c5626ef..51ac6819fd4 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -32,8 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} } // Rename the aar correctly diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 22911d5207b..cf05d647d42 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -32,8 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} } // Rename the aar correctly diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/build.gradle.mustache index 86955dd32b6..60dec7e1260 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/build.gradle.mustache @@ -32,8 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} } // Rename the aar correctly diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache index b7fbdb15fe4..b5b7a535a4f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -119,8 +119,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index fb63f11066b..b0f88ae54ee 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -32,8 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} } // Rename the aar correctly diff --git a/modules/swagger-codegen/src/main/resources/android/build.mustache b/modules/swagger-codegen/src/main/resources/android/build.mustache index e4e04be8d58..8a5855dc0c4 100644 --- a/modules/swagger-codegen/src/main/resources/android/build.mustache +++ b/modules/swagger-codegen/src/main/resources/android/build.mustache @@ -36,8 +36,14 @@ android { targetSdkVersion 25 } compileOptions { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} } // Rename the aar correctly diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache index dc27b3d90e0..45a83a6af50 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache @@ -35,8 +35,14 @@ android { targetSdkVersion 25 } compileOptions { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} } // Rename the aar correctly diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache index 9c4c99da9a0..0ba404590b0 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache @@ -49,8 +49,8 @@ maven-compiler-plugin 3.5.1 - 1.6 - 1.6 + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} diff --git a/modules/swagger-codegen/src/main/resources/android/pom.mustache b/modules/swagger-codegen/src/main/resources/android/pom.mustache index 355163a0455..c4c4e3a5b9d 100644 --- a/modules/swagger-codegen/src/main/resources/android/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/pom.mustache @@ -100,8 +100,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index eed477b639e..817ea4c0652 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -49,8 +49,8 @@ maven-compiler-plugin 3.5.1 - 1.6 - 1.6 + 1.7 + 1.7