Как добавить зависимости jar/war в набор файлов ant при использовании gradle?

У меня есть конфигурация gradle, которая выполняет мою компиляцию и упаковку войны.

У меня есть скрипт ant, который я хочу запустить после войны enunciate.codehaus.org. Сценарию муравья нужен доступ к банкам, которые были включены в войну.

Конфигурация Gradle:

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'

repositories {
    mavenCentral()
}

dependencies {
    compile "javax.ws.rs:jsr311-api:1.1.1"

    compile 'com.sun.jersey:jersey-server:1.16'
    compile 'com.sun.jersey:jersey-core:1.16'
    compile 'com.sun.jersey:jersey-client:1.16'
    compile 'com.sun.jersey:jersey-servlet:1.16'
    compile 'com.sun.jersey:jersey-json:1.16'

    testCompile "junit:junit-dep:4.10"
}

ant.importBuild 'ant-builds/enunciate/targets.xml'

часть файла enunciate ant:

<path id="enunciate.classpath">
    <!--this pulls in enunciate library files to be used to generate documentation -->
    <fileset dir="${enunciate.home}/lib">
        <include name="*.jar"/>
    </fileset>

    <!-- this pulls in some java framework libraries used to generate documentation -->
    <fileset dir="${java.home}">
        <include name="lib/tools.jar"/>
    </fileset>
</path>

Как я могу добавить зависимости войны в этот набор файлов? Когда gradle компилирует войну, помещаются ли банки (которые являются зависимостями, а затем упакованы в войну) куда-нибудь, на что я мог бы сослаться?

Я предполагаю, что это связано с использованием зависимостей или класса конфигурации, но, похоже, не могу объединить это.


person jayraynet    schedule 25.01.2013    source источник


Ответы (1)


Например, из сборки gradle вы можете установить свойства ant. путь к классам ant в следующей цели может быть установлен в сборке gralde.

<enunciate basedir="${enunciate.baseSourceDirectory}" configFile="enunciate.xml">
<include name="**/*.java"/>
<classpath refid="enunciate.classpath"/>
<classpath>
    <pathelement path="${enunciate.dependencies}"/>
</classpath>
<export artifactId="docs" destination="${enunciate.destinationDirectory}/some-icd.tar"/>

In build.gradle, "enunciate.dependencies" can be set as ant.properties['enunciate.dependencies']=configurations.runtime.asPath

Надеюсь, это поможет.

person Visu Patlolla    schedule 25.01.2013