Skip to content

Commit

Permalink
Merge branch 'main' into mdwairi/injectable-http-client
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	code/build.gradle
#	code/src/main/kotlin/com/expediagroup/sdk/graphql/common/DefaultGraphQLExecutor.kt
#	code/src/main/kotlin/com/expediagroup/sdk/graphql/common/GraphQLClient.kt
#	code/src/main/kotlin/com/expediagroup/sdk/graphql/common/GraphQLExecutor.kt
#	code/src/main/kotlin/com/expediagroup/sdk/graphql/model/response/Error.kt
#	code/src/main/kotlin/com/expediagroup/sdk/lodgingconnectivity/configuration/ClientConfiguration.kt
#	code/src/main/kotlin/com/expediagroup/sdk/lodgingconnectivity/payment/PaymentClient.kt
#	code/src/main/kotlin/com/expediagroup/sdk/lodgingconnectivity/sandbox/SandboxDataManagementClient.kt
#	code/src/main/kotlin/com/expediagroup/sdk/lodgingconnectivity/supply/reservation/ReservationClient.kt
#	gradle.properties
  • Loading branch information
Mohammad-Dwairi committed Dec 1, 2024
2 parents 0720f05 + e4bfba9 commit e237320
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/pr-auto-approve.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Auto First Approval for Bot PRs
on: pull_request

jobs:
auto-first-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
steps:
- name: Provide first approval
uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
review-message: "Renovate and Dependabot PRs are automatically approved. Still requires human review."
92 changes: 92 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Development Guide

## Development Requirements

- Java 11 (for development/compilation)
- Gradle
- Git

Note: The generated SDKs require Java 8+ for runtime usage.

## Quick Start

### 1. Clone the Repository

```bash
git clone https://github.com/ExpediaGroup/lodging-connectivity-java-sdk.git
cd lodging-connectivity-java-sdk
```

### 2. Initialize GraphQL Module

```bash
./scripts/graphql/init.sh
```

This script pulls the required GraphQL schema from the dependent repository.

### 3. Build the Project

Full build with local Maven publication:

```bash
./gradlew clean generateApolloSources build publishToMavenLocal
```

Alternatively, for local development you can use:

```bash
./gradlew clean build
```

## Project Structure

```
lodging-connectivity-java-sdk/
├── code/src/main/
│ ├── graphql/ # GraphQL schema and queries (Sub module)
│ └── kotlin/ # Kotlin source code of the SDK
├── examples/
│ └── src/main/java/ # Example usage of the SDK in Java
├── docs/ # Documentation files
├── scripts/
│ └── graphql/ # GraphQL setup scripts
├── apollo-compiler-plugin/
│ └── src/main/ # Apollo compiler plugin source code
├── build.gradle # Gradle build configuration
├── gradle.properties # Gradle properties
├── settings.gradle # Gradle settings
└── ...
```

## Common Issues

### 1. Gradle Cannot Detect JDK

If Gradle fails to detect your JDK installation, try either:

**Option 1**: Add this line to the root `gradle.properties`:

```properties
org.gradle.java.installations.fromEnv=true
```

**Option 2**: Set JAVA_HOME explicitly:

```bash
export JAVA_HOME=$(/usr/libexec/java_home -v 11)
```

### 2. Build Failures

- Ensure Java 11 is installed and configured as your development JDK
- Check your Java version: `java -version`
- Make sure you've run the GraphQL module initialization script
- Run with `--stacktrace` flag for detailed error information:
```bash
./gradlew build --stacktrace
```

## Questions or Issues?

Create an issue in the GitHub repository with details about your problem.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2024 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.expediagroup.sdk.graphql.extension

import com.apollographql.apollo.api.Error

fun Error.toSDKError() =
com.expediagroup.sdk.graphql.model.response.Error(
message = this.message,
path = this.path?.map { it.toString() }
)
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kotlin.code.style=official
groupId=com.expediagroup
version=1.0.6-SNAPSHOT
version=1.0.7-SNAPSHOT
artifactName=lodging-connectivity-sdk
description=SDK for Lodging Connectivity APIs

Expand Down

0 comments on commit e237320

Please sign in to comment.