在Android应用程式的建立过程中执行指令码 [英] Running a script during build of android app

查看:60
本文介绍了在Android应用程式的建立过程中执行指令码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在想创建一个android应用程序时是否可以运行.jar程序或其他脚本,或者有人可以指导我举个例子.

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.

构建发行版时,我想对自己的strings.xml文件进行排序.

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

可能我忘了说我在使用gradle.

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

推荐答案

您可以定义自己的任务,类型为

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
}

这篇关于在Android应用程式的建立过程中执行指令码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆