This commit is contained in:
Tony Tam 2015-10-20 11:42:40 -07:00
parent 295af57c9a
commit 7f5cdba606
15 changed files with 140 additions and 194 deletions

View File

@ -1,89 +1,11 @@
group = 'io.swagger'
version = '1.0.0'
apply plugin: 'java'
apply plugin: 'maven'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
}
}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
repositories {
jcenter()
}
if(hasProperty('target') && target == 'android') {
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 22
buildToolsVersion '22.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
}
afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
} else {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-petstore-okhttp-gson'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
mavenCentral()
}
dependencies {
@ -93,3 +15,17 @@ dependencies {
compile 'com.brsanthu:migbase64:2.2'
testCompile 'junit:junit:4.8.1'
}
group = 'io.swagger'
version = '1.0.0'
install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-petstore-okhttp-gson'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;

View File

@ -1,6 +1,6 @@
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class Configuration {
private static ApiClient defaultApiClient = new ApiClient();

View File

@ -1,6 +1,6 @@
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class Pair {
private String name = "";
private String value = "";

View File

@ -1,6 +1,6 @@
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -6,15 +6,22 @@ import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.model.*;
import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call;
import java.lang.reflect.Type;
import java.util.*;
import io.swagger.client.model.Pet;
import java.io.File;
import java.lang.reflect.Type;
import java.util.*;
import java.io.File;
import java.util.Map;
import java.util.HashMap;
public class PetApi {
private ApiClient apiClient;
@ -290,11 +297,7 @@ public class PetApi {
final String contentType = apiClient.selectHeaderContentType(contentTypes);
headerParams.put("Content-Type", contentType);
<<<<<<< HEAD
String[] authNames = new String[] { "api_key", "petstore_auth" };
=======
String[] authNames = new String[] { "api_key" };
>>>>>>> master
return apiClient.buildCall(path, "GET", queryParams, postBody, headerParams, formParams, authNames);
}

View File

@ -6,15 +6,22 @@ import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.model.*;
import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call;
import java.lang.reflect.Type;
import java.util.*;
import java.util.Map;
import io.swagger.client.model.Order;
import java.lang.reflect.Type;
import java.util.*;
import java.io.File;
import java.util.Map;
import java.util.HashMap;
public class StoreApi {
private ApiClient apiClient;

View File

@ -6,15 +6,22 @@ import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.model.*;
import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call;
import java.lang.reflect.Type;
import java.util.*;
import io.swagger.client.model.User;
import java.util.*;
import java.lang.reflect.Type;
import java.util.*;
import java.io.File;
import java.util.Map;
import java.util.HashMap;
public class UserApi {
private ApiClient apiClient;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public interface Authentication {
/** Apply authentication settings to header and query params. */
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:21.445-07:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:25.339-07:00")
public class OAuth implements Authentication {
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {

View File

@ -1,10 +1,6 @@
package io.swagger.client;
<<<<<<< HEAD
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-19T23:12:22.261-07:00")
=======
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-11T00:10:38.251+02:00")
>>>>>>> master
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-20T11:42:31.307-07:00")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -1,16 +1,15 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import io.swagger.client.model.*;
import retrofit.Callback;
import retrofit.http.*;
import retrofit.mime.*;
import java.util.*;
import io.swagger.client.model.Pet;
import java.io.File;
import java.util.*;
public interface PetApi {
/**

View File

@ -1,16 +1,15 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import io.swagger.client.model.*;
import retrofit.Callback;
import retrofit.http.*;
import retrofit.mime.*;
import java.util.*;
import java.util.Map;
import io.swagger.client.model.Order;
import java.util.*;
public interface StoreApi {
/**

View File

@ -1,14 +1,13 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import io.swagger.client.model.*;
import retrofit.Callback;
import retrofit.http.*;
import retrofit.mime.*;
import io.swagger.client.model.User;
import java.util.*;
import io.swagger.client.model.User;
import java.util.*;
public interface UserApi {