0

戦争のコンパイルとパッケージ化を実行するgradle構成があります。

戦後に呼び出したいantスクリプトがありますenunciate.codehaus.org。antスクリプトは、戦争にバンドルされたjarファイルにアクセスする必要があります。

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が戦争をコンパイルするとき、jarファイル(依存関係であり、戦争にパッケージ化されている)は、参照できる場所に配置されますか?

依存関係または構成クラスの使用に関係していると思いますが、これをまとめることはできないようです。

4

1 に答える 1

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"/>

build.gradleでは、「enunciate.dependencies」をant.properties ['enunciate.dependencies']=configurations.runtime.asPathとして設定できます。

これがお役に立てば幸いです。

于 2013-01-25T23:57:50.783 に答える