Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gradle task to build a thin jar for Android/Kotlin project #45

Merged
merged 14 commits into from
Mar 11, 2021

Conversation

Yoann-Abbes
Copy link
Contributor

@Yoann-Abbes Yoann-Abbes commented Feb 26, 2021

What does this PR do ?

Deliver a thin jar for Android Kotlin projects.
Change Getting Started Kotlin
Add Bintray publication for the thin jar

How should this be manually tested?

The thin jar is built by default with ./gradlew build

To build the fatJar use ./gradlew fatJar

Initialize an Android/Kotlin project.
Add the fat jar as dependencies.
You should have "duplicate dependencies" issue.
Try to resolve it by adding those line to your application gradle.build file:

configurations {
     cleanedAnnotations
     compile.exclude group: 'org.jetbrains'
     compile.exclude group: 'org.jetbrains.kotlin'
 }

If it does not resolve the problem add the thin jar, and add those dependencies in your application:

    implementation("io.ktor:ktor-client-websockets:1.5.2")
    implementation("io.ktor:ktor-client-okhttp:1.5.2")
    implementation("io.ktor:ktor-client-cio:1.5.2")
    implementation("io.ktor:ktor-client-json:1.5.2")
    implementation("io.ktor:ktor-client-gson:1.5.2")
    implementation("io.ktor:ktor-client-serialization:1.5.2")
    implementation("com.google.code.gson:gson:2.8.5")

Resolves #34

Other Change

Bump ktor version from 1.3.2 to 1.5.2

Boyscout

Fix Server Controller documentation

Comment on lines 31 to 54
::: warning
If you have duplicates dependencies issues, you should either add those lines in your application `gradle.build file`

```groovy
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains'
compile.exclude group: 'org.jetbrains.kotlin'
}
```

Or you can use our jar dependencies less, and add those dependencies in your application:

```groovy
implementation("io.ktor:ktor-client-websockets:1.5.2")
implementation("io.ktor:ktor-client-okhttp:1.5.2")
implementation("io.ktor:ktor-client-cio:1.5.2")
implementation("io.ktor:ktor-client-json:1.5.2")
implementation("io.ktor:ktor-client-gson:1.5.2")
implementation("io.ktor:ktor-client-serialization:1.5.2")
implementation("com.google.code.gson:gson:2.8.5")
```

:::
Copy link
Contributor

@Shiranuit Shiranuit Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

::: warning
If you are using the sdk-jvm-X.Y.Z-with-dependencies.jar in a Kotlin Android Studio project, consider adding the following lines to your gradle.build file

configurations {
     cleanedAnnotations
     compile.exclude group: 'org.jetbrains'
     compile.exclude group: 'org.jetbrains.kotlin'
 }

:::

::: warning

If you are having troubles with duplicate dependencies in your project, consider using the sdk-jvm-X.Y.Z-without-dependencies.jar and add the following dependencies yourself without the ones that are causing the duplication error:

    implementation("io.ktor:ktor-client-websockets:1.5.2")
    implementation("io.ktor:ktor-client-okhttp:1.5.2")
    implementation("io.ktor:ktor-client-cio:1.5.2")
    implementation("io.ktor:ktor-client-json:1.5.2")
    implementation("io.ktor:ktor-client-gson:1.5.2")
    implementation("io.ktor:ktor-client-serialization:1.5.2")
    implementation("com.google.code.gson:gson:2.8.5")

:::

build.gradle.kts Outdated Show resolved Hide resolved
.ci/doc/test-snippet.sh Outdated Show resolved Hide resolved
.ci/doc/test-snippet.sh Outdated Show resolved Hide resolved
@Shiranuit
Copy link
Contributor

In the Readme you should also update the dependencies and explain the workaround with the config in the build.gradle for Kotlin Android Studio projects, and also when to use the sdk without dependencies

README.md Outdated Show resolved Hide resolved
doc/1/getting-started/kotlin/index.md Outdated Show resolved Hide resolved
@Yoann-Abbes
Copy link
Contributor Author

In the Readme you should also update the dependencies and explain the workaround with the config in the build.gradle for Kotlin Android Studio projects, and also when to use the sdk without dependencies

It's already done

@Yoann-Abbes Yoann-Abbes requested a review from Shiranuit March 4, 2021 09:26
Copy link
Contributor

@Shiranuit Shiranuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking, the readme doesn't support ::: warning

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Yoann-Abbes and others added 2 commits March 4, 2021 10:31
Co-authored-by: Shiranuit <[email protected]>
Co-authored-by: Shiranuit <[email protected]>
@Yoann-Abbes Yoann-Abbes requested a review from Shiranuit March 4, 2021 09:31
doc/1/getting-started/kotlin/index.md Outdated Show resolved Hide resolved
@Yoann-Abbes Yoann-Abbes requested a review from scottinet March 9, 2021 09:29
@scottinet
Copy link
Contributor

I removed the changelog:bug-fixes label: you shouldn't use 2 or more labels for PR, otherwise our release tools will make it appear in multiple sections.

@scottinet scottinet merged commit 580980d into 1-dev Mar 11, 2021
@scottinet scottinet deleted the create-thin-jar branch March 11, 2021 08:08
@Yoann-Abbes Yoann-Abbes mentioned this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding sdk-jvm to android gradle
3 participants