Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions scripts/generate-sdk/.openapi-generator-ignore-java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@ git_push.sh
.gitignore
api/openapi.yaml
tox.ini
**/.github/**
**/AndroidManifest.xml

# we have our own github workflows
.github/**

# Ignore maven and simple build tool (sbt) stuff, because we use gradle
pom.xml
build.sbt
build.sbt

# there's no content in it
gradle.properties

# gradle wrapper (we don't need it because we use the generated projects as gradle subprojects)
gradlew.bat
gradlew
gradle/**
10 changes: 3 additions & 7 deletions scripts/generate-sdk/languages/java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ generate_java_sdk() {
# Remove unnecessary files
rm "${SERVICES_FOLDER}/${service}/.openapi-generator-ignore"
rm -r "${SERVICES_FOLDER}/${service}/.openapi-generator/"
rm "${SERVICES_FOLDER}/${service}/.github/workflows/maven.yml"

# If the service has a README.md file, move them inside the service folder
if [ -f ${sdk_services_backup_dir}/${service}/README.md ]; then
echo "Found ${service} \"README.md\" file"
cp -r ${sdk_services_backup_dir}/${service}/README.md ${SERVICES_FOLDER}/${service}/README.md
fi

# If the service has a CHANGELOG file, move it inside the service folder
if [ -f ${sdk_services_backup_dir}/${service}/CHANGELOG.md ]; then
Expand All @@ -157,4 +150,7 @@ generate_java_sdk() {
fi

done

cd "${SDK_REPO_LOCAL_PATH}"
make fmt
}
2 changes: 1 addition & 1 deletion templates/java/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package is part of the STACKIT Java SDK. For additional information, please
## Requirements

Building the API client library requires:
1. Java 1.8+
1. Java SDK (version 11 to 21 should be supported) installed on your system

## Installation

Expand Down
53 changes: 53 additions & 0 deletions templates/java/build.gradle.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{! This template was customized to allow the services to be a subprojects in one big gradle project. }}
{{! Original template: https://github.com/OpenAPITools/openapi-generator/blob/v7.14.0/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache }}

ext {
{{#swagger1AnnotationLibrary}}
swagger_annotations_version = "1.6.9"
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
swagger_annotations_version = "2.2.9"
{{/swagger2AnnotationLibrary}}
jakarta_annotation_version = "1.3.5"
{{#useBeanValidation}}
bean_validation_version = "2.0.2"
{{/useBeanValidation}}
}

dependencies {
{{#swagger1AnnotationLibrary}}
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version"
{{/swagger2AnnotationLibrary}}
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
{{#openApiNullable}}
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
{{/openApiNullable}}
{{#withAWSV4Signature}}
implementation 'software.amazon.awssdk:auth:2.20.157'
{{/withAWSV4Signature}}
{{#hasOAuthMethods}}
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
{{/hasOAuthMethods}}
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
{{#joda}}
implementation 'joda-time:joda-time:2.9.9'
{{/joda}}
{{#dynamicOperations}}
implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30'
{{/dynamicOperations}}
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
{{#useBeanValidation}}
implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version"
{{/useBeanValidation}}
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.mockito:mockito-core:3.12.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
}
Loading