@@ -70,10 +70,6 @@ kotlin {
7070 }
7171}
7272
73- val sourcesJar by tasks.creating(Jar ::class ) {
74- archiveClassifier.value(" sources" )
75- }
76-
7773val 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(" \t val 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(" \t val 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