android - Gradle skipping task X as it has no source files -
i have created gradle.build compiles android project. producing correct apks , post build step want copy them folder more meaningful name.
i have wrote task achieve this:
task copybundle(type: copy) { def versioncode = android.defaultconfig.versioncode def builddate = new date().format("yyyy-mm-dd't'hh-mm") def outputfile = 'hexpath-android-release-' + builddate + '-' + versioncode + '.apk' println "copying file " + outputfile from('hexpath-android/build/apk/') into('output/android/') include('hexpath-android-release.apk') rename ('hexpath-android-release.apk', outputfile) }
the problem having skips task saying "skipping task ':hexpath-android:copybundle' has no source files.
any ideas on doing wrong?
the folder correct , has several .apks. include filename correct. output folder not exist when script ran. rename valid filename.
you said folder has several apk files, here including 1 possible file, has named 'hexpath-android-release.apk'. have file there?
if want 1 file copied each time, i'd suggest rewriting end this:
from('hexpath-android/build/apk/hexpath-android-release.apk') { rename { outpufile } } into('output/android/')
but if want multiple files copied, revise 'include' segment have wildcards, , make maybe closure create output names. hope helps.
also, isn't hexpath-android project itself. shouldn't path start 'build...'?
Comments
Post a Comment