From 28e3f554ea6a7144416523fe48ce7adbb613b263 Mon Sep 17 00:00:00 2001 From: Lucaskyy Date: Thu, 16 Jun 2022 12:55:13 +0200 Subject: [PATCH] fix: broken gradle task --- build.gradle.kts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 697290f61..c0b48c902 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,18 +22,27 @@ dependencies { } tasks { - register("generateDex") { + register("generateDex") { description = "Generate dex files from build" dependsOn(build) - val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found") - val d8 = "${androidHome}/build-tools/32.0.0/d8" - val input = build.get().outputs.files.singleFile.absolutePath - val output = input.replace(".jar", ".dex") + doLast { + val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found") + val d8 = "${androidHome}/build-tools/32.0.0/d8" + val input = build.get().outputs.files.singleFile.absolutePath + val output = input.replace(".jar", ".dex") + val work = File("${buildDir}/libs") - workingDir = File("${buildDir}/libs") - commandLine = listOf(d8, input) - commandLine = listOf("mv", "*.dex", output) + exec { + workingDir = work + commandLine = listOf(d8, input) + } + + exec { + workingDir = work + commandLine = listOf("mv", "*.dex", output) + } + } } // Dummy task to fix the Gradle semantic-release plugin. // Remove this if you forked it to support building only.