diff --git a/README.md b/README.md index 0bb24a5..0abfc05 100644 --- a/README.md +++ b/README.md @@ -1,169 +1,7 @@ -# How to use +# TelegramBotAPI Libraries -That is a template for Kotlin Multiplatform Projects. How to use it: +This project was created due to neccessity of additional libraries over [tgbotapi](https://github.com/InsanusMokrassar/TelegramBotAPI). +Currently there are plans to create several libraries at the start of this project: -* Create your repository from this template -* Add `local.properties` file in case you plan to use `Android` target (you must set up location of SDK, it will not be tracked by `git` and it is correct behaviour). In the snippet below you may see approximate content of `local.properties` file: -```properties -## This file must *NOT* be checked into Version Control Systems, -# as it contains information specific to your local configuration. -# -# Location of the SDK. This is only used by Gradle. -# For customization when using a Version Control System, please read the -# header note. -sdk.dir=/your/path/to/android/sdk -``` -* Replace in a whole project `project_group` by your group -* Replace in a whole project `project_name` by your **ROOT** project name -* Update your subproject packages. It is not critical, but recommended especially in case you plan to publish your - library - -## Subprojects - -In this template there is only one subproject with name `lib`. You are always able to rename it, but remember that in -this case you must rename it in `settings.gradle` file. - -## Types of projects - -### `mppProjectWithSerialization` - -This type of preset have `JVM`, `JS` and `Android` targets and available using -`apply from: "$mppProjectWithSerializationPresetPath"`. Template for project with this preset looks like next snippet: - -```groovy -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" -} - -apply from: "$mppProjectWithSerializationPresetPath" - -// The code below is optional - -kotlin { - sourceSets { - commonMain { - dependencies { - // common dependencies - } - } - commonTest { - dependencies { - // common test dependencies - } - } - jvmMain { - dependencies { - // jvm dependencies - } - } - jvmTest { - dependencies { - // jvm test dependencies - } - } - jsMain { - dependencies { - // js dependencies - } - } - jsTest { - dependencies { - // js test dependencies - } - } - androidMain { - dependencies { - // android dependencies - } - } - androidTest { - dependencies { - // android test dependencies - } - } - } -} -``` - -### `mppJavaProject` - -This type of preset have only `JVM` target and available using `apply from: "$mppJavaProjectPresetPath"`. Template for -project with this preset looks like next snippet: - -```groovy -plugins { - id "org.jetbrains.kotlin.multiplatform" -} - -apply from: "$mppJavaProjectPresetPath" - -// The code below is optional - -kotlin { - sourceSets { - commonMain { - dependencies { - // common dependencies - } - } - commonTest { - dependencies { - // common test dependencies - } - } - jvmMain { - dependencies { - // jvm dependencies - } - } - jvmTest { - dependencies { - // jvm test dependencies - } - } - } -} -``` - -### `mppAndroidProject` - -This type of preset have only `Android` target and available using `apply from: "$mppAndroidProjectPresetPath"`. Template for -project with this preset looks like next snippet: - -```groovy -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "com.android.library" -} - -apply from: "$mppAndroidProjectPresetPath" - -// The code below is optional - -kotlin { - sourceSets { - commonMain { - dependencies { - // common dependencies - } - } - commonTest { - dependencies { - // common test dependencies - } - } - androidMain { - dependencies { - // android dependencies - } - } - androidTest { - dependencies { - // android test dependencies - } - } - } -} -``` +* Cache library for media (saving and autorefreshing of `fileId`) +* Cache library for admins (saving chat admins, autoupdate and refreshing by command (maybe)) diff --git a/lib/build.gradle b/cache/admins/build.gradle similarity index 100% rename from lib/build.gradle rename to cache/admins/build.gradle diff --git a/cache/admins/src/main/AndroidManifest.xml b/cache/admins/src/main/AndroidManifest.xml new file mode 100644 index 0000000..fe0367f --- /dev/null +++ b/cache/admins/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/cache/media/build.gradle b/cache/media/build.gradle new file mode 100644 index 0000000..8a22926 --- /dev/null +++ b/cache/media/build.gradle @@ -0,0 +1,8 @@ +plugins { + id "org.jetbrains.kotlin.multiplatform" + id "org.jetbrains.kotlin.plugin.serialization" + id "com.android.library" +} + +apply from: "$mppProjectWithSerializationPresetPath" + diff --git a/cache/media/src/main/AndroidManifest.xml b/cache/media/src/main/AndroidManifest.xml new file mode 100644 index 0000000..24d7792 --- /dev/null +++ b/cache/media/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/gradle.properties b/gradle.properties index 94549c5..dbb3cdb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,10 @@ android.enableJetifier=true kotlin_version=1.4.30 kotlin_serialisation_core_version=1.1.0 -# github_release_plugin_version=2.2.12 +github_release_plugin_version=2.2.12 + +tgbotapi_version=0.32.8 +micro_utils_version=0.4.26 # ANDROID @@ -27,6 +30,6 @@ dokka_version=1.4.20 # Project data -group=project_group +group=dev.inmo version=0.0.1 android_code_version=1 diff --git a/lib/src/commonMain/kotlin/project_group/Library.kt b/lib/src/commonMain/kotlin/project_group/Library.kt deleted file mode 100644 index 424d112..0000000 --- a/lib/src/commonMain/kotlin/project_group/Library.kt +++ /dev/null @@ -1,7 +0,0 @@ -package project_group - -class Library { - fun someLibraryMethod(): Boolean { - return true - } -} diff --git a/lib/src/commonTest/kotlin/project_group/LibraryTest.kt b/lib/src/commonTest/kotlin/project_group/LibraryTest.kt deleted file mode 100644 index 84b573a..0000000 --- a/lib/src/commonTest/kotlin/project_group/LibraryTest.kt +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This Kotlin source file was generated by the Gradle 'init' task. - */ -package project_group - -import kotlin.test.Test -import kotlin.test.assertTrue - -class LibraryTest { - @Test fun testSomeLibraryMethod() { - val classUnderTest = Library() - assertTrue(classUnderTest.someLibraryMethod(), "someLibraryMethod should return 'true'") - } -} diff --git a/lib/src/main/AndroidManifest.xml b/lib/src/main/AndroidManifest.xml deleted file mode 100644 index 03c9554..0000000 --- a/lib/src/main/AndroidManifest.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 7bb91d0..5754aa8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,8 @@ -rootProject.name = 'project_name' +rootProject.name = 'tgbotapi.libraries' String[] includes = [ - ":lib" + ":cache:admins", + ":cache:media" ]