K Roobroeck
K Roobroeck

Reputation: 1418

Running a script during build of android app

I wanted to now if it's possible to run a .jar program or another script when building an android application or if somebody could guide me to an example.

I would want to sort my strings.xml file when I build a release.

probably what I forgot to say that I'm using gradle.

Upvotes: 4

Views: 2065

Answers (2)

rciovati
rciovati

Reputation: 28063

You can define your own task of type Exec and make the assembleRelease task depends on it:

task executeScript(type:Exec) {
    println 'Executing script...'
    commandLine './script.sh'
}

gradle.projectsEvaluated {
    assembleRelease.dependsOn executeScript
}

Upvotes: 6

Field.wei
Field.wei

Reputation: 79

You can use ANT tools to build your application and use shell scripts to sort your strings.xml.

Upvotes: 0

Related Questions