File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
src/commonMain/kotlin/com/algolia/search/configuration Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ kotlin {
3232 languageSettings.progressiveMode = true
3333 }
3434 val commonMain by getting {
35+ kotlin.srcDirs(" build/generated" )
3536 dependencies {
3637 implementation(kotlin(" stdlib-common" ))
3738 implementation(Serialization (" runtime" ))
@@ -145,6 +146,21 @@ bintray {
145146}
146147
147148tasks {
149+ this [" assemble" ].doFirst {
150+ val directory = File (" build/generated" ).apply {
151+ if (! exists()) mkdir()
152+ }
153+ val file = File (" ${directory.path} /Library.kt" ).apply {
154+ if (! exists()) createNewFile()
155+ }
156+
157+ file.bufferedWriter().use {
158+ it.write(" package com.algolia.search.build\n\n " )
159+ it.write(" object Library {\n\n " )
160+ it.write(" \t val version: String = \" ${Library .version} \"\n " )
161+ it.write(" }" )
162+ }
163+ }
148164 val bintrayUpload by getting(BintrayUploadTask ::class ) {
149165 dependsOn(publishToMavenLocal)
150166 doFirst {
Original file line number Diff line number Diff line change 11package com.algolia.search.configuration
22
3+ import com.algolia.search.build.Library
34import com.algolia.search.model.response.ResponseABTest
45import com.algolia.search.model.response.ResponseBatches
56import com.algolia.search.model.response.creation.CreationAPIKey
@@ -41,7 +42,7 @@ internal fun HttpClientConfig<*>.configure(configuration: Configuration) {
4142 logger = Logger .SIMPLE
4243 }
4344 install(UserAgent ) {
44- this .agent = " Algolia for Kotlin (1.0.0-beta02 )"
45+ this .agent = " Algolia for Kotlin (${ Library .version} )"
4546 }
4647 configuration.defaultHeaders?.let {
4748 install(DefaultRequest ) {
You can’t perform that action at this time.
0 commit comments