从ant运行Gradle命令

时间:2019-01-30 13:20:41

标签: gradle grails ant

以下是我的build.xml(成功运行)的摘录

<property name="gradlew" value="./gradlew"/>

<target name="test-functional" description="run functional tests">
    <antcall target="init"/>
    <antcall target="compile"/>
    <echo>Running functional tests...</echo>
    <exec executable="${gradlew}" failonerror="true">
        <arg value="iT"/>
        <!-- <arg value="iT --tests com.mygrailsapp.geb.** -Dgeb.env=firefox -Dgrails.server.port.http=8090"/> -->

    </exec>
</target>

但是我只想使用一些附加选项来运行我的功能测试(在geb目录下),因此我在<exec>中的第二个选项中添加了注释(可以从命令行完美运行)。 但是从ant,我得到了以下内容;

 [exec] * What went wrong:
 [exec] Task 'iT --tests com.mygrailsapp.geb.**' not found in root project 'mygrailsapp'.

1 个答案:

答案 0 :(得分:2)

尝试一下:

Traceback (most recent call last):
##Removed a few lines of traceback. just django core code


  File "/home/esb/projects/ts2/esb-python/gerentesonhos/apps/API/base/urls.py", line 2, in <module>
    from .views import *
  File "/home/esb/projects/ts2/esb-python/gerentesonhos/apps/API/base/views.py", line 126, in <module>
    class MarcaList(generics.ListCreateAPIView):
  File "/home/esb/projects/ts2/esb-python/gerentesonhos/apps/API/base/views.py", line 175, in MarcaList
    for m in marcas:
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/models/query.py", line 272, in __iter__
    self._fetch_all()
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/models/query.py", line 1179, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1067, in execute_sql
    cursor.execute(sql, params)
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/backends/utils.py", line 68, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/esb/projects/ts2/esb-env/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column core_marca.eh_maiores_bancos does not exist
LINE 1: ..._emprestimo", "core_marca"."tipo_instituicao_id", "core_marc...