Skip to content

Commit 5142438

Browse files
committed
Clean tasks
1 parent 6eb8746 commit 5142438

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

build.gradle.kts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ kotlin {
7070
}
7171
}
7272

73-
val sourcesJar by tasks.creating(Jar::class) {
74-
archiveClassifier.value("sources")
75-
}
76-
7773
val javadocJar by tasks.creating(Jar::class) {
7874
archiveClassifier.value("javadoc")
7975
}
@@ -125,7 +121,6 @@ bintray {
125121
user = System.getenv("BINTRAY_USER")
126122
key = System.getenv("BINTRAY_KEY")
127123
publish = true
128-
override = true
129124

130125
pkg.apply {
131126
desc = "Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries," +
@@ -145,22 +140,24 @@ bintray {
145140
}
146141
}
147142

148-
tasks {
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-
}
143+
val generate by tasks.registering {
144+
val directory = File("build/generated").apply {
145+
if (!exists()) mkdir()
146+
}
147+
val file = File("${directory.path}/Library.kt").apply {
148+
if (!exists()) createNewFile()
149+
}
156150

157-
file.bufferedWriter().use {
158-
it.write("package com.algolia.search.build\n\n")
159-
it.write("object Library {\n\n")
160-
it.write("\tval version: String = \"${Library.version}\"\n")
161-
it.write("}")
162-
}
151+
file.bufferedWriter().use {
152+
it.write("package com.algolia.search.build\n\n")
153+
it.write("object Library {\n\n")
154+
it.write("\tval version: String = \"${Library.version}\"\n")
155+
it.write("}")
163156
}
157+
}
158+
159+
tasks {
160+
this["assemble"].dependsOn(generate)
164161
val bintrayUpload by getting(BintrayUploadTask::class) {
165162
dependsOn(publishToMavenLocal)
166163
doFirst {

0 commit comments

Comments
 (0)