Created
April 7, 2020 01:51
-
-
Save jmarsican/17530944bb14ec7556c88fc94d0fe1c6 to your computer and use it in GitHub Desktop.
Gradle function to create a custom task to be executed upon other and copy the apk file in the desired location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task getDebugAppInDesktopFolder(dependsOn: 'assembleDebug') { | |
doLast { | |
def destination = "Put the desired path" | |
def desiredName = "Put the desired name" | |
ext.apk = file("build/outputs/apk/debug/app-debug.apk") | |
if (ext.apk.exists()) { | |
copy { | |
from ext.apk.absolutePath | |
into destination | |
rename { desiredName } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment