2016-10-17 30 views
1

我有QtAppandroid我使用以下命令构建command line。它使用蚂蚁构建。非常棒。建立良好。运行良好。下面的核心命令创建&为我签名apk。如何使用ant命令行来选择我的自定义build.xml

ANT_OPTIONS=" -ant" 
Path/To/androiddeployqt --sign /Path/to/MyKey.keystore MyAlias --storepass MyPassword --output android --verbose --input /path/to/android-libMyQtApp.so-deployment-settings.json $ANT_OPTIONS 

接下来,我有几个版本的定制做了,我需要创建自己的build.xml &使蚂蚁挑我的自定义的build.xml。我阅读了以下描述使用-buildfile &的ant官方页面,指出您可以提及包含自定义build.xml的目录。 https://ant.apache.org/manual/running.html

由于我想用我的自定义的build.xml,我在我的项目目录中创建,我做在命令以下变化。

ANT_OPTIONS=" -ant -buildfile '/Directory/containing/my_build.xml'" 
Path/To/androiddeployqt --sign /Pathto/MyKey.keystore MyAlias --storepass MyPassword --output android --verbose --input /path/to/android-libMyQtApp.so-deployment-settings.json $ANT_OPTIONS 

但仍然蚂蚁拿起默认生成的build.xml。我的ANT_OPTIONS有什么问题? androiddeployqt不允许我传递额外的ant命令行选项吗?

或者,是否有可能创建一个ant.properties文件,使蚂蚁拿起我的自定义生成命令? 我只是想增加我的Android应用

回答

2

按照apache-ant documentation的版本号有可供选择的构建脚本三个选项,如果没有被默认名称(build.xml)。

-buildfile <file>  use given buildfile 
    -file <file>    '' 
    -f  <file>    '' 

而且你可以看到下面,上述所有版本的工作:

- bash $~/Documents/so$ ant -buildfile build-regex.xml 
Buildfile: /home/apps/Documents/so/build-regex.xml 

myTarget: 
    [echo] D:/MyFolder/abc/ 

BUILD SUCCESSFUL 
Total time: 0 seconds 
- bash $~/Documents/so$ ant -f build-regex.xml 
Buildfile: /home/apps/Documents/so/build-regex.xml 

myTarget: 
    [echo] D:/MyFolder/abc/ 

BUILD SUCCESSFUL 
Total time: 0 seconds 
- bash $~/Documents/so$ ant -file build-regex.xml 
Buildfile: /home/apps/Documents/so/build-regex.xml 

myTarget: 
    [echo] D:/MyFolder/abc/ 

BUILD SUCCESSFUL 
Total time: 0 seconds 

您试图选择-buildfile,这是奇怪的是没有工作。您可以尝试-f-file选项。

+0

你在尝试'ant -buildfile'命令statndalone吗?或者用'androiddeployqt'。在我的情况下,它是一个QtApp,我正在构建命令行,为此我使用了一个名为'androiddeployqt'的命令行工具。该工具有一个'-ant'选项。但它不接受'-buildfile'作为蚂蚁的额外参数 –

+0

如您所见,它是命令行'ant',没有'android'。尽管尝试过其他选择? – Rao

+1

感谢您的建议,直到尚未。命令行蚂蚁很好地独立工作。毫无疑问。我的问题在这里蚂蚁与'androiddeployqt'的组合给出了问题。 –

相关问题