Skip to content

Commit

Permalink
Perfect bootstrap task (#575)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
  • Loading branch information
SUPERCILEX committed May 18, 2019
1 parent d12b69b commit a96d22d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class PlayPublisherPlugin : Plugin<Project> {
val playResourcesTask = project.newTask<GenerateResources>(
"generate${variantName}PlayResources",
constructorArgs = arrayOf(this)
)
) { mustRunAfter(bootstrapTask) }

val publishListingTask = project.newTask<PublishListing>(
"publish${variantName}Listing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ open class Bootstrap @Inject constructor(

@TaskAction
fun bootstrap() {
project.delete(srcDir)

val editId = getOrCreateEditId()

val executor = project.serviceOf<WorkerExecutor>()
Expand Down Expand Up @@ -158,9 +160,9 @@ open class Bootstrap @Inject constructor(
val imageDir = File(p.dir, p.type.dirName).safeMkdirs()

println("Downloading ${p.language} listing graphics for type '$typeName'")
for (image in images) {
for ((i, image) in images.withIndex()) {
executor.submit(ImageDownloader::class) {
params(ImageDownloader.Params(File(imageDir, "${image.id}.png"), image.url))
params(ImageDownloader.Params(File(imageDir, "${i + 1}.png"), image.url))
}
}
}
Expand Down

0 comments on commit a96d22d

Please sign in to comment.