Skip to content

Commit

Permalink
Merge pull request #373 from pengrad/kotlin-support
Browse files Browse the repository at this point in the history
Add Kotlin
  • Loading branch information
pengrad authored May 5, 2024
2 parents 4e28fdd + 272f360 commit 9465397
Show file tree
Hide file tree
Showing 37 changed files with 271 additions and 465 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
cache: 'gradle'

- name: Gradle PR Test
run: ./gradlew clean prTest
run: ./gradlew clean check -PprTest
21 changes: 11 additions & 10 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
plugins {
id "java-library"
id 'jacoco'
id "org.jetbrains.kotlin.jvm" version "1.9.22"
}
apply plugin: 'jacoco'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -10,6 +11,7 @@ dependencies {
api 'com.google.code.gson:gson:2.10.1'
api 'com.squareup.okhttp3:okhttp:4.12.0'
api 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

testImplementation 'junit:junit:4.13.1'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.13'
Expand Down Expand Up @@ -41,6 +43,14 @@ test {
if (project.hasProperty('excludeTests')) {
exclude project.property('excludeTests')
}
if (project.hasProperty('prTest')) {
// TODO move "functional" tests into specific dir and exclude it
exclude '**/Base64Test.class'
exclude '**/CheckTelegramAuthTest.class'
exclude '**/PaymentsTest.class'
exclude '**/TelegramBotTest.class'
exclude '**/UpdatesListenerTest.class'
}
}

tasks.withType(Test).configureEach {
Expand All @@ -49,13 +59,4 @@ tasks.withType(Test).configureEach {
}
}

tasks.register('prTest', Test) {
// TODO move "functional" tests into specific dir and exclude it
exclude '**/Base64Test.class'
exclude '**/CheckTelegramAuthTest.class'
exclude '**/PaymentsTest.class'
exclude '**/TelegramBotTest.class'
exclude '**/UpdatesListenerTest.class'
}

apply from: rootProject.file('gradle/gradle-publish-plugin.gradle')
103 changes: 0 additions & 103 deletions library/src/main/java/com/pengrad/telegrambot/model/Audio.java

This file was deleted.

17 changes: 17 additions & 0 deletions library/src/main/java/com/pengrad/telegrambot/model/Audio.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.pengrad.telegrambot.model

/**
* stas
* 8/5/15.
*/
data class Audio(
@get:JvmName("fileId") val fileId: String? = null,
@get:JvmName("fileUniqueId") val fileUniqueId: String? = null,
@get:JvmName("duration") val duration: Int? = null,
@get:JvmName("performer") val performer: String? = null,
@get:JvmName("title") val title: String? = null,
@get:JvmName("fileName") val fileName: String? = null,
@get:JvmName("mimeType") val mimeType: String? = null,
@get:JvmName("fileSize") val fileSize: Long? = null,
@get:JvmName("thumbnail") val thumbnail: PhotoSize? = null,
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

open class BotCommandScope(val type: String)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

class BotCommandScopeAllChatAdministrators : BotCommandScope(type = "all_chat_administrators")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

class BotCommandScopeAllGroupChats : BotCommandScope(type = "all_group_chats")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

class BotCommandScopeAllPrivateChats : BotCommandScope(type = "all_private_chats")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

class BotCommandScopeDefault : BotCommandScope(type = "default")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

class BotCommandsScopeChat(val chatId: Any) : BotCommandScope(type = "chat")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

class BotCommandsScopeChatAdministrators(val chatId: Any) : BotCommandScope(type = "chat_administrators")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.pengrad.telegrambot.model.botcommandscope

class BotCommandsScopeChatMember(val chatId: Any, val userId: Long) : BotCommandScope(type = "chat_member")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.pengrad.telegrambot.model.request

/**
* Stas Parshin
* 04 June 2019
*/
object CallbackGame


Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.pengrad.telegrambot.model.request;
package com.pengrad.telegrambot.model.request

/**
* stas
* 10/21/15.
*/
public enum ChatAction {
@Suppress("EnumEntryName")
enum class ChatAction {
typing,
upload_photo,
record_video,
Expand Down

This file was deleted.

Loading

0 comments on commit 9465397

Please sign in to comment.