android


Android + gradle: injecting a task into build


I have a custom script which runs on the source (.java) and AndroidManifest.xml.
I'd like to execute this script as part of the gradle build process at the start of the assembleRelease task (maybe just after app:preBuild).
Any idea of how I can go about doing this?
I know I can do something like this to exec the script:
task DoStuff(type:Exec) {
workingDir 'path/to/script'
commandLine 'python3', 'do_stuff.py'
}
But I'm not sure where to put that, etc...
You can add a custom action to assembleRelease with doFirst method:
assembleRelease.doFirst {
//invoke python script but there's no access to `workingDir` or `commandLine`
//because it's an action not a task
}
or define dependency:
assembleRelease.dependsOn DoStuff
assembleRelease.mustRunAfter DoStuff //this might be redundant

Related Links

Google Drive Account Chooser Dialog won't cancel
Save some information in android's tag
Unable to start activity ComponentInfo InflateException
Android AsyncTask re-runs when activity is opened
Send Android TextToSpeech to just one stereo channel
How to unhyperlink links programmatically?
Android Application Distribution / Upgrade
Transitioning from Using Jar to Dependency for Ion
Parse Push Notification not working on REAL Device but working on Emulator
How can JSON be passed to AngularJS in Android webview?
How to hide tabhost on scroll top or down
Why my Android app targeted to distribute in one country is downloaded in several?
How we can make EditText with thick border(some color) and with white background in android?
Cannot set different images and text in a List view
opencv android: calling different methods after initialization
GSM location to coordinates

Categories

HOME
grok
microsoftgraph
paraview
pascal
fftw
gradient
tvos
python-multithreading
iis-6
retrofit2
32bit-64bit
jquery-ui-sortable
openpyxl
fhir
siddhi
mxgraph
rtf
openbugs
automatic-ref-counting
coin3d
glyphicons
null-pointer
aws-sdk
html5-appcache
soci
sse
libigl
r-mice
monit
xunit
pylons
jackson-modules
nstimer
8051
soot
sqlpackage
aws-codecommit
python-2.6
spring-security4
android-maps-extensions
carriage-return
slacktextviewcontroller
navigator
protege4
lint
railstutorial.org
demo
mongoose-schema
apache-stanbol
xv6
stringtokenizer
http-request
fclose
tf
x-ray
google-cse
pair-programming
stdmap
qtranslate
wpas
check-mk
quicktime
trigger.io
juice-ui
change-tracking
winusb
pacemaker
tinkerpop3
mongodb-php
jboss-tools
mapinfo
ng-grid
project-organization
qbxml
opl
opserver
extjs-grid
sony-lifelog-api
viola-jones
wso2greg
baasbox
avahi
snackbar
android-broadcast
mruby
ssis-data-flow
administration
iso-prolog
imagefilter
unix-socket
mintty
conditionaltagsupport
drupal-nodes
gtm-oauth2
embedded-fonts
ie8-compatibility-mode
away3d
jeromq
kogrid
ui-select2
joomla-template
nokia-s40
thttpd
fusefabric
cross-database
flex-mobile
matlab-load
strsep
django-paypal
objective-j
interprocess
pagemethods
lobo-cobra
visualj#
perl5.12
commercial-application

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App