Skip to content

Commit 8e04faf

Browse files
Fix maven publication (#12)
* Update resources strings for api initialization * Update Android Studio * Update app demo string resources values names * Expose moshi in BaseApi to be able to provide raw string post endpoints * Fix SeatMaps endpoints missing and add post methods by object and string * Rework Builder to hide empty constructor, and provide the possibility to initialize it without having to set credentials * Use new internal builder constructor and fix tests * Add tests for seatmap by id * Update ReadMe * Fix missing credentials for lib compilation * Deployment (#9) * Prepare deployment * Prepare deployment * Replace double quotes by simple quote in build.gradle * Remove comment in deployment file * Fix error in build.gradle * change build command in travis * Add call in documentation * Add pricing api * Fix #1 delete old apis (cherry picked from commit 728c4b0) * Move gradle.properties * Update publish.gradle script * update publish and conf * Move lib to amadeus-android to reflect project name on artifact. Add modules sources to artifact sources. Build javadoc with dokka (javadoc from modules missing for now). * Fix sources type * Fix artifacts publishing issues * Fix missing archives configuration * Remove configurations from bintray * configure travis ci * #4 - Add pricing post missing * #4 - Fix predictions delay api * Add missing co2 property * #4 - Add missing delete * #4 - Add missing post flight orders * fix format of the source archive from aar to jar * Rename Result class in ApiResult, to avoid conflicts with Kotlin Result class * Add missing shelf folder in .gitignore * Fix removal of kotlin reflect * Fix app sample code * Add mavenLocal() to app sample repositories for internal development * Fix README.md implementation example * Fix maven publication and artifact generation * Use project from maven source instead of local project * Create task to generate all dokka documentation * Update travis config to reflect new maven publication * Prepare release v0.0.3 Co-authored-by: Anthony Roux <m.roux.a@gmail.com>
1 parent 46f0b7d commit 8e04faf

20 files changed

Lines changed: 46 additions & 58 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ captures/
4444
.idea/assetWizardSettings.xml
4545
.idea/dictionaries
4646
.idea/libraries
47+
.idea/shelf
4748
.idea/runConfigurations.xml
4849
# Android Studio 3 in .gitignore file.
4950
.idea/caches

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ jobs:
3434
include:
3535
- stage: build
3636
script:
37-
- ./gradlew amadeus-android:clean
38-
- ./gradlew amadeus-android:publishToMavenLocal
37+
- ./gradlew clean
38+
- ./gradlew publishToMavenLocal
39+
- ./gradlew dokka
3940

4041
deploy:
4142
- provider: pages
42-
local-dir: amadeus-android/build/dokka
43+
local-dir: build/dokka
4344
github-token: $GITHUB_TOKEN
4445
skip-cleanup: true
4546
keep-history: true

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ You can install the SDK via Maven or Gradle.
2020
<dependency>
2121
<groupId>com.amadeus</groupId>
2222
<artifactId>amadeus-android</artifactId>
23-
<version>0.0.2</version>
23+
<version>0.0.3</version>
2424
</dependency>
2525
```
2626
#### Gradle
2727
```kotlin
28-
implementation "com.amadeus:amadeus-android:0.0.2"
28+
implementation 'com.amadeus:amadeus-android:0.0.3'
2929
```
3030

3131
## Getting Started

air/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,5 @@ dependencies {
100100
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
101101
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
102102
}
103+
104+
apply from: '../publish.gradle'

amadeus-android/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,4 @@ dependencies {
7878
api "com.jakewharton.threetenabp:threetenabp:$threetenabp_version"
7979
}
8080

81-
sourceSets {
82-
main {
83-
java {
84-
srcDirs = ["src/main/java", "../air/src/main/java", "../base/src/main/java", "../hotel/src/main/java", "../trip/src/main/java"]
85-
}
86-
}
87-
}
88-
89-
apply from: 'publish.gradle'
81+
apply from: '../publish.gradle'

amadeus-android/src/test/java/com/amadeus/android/service/AmadeusTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.amadeus.android.service
22

33
import com.amadeus.android.Amadeus
44
import com.amadeus.android.BuildConfig
5-
import com.amadeus.android.base.Result
5+
import com.amadeus.android.base.ApiResult
66
import com.amadeus.android.base.succeeded
77
import com.amadeus.android.domain.air.models.Location
88
import kotlinx.coroutines.runBlocking
@@ -176,7 +176,7 @@ class AmadeusTest {
176176
view = "FULL_ALL_IMAGES"
177177
)
178178
when (offers) {
179-
is Result.Success -> {
179+
is ApiResult.Success -> {
180180
assert(
181181
amadeus.shopping.hotelOffer(offers.data.offers?.get(0)?.id ?: "").get()?.succeeded ?: false
182182
)

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ android {
5252

5353
dependencies {
5454
implementation fileTree(dir: 'libs', include: ['*.jar'])
55-
implementation project(path: ':amadeus-android')
55+
implementation 'com.amadeus:amadeus-android:0.0.3'
5656
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
5757
implementation 'androidx.appcompat:appcompat:1.1.0'
5858
implementation 'androidx.activity:activity-ktx:1.1.0'

app/src/main/java/com/amadeus/android/example/MainActivity.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package com.amadeus.android.example
22

33
import android.os.Bundle
4-
import androidx.activity.viewModels
54
import androidx.appcompat.app.AppCompatActivity
65
import androidx.fragment.app.Fragment
76
import com.amadeus.android.example.databinding.ActivityMainBinding
87

98
class MainActivity : AppCompatActivity() {
109

1110
private lateinit var binding: ActivityMainBinding
12-
private val viewModel: MainViewModel by viewModels()
1311

1412
override fun onCreate(savedInstanceState: Bundle?) {
1513
super.onCreate(savedInstanceState)

app/src/main/java/com/amadeus/android/example/SampleApplication.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ package com.amadeus.android.example
22

33
import android.app.Application
44
import com.amadeus.android.Amadeus
5-
import com.amadeus.android.BuildConfig
65

76
class SampleApplication: Application() {
87

98
override fun onCreate() {
109
super.onCreate()
1110
amadeus = Amadeus.Builder(this)
12-
.setClientId(BuildConfig.AMADEUS_CLIENT_ID)
13-
.setClientSecret(BuildConfig.AMADEUS_CLIENT_SECRET)
11+
.setClientId(getString(R.string.amadeus_client_id))
12+
.setClientSecret(getString(R.string.amadeus_client_id))
1413
.setCustomAppIdAndVersion("com.amadeus.android.demo", "1.0.0")
1514
.setLogLevel(Amadeus.Builder.LogLevel.BODY)
1615
.setHostName(Amadeus.Builder.Hosts.TEST)

app/src/main/java/com/amadeus/android/example/fragments/search/HotelsOffersViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import androidx.lifecycle.LiveData
44
import androidx.lifecycle.MutableLiveData
55
import androidx.lifecycle.ViewModel
66
import androidx.lifecycle.viewModelScope
7-
import com.amadeus.android.base.Result
7+
import com.amadeus.android.base.ApiResult
88
import com.amadeus.android.base.succeeded
99
import com.amadeus.android.domain.hotel.models.HotelOffers
1010
import com.amadeus.android.example.SampleApplication
@@ -36,15 +36,15 @@ class HotelsOffersViewModel : ViewModel() {
3636
checkInDate = checkInDate,
3737
checkOutDate = checkOutDate
3838
)) {
39-
is Result.Success -> {
39+
is ApiResult.Success -> {
4040
if (result.succeeded) {
4141
_hotelOffers.value = result.data
4242
} else {
4343
//call return without data
4444
error.value = "No result for your research"
4545
}
4646
}
47-
is Result.Error -> error.value = "Error when retrieving data."
47+
is ApiResult.Error -> error.value = "Error when retrieving data."
4848
}
4949
_loading.value = false
5050
}

0 commit comments

Comments
 (0)