小编Guy*_*ond的帖子

如何在命令行中执行Ant构建

我有一个Ant构建文件,我尝试使用以下命令在命令行中执行它:

$ C:\Program Files (x86)\.....>ant -f C:\Silk4J\Automation\iControlSilk4J\build.xml
Run Code Online (Sandbox Code Playgroud)

但没有任何反应,结果是:

BUILD SUCCESSFUL
Total time: 0 seconds
Run Code Online (Sandbox Code Playgroud)

我的环境变量是正确的.
问题是什么?这是我的构建文件:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="iControlSilk4J">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../../Program Files (x86)/Silk/SilkTest/eclipse"/>
    <property name="junit.output.dir" value="junit"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.6"/>
    <property …
Run Code Online (Sandbox Code Playgroud)

ant build deferred-execution

15
推荐指数
2
解决办法
13万
查看次数

蚂蚁执行命令

我使用Silk4J,在我的构建中,我必须启动代理。我使用的命令是:

<exec spawn="true" executable="${env.OPEN_AGENT_HOME}/agent/openAgent.exe" />
Run Code Online (Sandbox Code Playgroud)

它给我这个错误

The ' characters around the executable and arguments are not part of the command. 
Run Code Online (Sandbox Code Playgroud)

我需要更改吗?

ant exec

5
推荐指数
1
解决办法
9091
查看次数

ant多个目标执行

我的目标很少,我需要执行.我创建了一个目标,命名所有这些,但我认为这不是这样做的方法吗?以下是调用所有其他目标的目标运行:

<target name="test.all" depends="build
echolaunching agent /echo
antcall target="RunJtfTests" /
antcall target="launchOpenAgent" /
antcall target="run.test" //target
target name="run.test" depends="build, launchOpenAgent, runJtfTests"
echo Launching test/echo
echo message="${toString:iControlSilk4J.classpath}" /
  <java classname="com.miranda.icontrol.silk4j.installation.AdministrationCtrl"
classpath><fileset dir="${lib.dir}"
include name="**/*.jar" />
/fileset
pathelement path="${iControlSilk4J.classpath}" /
pathelement location="${jarPath}/Admin.jar" /
/classpath
  </java>
</target>
Run Code Online (Sandbox Code Playgroud)

它没有运行,我这样做是为了得到报告而我什么都没得到?怎么了 ?从我读到的,antcall就像一个不好的goto循环.我想打电话给测试.

- >以下是我想要执行的所有测试:

  • 在里面
  • 清洁
  • AdministrationCtrl.Rollback
  • AdministrationCtrl.LatestInstallation
  • AdministrationCtrl.BackupiControl,
  • AdministrationCtrl.ChangeService
  • AdministrationCtrl.DefaultSetting
  • AdministrationCtrl.InitFailOver
  • AdministrationCtrl.RunDensite2Service
  • AdministrationCtrl.RunDensiteService
  • AdministrationCtrl.RunGSMService
  • AdministrationCtrl.RunLoudnessAnalyzerService
  • AdministrationCtrl.RunLoudnessLoggerService
  • AdministrationCtrl.RunRouterManagerService
  • AdministrationCtrl.RunttyR0Service
  • AdministrationCtrl.RunVirtualService
  • AdministrationCtrl.RestoreBkp

但这可能更通用(关于我将在Silk4J中添加的测试).有没有办法更通用?

ant junit

0
推荐指数
1
解决办法
6162
查看次数

标签 统计

ant ×3

build ×1

deferred-execution ×1

exec ×1

junit ×1