Skip to content

Commit

Permalink
[android] Regenerate samples
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Jun 16, 2024
1 parent f1a536a commit 84d623e
Show file tree
Hide file tree
Showing 19 changed files with 154 additions and 145 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0-SNAPSHOT
7.7.0-SNAPSHOT
14 changes: 7 additions & 7 deletions samples/client/petstore/android/httpclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ Class | Method | HTTP request | Description
## Documentation for Authorization

Authentication schemes defined for the API:
### api_key

- **Type**: API key

- **API key parameter name**: api_key
- **Location**: HTTP header

### petstore_auth


Expand All @@ -134,6 +127,13 @@ Authentication schemes defined for the API:
- write:pets: modify pets in your account
- read:pets: read your pets

### api_key

- **Type**: API key

- **API key parameter name**: api_key
- **Location**: HTTP header


## Recommendation

Expand Down
90 changes: 29 additions & 61 deletions samples/client/petstore/android/httpclient/build.gradle
Original file line number Diff line number Diff line change
@@ -1,92 +1,60 @@
group = 'org.openapitools'
project.version = '1.0.0'

buildscript {
repositories {
maven { url "https://repo1.maven.org/maven2" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
plugins {
id 'com.android.library' version '8.0.0'
id 'maven-publish'
}

allprojects {
repositories {
jcenter()
}
}


apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
namespace "org.openapitools.client"
compileSdkVersion 33
buildToolsVersion '34.0.0'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 33
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

// 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)
}
publishing {
singleVariant('release') {
withSourcesJar()
}
}
}


ext {
swagger_annotations_version = "1.6.6"
gson_version = "2.8.9"
gson_version = "2.10.1"
httpclient_version = "4.5.13"
httpcore_version = "4.4.4"
junit_version = "4.13"
}

dependencies {
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "com.google.code.gson:gson:$gson_version"
compile "org.apache.httpcomponents:httpcore:$httpcore_version"
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
compile ("org.apache.httpcomponents:httpcore:$httpcore_version") {
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
implementation "com.google.code.gson:gson:$gson_version"
implementation "org.apache.httpcomponents:httpcore:$httpcore_version"
implementation "org.apache.httpcomponents:httpclient:$httpclient_version"
implementation ("org.apache.httpcomponents:httpcore:$httpcore_version") {
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
compile ("org.apache.httpcomponents:httpmime:$httpclient_version") {
implementation ("org.apache.httpcomponents:httpmime:$httpclient_version") {
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
testCompile "junit:junit:$junit_version"
testImplementation "junit:junit:$junit_version"
}

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);
}
}
publishing {
publications {
release(MavenPublication) {
groupId = 'org.openapitools'
artifactId = 'openapi-android-client'
version = '1.0.0'

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

artifacts {
archives sourcesJar
afterEvaluate {
from components.release
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions samples/client/petstore/android/httpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemProperties>
<systemPropertyVariables>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
</systemPropertyVariables>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
Expand Down Expand Up @@ -172,7 +172,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-core-version>1.6.6</swagger-core-version>
<gson-version>2.8.9</gson-version>
<gson-version>2.10.1</gson-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13.2</junit-version>
<httpclient-version>4.5.13</httpclient-version>
Expand Down
16 changes: 16 additions & 0 deletions samples/client/petstore/android/httpclient/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}

rootProject.name = "openapi-android-client"
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ public String getMessage() {
public void setMessage(String message) {
this.message = message;
}

@Override
public String toString() {
return "ApiException{" +
"code=" + code +
", message=" + message +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import org.openapitools.client.model.ApiResponse;
import java.io.File;
import java.util.*;
import org.openapitools.client.model.Pet;

import org.apache.http.entity.mime.MultipartEntityBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
pom.xml
settings.gradle
src/main/AndroidManifest.xml
src/main/java/org/openapitools/client/ApiException.java
src/main/java/org/openapitools/client/ApiInvoker.java
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0-SNAPSHOT
7.7.0-SNAPSHOT
14 changes: 7 additions & 7 deletions samples/client/petstore/android/volley/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ Class | Method | HTTP request | Description
## Documentation for Authorization

Authentication schemes defined for the API:
### api_key

- **Type**: API key

- **API key parameter name**: api_key
- **Location**: HTTP header

### petstore_auth


Expand All @@ -134,6 +127,13 @@ Authentication schemes defined for the API:
- write:pets: modify pets in your account
- read:pets: read your pets

### api_key

- **Type**: API key

- **API key parameter name**: api_key
- **Location**: HTTP header


## Recommendation

Expand Down
94 changes: 34 additions & 60 deletions samples/client/petstore/android/volley/build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
group = 'org.openapitools'
project.version = '1.0.0'

buildscript {
repositories {
mavenLocal()
google()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}

allprojects {
repositories {
google()
jcenter()
}
plugins {
id 'com.android.library' version '8.0.0'
id 'maven-publish'
}


apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
namespace "org.openapitools.client"
compileSdkVersion 33
buildToolsVersion '34.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
targetSdkVersion 33
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -41,25 +18,24 @@ android {
lintOptions {
abortOnError false
}

// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.all { output ->
if (outputFile != null && outputFileName.endsWith('.aar')) {
outputFileName = "${archivesBaseName}-${version}.aar"
}
}
packagingOptions {
resources.excludes += "META-INF/DEPENDENCIES"
}

testOptions {
unitTests.returnDefaultValues = true
}
publishing {
singleVariant('release') {
withSourcesJar()
}
}
}

ext {
swagger_annotations_version = "1.6.6"
gson_version = "2.8.9"
httpmime_version = "4.5.13"
gson_version = "2.10.1"
httpcore_version = "4.4.16"
httpmime_version = "4.5.14"
volley_version = "1.2.1"
junit_version = "4.13.2"
robolectric_version = "4.5.1"
Expand All @@ -69,30 +45,28 @@ ext {
dependencies {
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
implementation "com.google.code.gson:gson:$gson_version"
implementation "org.apache.httpcomponents:httpmime:$httpmime_version"
implementation ("org.apache.httpcomponents:httpcore:$httpcore_version") {
exclude(group: "org.apache.httpcomponents", module: "httpclient")
}
implementation ("org.apache.httpcomponents:httpmime:$httpmime_version") {
exclude(group: "org.apache.httpcomponents", module: "httpclient")
}
implementation "com.android.volley:volley:${volley_version}"
testImplementation "junit:junit:$junit_version"
testImplementation "org.robolectric:robolectric:${robolectric_version}"
testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}"
}

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'
}
publishing {
publications {
release(MavenPublication) {
groupId = 'org.openapitools'
artifactId = 'petstore-android-volley'
version = '1.0.0'

artifacts {
archives sourcesJar
afterEvaluate {
from components.release
}
}
}
}
Loading

0 comments on commit 84d623e

Please sign in to comment.