Skip to content

Commit 00f88ad

Browse files
authored
Fixed gradle 'copyReleaseApks' task.| #3038 (#3039)
* Fixed gradle 'copyReleaseApks' task.| #3038 * Refactored code
1 parent 675813e commit 00f88ad

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

FlowCrypt/build.gradle.kts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,22 @@ tasks.register("renameReleaseBuilds") {
373373
}
374374

375375
tasks.register<Copy>("copyReleaseApks") {
376-
from("${layout.buildDirectory}") {
377-
include("**/*release*.apk")
378-
}
379-
380376
includeEmptyDirs = false
381-
into("${rootProject.rootDir}/release")
377+
378+
into(
379+
File(rootProject.rootDir, "release").apply {
380+
if (!exists() && !mkdirs()) {
381+
error("Can't create $name")
382+
}
383+
}
384+
)
385+
386+
with(
387+
copySpec {
388+
from(layout.buildDirectory)
389+
include("**/*release*.apk")
390+
}
391+
)
382392

383393
eachFile {
384394
//replace path to copy only apk file to the destination folder(without subdirectories)

0 commit comments

Comments
 (0)