Skip to content

Commit 6626b5d

Browse files
committed
Release 1.8.0
2 parents 7092066 + 6d6877e commit 6626b5d

File tree

809 files changed

+693
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

809 files changed

+693
-400
lines changed

.gitignore

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
/build
2-
/.idea
1+
# Gradle
32
.gradle
4-
.DS_STORE
5-
*.iml
3+
gradlew.bat
4+
build
65
local.properties
6+
reports
7+
build
78

8-
# fastlane specific
9-
**/fastlane/report.xml
9+
# IntelliJ IDEA
10+
.idea
11+
*.iml
12+
*.ipl
13+
*.iws
14+
classes/
15+
idea-classes/
16+
coverage-error.log
1017

11-
# deliver temporary files
12-
**/fastlane/Preview.html
18+
# Finder
19+
.DS_Store
1320

14-
# snapshot generated screenshots
21+
# fastlane
22+
**/fastlane/report.xml
23+
**/fastlane/Preview.html
1524
**/fastlane/screenshots
16-
17-
# scan temporary files
1825
**/fastlane/test_output
1926

2027
# bitrise
2128
.bitrise.yml
29+
30+
# Java
31+
*.hprof

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# 1.8.0
2+
3+
### Added
4+
- Facets ordering (#245)
5+
6+
### Fixed
7+
- Analytics: fields nullability in response variant (#262)
8+
9+
### Changed
10+
- Update Kotlin to 1.5.10
11+
- Update Ktor 1.6.0
12+
113
# 1.7.0
214

315
### Added

DOCKER_README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
In this page you will find our recommended way of installing Docker on your machine.
2+
This guide is made for OSX users.
3+
4+
## Install docker
5+
6+
First install Docker using [Homebrew](https://brew.sh/)
7+
```
8+
$ brew install docker
9+
```
10+
11+
You can then install [Docker Desktop](https://docs.docker.com/get-docker/) if you wish, or use `docker-machine`. As we prefer the second option, we will only document this one.
12+
13+
## Setup your docker
14+
15+
Install `docker-machine`
16+
```
17+
$ brew install docker-machine
18+
```
19+
20+
Then install [VirtualBox](https://www.virtualbox.org/) with [Homebrew Cask](https://github.com/Homebrew/homebrew-cask) to get a driver for your Docker machine
21+
```
22+
$ brew cask install virtualbox
23+
```
24+
25+
You may need to enter your password and authorize the application in your `System Settings` > `Security & Privacy`.
26+
27+
Create now a new machine, set it up as default and connect your shell to it (here we use zsh. The commands should anyway be displayed in each steps' output)
28+
29+
```
30+
$ docker-machine create --driver virtualbox default
31+
$ docker-machine env default
32+
$ eval "$(docker-machine env default)"
33+
```
34+
35+
Now you're all setup to use our provided Docker image!
36+
37+
## Build the image
38+
39+
```bash
40+
docker build -t algolia-kotlin .
41+
```
42+
43+
## Run the image
44+
45+
You need to provide few environment variables at runtime to be able to run the [Common Test Suite](https://github.com/algolia/algoliasearch-client-specs/tree/master/common-test-suite).
46+
You can set them up directly in the command:
47+
48+
```bash
49+
docker run -it --rm --env ALGOLIA_APP_ID=XXXXXX [...] -v $PWD:/app -w /app algolia-kotlin bash
50+
```
51+
52+
However, we advise you to export them in your `.bashrc` or `.zshrc`. That way, you can use [Docker's shorten syntax](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file) to set your variables.
53+
54+
```bash
55+
### For external contributors, only the following env variables should be enough
56+
docker run -it --rm --env ALGOLIA_APPLICATION_ID_1 \
57+
--env ALGOLIA_ADMIN_KEY_1 \
58+
--env ALGOLIA_SEARCH_KEY_1 \
59+
-v $PWD:/app -w /app algolia-kotlin bash
60+
61+
### This is needed only to run the full test suite
62+
docker run -it --rm --env ALGOLIA_APPLICATION_ID_1 \
63+
--env ALGOLIA_ADMIN_KEY_1 \
64+
--env ALGOLIA_SEARCH_KEY_1 \
65+
--env ALGOLIA_APPLICATION_ID_2 \
66+
--env ALGOLIA_ADMIN_KEY_2 \
67+
--env ALGOLIA_APPLICATION_ID_MCM \
68+
--env ALGOLIA_ADMIN_KEY_MCM \
69+
-v $PWD:/app -w /app algolia-kotlin bash
70+
```
71+
72+
Once your container is running, any changes you make in your IDE are directly reflected in the container.
73+
74+
To build and run tests, you can use the following commands:
75+
```shell script
76+
# build the project
77+
./gradlew assemble
78+
79+
# run tests
80+
./gradlew jvmTest
81+
```
82+
83+
Feel free to contact us if you have any questions.

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM openjdk:11
2+
3+
ENV GRADLE_OPTS="-Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false"
4+
WORKDIR /app
5+
COPY . /app/
6+
RUN ./gradlew dependencies

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ If however, you don’t use R8 you have to apply the rules from [this file](src/
159159

160160
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/kotlin/) where you will find answers for the most common issues and gotchas with the client.
161161

162+
## Use the Dockerfile
163+
164+
If you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check our [dedicated guide](DOCKER_README.MD) to learn more.
165+
162166
## 📄 License
163167

164168
Algolia Kotlin API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).

build.gradle.kts

Lines changed: 12 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,27 @@
1-
import com.diffplug.gradle.spotless.SpotlessExtension
2-
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
3-
41
buildscript {
52
repositories {
63
mavenCentral()
7-
google()
84
}
95
dependencies {
10-
classpath(plugin.Spotless())
11-
}
12-
}
13-
14-
plugins {
15-
kotlin("multiplatform") version "1.4.30"
16-
kotlin("plugin.serialization") version "1.4.30"
17-
id("maven-publish")
18-
id("signing")
19-
}
20-
21-
apply(plugin = "com.diffplug.spotless")
22-
23-
repositories {
24-
mavenCentral()
25-
google()
26-
}
27-
28-
version = Library.version
29-
group = Library.group
30-
31-
kotlin {
32-
explicitApi()
33-
jvm {
34-
compilations.all {
35-
kotlinOptions {
36-
jvmTarget = "1.8"
37-
}
38-
}
39-
}
40-
41-
sourceSets {
42-
all {
43-
languageSettings.progressiveMode = true
44-
}
45-
val commonMain by getting {
46-
kotlin.srcDirs("$buildDir/generated/sources/templates/kotlin/main")
47-
dependencies {
48-
api(Ktor("client"))
49-
api(Ktor("client-json"))
50-
api(Ktor("client-logging"))
51-
api(Ktor("client-serialization"))
52-
}
53-
}
54-
val commonTest by getting {
55-
dependencies {
56-
implementation(kotlin("test"))
57-
implementation(kotlin("test-annotations-common"))
58-
implementation(Ktor("client"))
59-
implementation(Ktor("client-mock"))
60-
}
61-
}
62-
val jvmTest by getting {
63-
dependencies {
64-
implementation(kotlin("test-junit"))
65-
implementation(Ktor("client-okhttp"))
66-
implementation(Ktor("client-apache"))
67-
implementation(Ktor("client-android"))
68-
}
69-
}
70-
}
71-
}
72-
73-
tasks {
74-
75-
withType<KotlinCompile<*>>().configureEach {
76-
dependsOn("copyTemplates")
77-
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
78-
}
79-
80-
register(name = "copyTemplates", type = Copy::class) {
81-
from("src/commonMain/templates")
82-
into("$buildDir/generated/sources/templates/kotlin/main")
83-
expand("projectVersion" to Library.version)
84-
filteringCharset = "UTF-8"
85-
}
86-
87-
withType<Test> {
88-
maxParallelForks = Runtime.getRuntime().availableProcessors().minus(1).coerceAtLeast(1)
89-
}
90-
}
91-
92-
configure<SpotlessExtension> {
93-
kotlin {
94-
target("**/*.kt")
95-
ktlint("0.40.0")
96-
trimTrailingWhitespace()
97-
endWithNewline()
6+
val kotlinVersion = "1.5.10"
7+
classpath(kotlin("gradle-plugin", version = kotlinVersion))
8+
classpath(kotlin("serialization", version = kotlinVersion))
9+
classpath(MavenPublish())
10+
classpath(Spotless())
9811
}
9912
}
10013

101-
//** Publish **//
102-
val emptyJar by tasks.creating(Jar::class) {
103-
archiveAppendix.set("empty")
14+
project.extensions.extraProperties.apply {
15+
set("GROUP", Library.group)
16+
set("VERSION_NAME", Library.version)
10417
}
10518

106-
publishing {
19+
subprojects {
10720
repositories {
108-
maven {
109-
name = "MavenCentral"
110-
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
111-
credentials {
112-
username = System.getenv("SONATYPE_USER")
113-
password = System.getenv("SONATYPE_KEY")
114-
}
115-
}
116-
}
117-
118-
publications.withType<MavenPublication>().all {
119-
groupId = Library.group
120-
version = Library.version
121-
artifactId = when (name) {
122-
"kotlinMultiplatform" -> Library.artifact
123-
else -> "${Library.artifact}-$name"
124-
}
125-
126-
artifact(emptyJar) { classifier = "javadoc" }
127-
128-
pom.withXml {
129-
asNode().apply {
130-
appendNode("name", "Algolia Search API Client for Kotlin")
131-
appendNode("description",
132-
"Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries," +
133-
"and pre-built integrations. Algolia API Client for Kotlin lets you easily use the Algolia Search" +
134-
"REST API from your JVM project, such as Android or backend implementations.")
135-
appendNode("url", "https://github.com/algolia/algoliasearch-client-kotlin")
136-
appendNode("licenses")
137-
.appendNode("license").apply {
138-
appendNode("name", "MIT")
139-
appendNode("url", "http://www.opensource.org/licenses/mit-license.php")
140-
appendNode("distribution", "repo")
141-
}
142-
appendNode("developers")
143-
.appendNode("developer").apply {
144-
appendNode("id", "algolia")
145-
appendNode("name", "The Algolia Team")
146-
appendNode("email", "[email protected]")
147-
appendNode("organization", "Algolia")
148-
appendNode("organizationUrl", "https://algolia.com")
149-
}
150-
appendNode("scm").apply {
151-
appendNode("url", "https://github.com/algolia/algoliasearch-client-kotlin")
152-
appendNode("connection", "scm:git:git://github.com/algolia/algoliasearch-client-kotlin.git")
153-
appendNode("developerConnection",
154-
"scm:git:ssh://github.com:algolia/algoliasearch-client-kotlin.git")
155-
}
156-
}
157-
}
21+
mavenCentral()
15822
}
15923
}
16024

161-
signing {
162-
val signingKeyId = System.getenv("SIGNING_KEY_ID")
163-
val signingKey = System.getenv("SIGNING_KEY")
164-
val signingPassword = System.getenv("SIGNING_PASSWORD")
165-
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
166-
sign(publishing.publications)
25+
tasks.register<Delete>("clean") {
26+
delete(rootProject.buildDir)
16727
}

buildSrc/src/main/kotlin/Ktor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ object Ktor : Dependency {
22

33
override val group = "io.ktor"
44
override val artifact = "ktor"
5-
override val version = "1.5.1"
5+
override val version = "1.6.0"
66
}

buildSrc/src/main/kotlin/Library.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ object Library : Dependency {
22

33
override val group = "com.algolia"
44
override val artifact = "algoliasearch-client-kotlin"
5-
override val version = "1.7.0"
5+
override val version = "1.8.0"
66
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object MavenPublish : Dependency {
2+
3+
override val group = "com.vanniktech"
4+
override val artifact = "gradle-maven-publish-plugin"
5+
override val version = "0.15.1"
6+
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
package plugin
2-
3-
import Dependency
4-
51
object Spotless : Dependency {
62

73
override val group = "com.diffplug.spotless"
84
override val artifact = "spotless-plugin-gradle"
9-
override val version = "5.9.0"
5+
override val version = "5.14.0"
106
}

0 commit comments

Comments
 (0)