日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > java >内容正文

java

Gradle 2.0 用户指南翻译——第二十三章. Java 插件

發(fā)布時(shí)間:2023/12/18 java 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Gradle 2.0 用户指南翻译——第二十三章. Java 插件 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
翻譯項(xiàng)目請(qǐng)關(guān)注Github上的地址:
https://github.com/msdx/gradledoc
本文翻譯所在分支:
https://github.com/msdx/gradledoc/tree/2.0 。
在線瀏覽地址:
http://gradledoc.qiniudn.com/2.0/userguide/userguide.html 。
另外,Android 手機(jī)用戶可通過(guò)我寫(xiě)的一個(gè)程序?yàn)g覽文檔,帶緩存功能的,目前0.6開(kāi)發(fā)中版本兼容 Android 2.3以上系統(tǒng),項(xiàng)目地址如下:
https://github.com/msdx/gradle-doc-apk
翻譯不易,轉(zhuǎn)載請(qǐng)注明本文在CSDN博客上的出處:
https://blog.csdn.net/maosidiaoxian/article/details/80140234

關(guān)于我對(duì)Gradle的翻譯,以Github上的項(xiàng)目及http://gradledoc.qiniudn.com 上的文檔為準(zhǔn)。如發(fā)現(xiàn)翻譯有誤的地方,將首先在以上兩個(gè)地方更新。因時(shí)間精力問(wèn)題,博客中發(fā)表的譯文基本不會(huì)同步修改。


第二十三章. Java 插件

Chapter?23.?The Java Plugin

Java 插件向項(xiàng)目添加 Java 編譯、測(cè)試和捆綁的功能。它是其他許多 Gradle 插件的基礎(chǔ)。?
The Java plugin adds Java compilation, testing and bundling capabilities to a project. It serves as the basis for many of the other Gradle plugins.

23.1. 用法

23.1.?Usage

要使用 Java 插件,請(qǐng)?jiān)跇?gòu)建腳本中加入以下內(nèi)容:
To use the Java plugin, include in your build script:

示例 23.1. 使用 Java 插件 - Example?23.1.?Using the Java plugin

build.gradle

apply plugin: 'java'

23.2 源集

23.2.?Source sets

Java 插件引入了一個(gè)源集的概念。源集只是一組源文件,它們被一起編譯和執(zhí)行。這些源文件可能包含 Java 源文件和資源文件,有些其他插件可以將 Groovy 和 Scala 源文件包含在源集中。一個(gè)源集有一個(gè)相關(guān)聯(lián)的編譯類路徑和運(yùn)行時(shí)類路徑。?
The Java plugin introduces the concept of a?source set. A source set is simply a group of source files which are compiled and executed together. These source files may include Java source files and resource files. Other plugins add the ability to include Groovy and Scala source files in a source set. A source set has an associated compile classpath, and runtime classpath.

源集的一個(gè)用途是,將源文件進(jìn)行邏輯上的分組,以描述它們的目的。例如,你可以使用一個(gè)源集來(lái)定義一個(gè)集成測(cè)試套件,也可以使用單獨(dú)的源集來(lái)定義項(xiàng)目的 API 和實(shí)現(xiàn)類。?
One use for source sets is to group source files into logical groups which describe their purpose. For example, you might use a source set to define an integration test suite, or you might use separate source sets to define the API and implementation classes of your project.

Java 插件定義了兩個(gè)標(biāo)準(zhǔn)源集,分別是?main?和?test。main?源集包含生產(chǎn)源代碼,將其編譯并組裝到 JAR 文件中。test?源集則包含了單元測(cè)試源代碼,它們將被編譯并使用 JUnit 或 TestNG 來(lái)執(zhí)行。?
The Java plugin defines two standard source sets, called?main?and?test. The?main?source set contains your production source code, which is compiled and assembled into a JAR file. The?test?source set contains your unit test source code, which is compiled and executed using JUnit or TestNG.

23.3. 任務(wù)

23.3.?Tasks

Java 插件向你的項(xiàng)目添加了大量的任務(wù),如下所示。
The Java plugin adds a number of tasks to your project, as shown below.

表 23.1. Java 插件——任務(wù) - Table?23.1.?Java plugin - tasks

任務(wù)名稱
Task name
依賴于
Depends on
類型
Type
描述
Description
CompileJava所有產(chǎn)生編譯類路徑的任務(wù),也包括了?jar?任務(wù),因?yàn)轫?xiàng)目依賴被包含在?compile?配置中。?
All tasks which produce the compile classpath. This includes the?jar?task for project dependencies included in the?compile?configuration.
JavaCompile使用 javac 編譯 Java 生產(chǎn)源文件。
Compiles production Java source files using javac.
processResources-Copy把生產(chǎn)資源文件復(fù)制到生產(chǎn)類目錄中。
Copies production resources into the production classes directory.
classescompileJava?和?processResources。有些插件會(huì)添加其他的編譯任務(wù)。?
compileJava?and?processResources. Some plugins add additional compilation tasks.
Task組裝生產(chǎn)類目錄。
Assembles the production classes directory.
compileTestJavacompile?任務(wù),以及所有能產(chǎn)生測(cè)試編譯類路徑的任務(wù)。?
compile, plus all tasks which produce the test compile classpath.
JavaCompile使用 javac 編譯 Java 測(cè)試源文件。
Compiles test Java source files using javac.
processTestResources-Copy把測(cè)試資源文件拷貝到測(cè)試類目錄中。
Copies test resources into the test classes directory.
testClassescompileTestJava?和?processTestResources。有些插件會(huì)添加其他的測(cè)試編譯任務(wù)。?
compileTestJava?and?processTestResources. Some plugins add additional test compilation tasks.
Task組裝測(cè)試類目錄。
Assembles the test classes directory.
jarcompileJar組裝 JAR 文件
Assembles the JAR file
javadoccompileJavadoc使用 Javadoc 生成生產(chǎn)的 Java 源代碼的API文檔?
Generates API documentation for the production Java source, using Javadoc
testcompile,?compileTest,以及所有產(chǎn)生測(cè)試運(yùn)行時(shí)類路徑的任務(wù)。?
compile,?compileTest, plus all tasks which produce the test runtime classpath.
Test使用 JUnit 或 TestNG 運(yùn)行單元測(cè)試。
Runs the unit tests using JUnit or TestNG.
uploadArchives產(chǎn)生在?archives?中所配置的工件的任務(wù),包括?jar。?
The tasks which produce the artifacts in the?archives?configuration, including?jar.
Upload上傳在?archives?中所配置的工件,包括 JAR 文件。
Uploads the artifacts in the?archives?configuration, including the JAR file.
clean-Delete刪除項(xiàng)目的構(gòu)建目錄。
Deletes the project build directory.
cleanTaskName-Delete刪除指定任務(wù)生成的輸出文件。例如?cleanJar?將刪除由該?jar?任務(wù)創(chuàng)建的 JAR 文件,而?cleanTest?將刪除由該?test?任務(wù)創(chuàng)建的測(cè)試結(jié)果。?
Deletes the output files produced by the specified task. For example?cleanJar?will delete the JAR file created by the?jar?task, and?cleanTest?will delete the test results created by the?test?task.

對(duì)于你添加到項(xiàng)目中的每一個(gè)源集,Java 插件將添加以下的編譯任務(wù):
For each source set you add to the project, the Java plugin adds the following compilation tasks:

表 23.2. Java 插件——源集任務(wù) - Table?23.2.?Java plugin - source set tasks

任務(wù)名稱
Task name
依賴于
Depends on
類型
Type
描述
Description
compileSourceSetJava所有產(chǎn)生源集編譯類路徑的任務(wù)。?
All tasks which produce the source set's compile classpath.
JavaCompile使用 javac 編譯給定的源集中的 Java 源文件。
Compiles the given source set's Java source files using javac.
processSourceSetResources-Copy將給定源集的資源文件復(fù)制到類目錄中。
Copies the given source set's resources into the classes directory.
sourceSetClassescompileSourceSetJava?和?processSourceSetResources。有些插件還為源集添加了其他的編譯任務(wù)。?
compileSourceSetJava?and?processSourceSetResources. Some plugins add additional compilation tasks for the source set.
Task組裝給定源集的類目錄。
Assembles the given source set's classes directory.

Java 插件還增加了大量構(gòu)成項(xiàng)目生命周期的任務(wù):
The Java plugin also adds a number of tasks which form a lifecycle for the project:

表 23.3. Java 插件——生命周期任務(wù) - Table?23.3.?Java plugin - lifecycle tasks

任務(wù)名稱
Task name
依賴于
Depends on
類型
Type
描述
Description
assemble項(xiàng)目中的所有歸檔任務(wù),包括?jar。有些插件會(huì)向項(xiàng)目添加另外的歸檔任務(wù)。?
All archive tasks in the project, including?jar. Some plugins add additional archive tasks to the project.
Task組裝項(xiàng)目中所有的歸檔文件。
Assembles all the archives in the project.
check項(xiàng)目中的所有驗(yàn)證任務(wù),包括?test。有些插件會(huì)向項(xiàng)目添加另外的驗(yàn)證任務(wù)。?
All verification tasks in the project, including?test. Some plugins add additional verification tasks to the project.
Task執(zhí)行項(xiàng)目中所有的驗(yàn)證任務(wù)。
Performs all verification tasks in the project.
buildcheck?和?assemble?
check?and?assemble
Task執(zhí)行完整的項(xiàng)目構(gòu)建。
Performs a full build of the project.
buildNeededbuild?任務(wù),以及在?testRuntime?配置的所有項(xiàng)目庫(kù)依賴項(xiàng)的?build?任務(wù)。?
build?and?build?tasks in all project lib dependencies of the?testRuntimeconfiguration.
Task執(zhí)行項(xiàng)目本身及它所依賴的其他所有項(xiàng)目的完整構(gòu)建。
Performs a full build of the project and all projects it depends on.
buildDependentsbuild?任務(wù),以及在?testRuntime?配置中對(duì)此項(xiàng)目有庫(kù)依賴的所有項(xiàng)目的?build?任務(wù)。?
build?and?build?tasks in all projects with a project lib dependency on this project in a?testRuntime?configuration.
Task執(zhí)行項(xiàng)目本身及依賴它的其他所有項(xiàng)目的完整構(gòu)建。
Performs a full build of the project and all projects which depend on it.
buildConfigurationName生成?ConfigurationName?配置里的工件的任務(wù)。?
The tasks which produce the artifacts in configuration?ConfigurationName.
Task組裝指定配置的工件。該任務(wù)由 Base 插件添加,并由 Java 插件隱式應(yīng)用。?
Assembles the artifacts in the specified configuration. The task is added by the Base plugin which is implicitly applied by the Java plugin.
uploadConfigurationName上傳?ConfigurationName?配置中的工件的任務(wù)。?
The tasks which uploads the artifacts in configuration?ConfigurationName.
Upload以指定的配置組裝并上傳工件。該任務(wù)由 Base 插件添加,并由 Java 插件隱式應(yīng)用。?
Assembles and uploads the artifacts in the specified configuration. The task is added by the Base plugin which is implicitly applied by the Java plugin.

下圖顯示了這些任務(wù)之間的關(guān)系。
The following diagram shows the relationships between these tasks.

圖 23.1. Java 插件——任務(wù) - Figure?23.1.?Java plugin - tasks

23.4. 項(xiàng)目布局

23.4.?Project layout

Java 插件會(huì)假定如下所示的項(xiàng)目布局。這些目錄都不需要一定的存在在,或是里面有什么內(nèi)容。 Java插件不管發(fā)現(xiàn)什么都將會(huì)進(jìn)行編譯,并處理缺失的任何內(nèi)容。?
The Java plugin assumes the project layout shown below. None of these directories need exist or have anything in them. The Java plugin will compile whatever it finds, and handles anything which is missing.

表 23.4. Java 插件——默認(rèn)項(xiàng)目布局 - Table?23.4.?Java plugin - default project layout

目錄
Directory
意義
Meaning
src/main/javaJava 生產(chǎn)源代碼
Production Java source
src/main/resources生產(chǎn)資源
Production resources
src/test/javaJava 測(cè)試源代碼
Test Java source
src/test/resources測(cè)試資源
Test resources
src/sourceSet/java給定源集的 Java 源代碼
Java source for the given source set
src/sourceSet/resources給定源集的資源
Resources for the given source set

23.4.1. 更改項(xiàng)目布局

23.4.1.?Changing the project layout

你可以通過(guò)配置適當(dāng)?shù)脑醇瘉?lái)配置項(xiàng)目的布局,這點(diǎn)將在下面的章節(jié)中詳細(xì)討論。以下是一個(gè)簡(jiǎn)單的例子,展示如何改變 main Java 和資源源目錄。?
You configure the project layout by configuring the appropriate source set. This is discussed in more detail in the following sections. Here is a brief example which changes the main Java and resource source directories.

示例 23.2. 自定義 Java 源代碼布局 - Example?23.2.?Custom Java source layout

build.gradle

sourceSets {main {java {srcDir 'src/java'}resources {srcDir 'src/resources'}} }

23.5. 依賴管理

23.5.?Dependency management

Java 插件向項(xiàng)目添加了一些依賴配置,如下表所示。它將這些配置指定一些任務(wù),如?compileJava?和?test。?
The Java plugin adds a number of dependency configurations to your project, as shown below. It assigns those configurations to tasks such as?compileJava?and?test.

表23.5. Java插件 ??- 依賴配置 - Table?23.5.?Java plugin - dependency configurations

名稱
Name
繼承自
Extends
在哪些任務(wù)中使用
Used by tasks
意義
Meaning
compile-CompileJava編譯時(shí)依賴
Compile time dependencies
runtimecompile-運(yùn)行時(shí)依賴
Runtime dependencies
testCompilecompilecompileTestJava用于編譯測(cè)試代碼的其他依賴
Additional dependencies for compiling tests.
testRuntimeruntime, testCompiletest只用于運(yùn)行測(cè)試的其他依賴
Additional dependencies for running tests only.
archives-uploadArchives由本項(xiàng)目產(chǎn)生的工件(如 jar 包)。
Artifacts (e.g. jars) produced by this project.
defaultruntime-依賴于本項(xiàng)目的另一個(gè)項(xiàng)目所使用的默認(rèn)配置。包含此項(xiàng)目運(yùn)行時(shí)所需的工件和依賴。?
The default configuration used by a project dependency on this project. Contains the artifacts and dependencies required by this project at runtime.

圖 23.2. Java 插件——依賴配置 - Figure?23.2.?Java plugin - dependency configurations

對(duì)于你添加到項(xiàng)目中的每個(gè)源集,Java 插件都會(huì)添加以下的依賴配置:
For each source set you add to the project, the Java plugins adds the following dependency configurations:

表 23.6. Java 插件——源集依賴配置 - Table?23.6.?Java plugin - source set dependency configurations

名稱
Name
繼承自
Extends
在哪些任務(wù)中使用
Used by tasks
意義
Meaning
sourceSetCompile-compileSourceSetJava給定源集的編譯時(shí)依賴
Compile time dependencies for the given source set
sourceSetRuntimesourceSetCompile-給定源集的運(yùn)行時(shí)依賴
Runtime time dependencies for the given source set

23.6. 約定屬性

23.6.?Convention properties

Java 插件向項(xiàng)目添加了許多約定屬性,如下表所示。你可以在構(gòu)建腳本中使用這些屬性,就像它們是 project 對(duì)象里的屬性一樣(見(jiàn)《第 21.3 節(jié),“約定”》)。?
The Java plugin adds a number of convention properties to the project, shown below. You can use these properties in your build script as though they were properties of the project object (see?Section?21.3, “Conventions”).

表 23.7. Java 插件——目錄屬性 - Table?23.7.?Java plugin - directory properties

屬性名稱
Property name
類型
Type
默認(rèn)值
Default value
描述
Description
reportsDirNameStringreports相對(duì)于構(gòu)建目錄,生成報(bào)告的目錄的名稱。?
The name of the directory to generate reports into, relative to the build directory.
reportsDirFile?(只讀)?
File?(read-only)
buildDir/reportsDirName要生成報(bào)告的目錄。?
The directory to generate reports into.
testResultsDirNameStringtest-results相對(duì)于構(gòu)建目錄,生成測(cè)試結(jié)果.xml 文件的目錄名稱。?
The name of the directory to generate test result .xml files into, relative to the build directory.
testResultsDirFile?(只讀)?
File?(read-only)
buildDir/testResultsDirName生成測(cè)試結(jié)果.xml 文件的目錄。?
The directory to generate test result .xml files into.
testReportDirNameStringtests相對(duì)于報(bào)告目錄,生成測(cè)試報(bào)告的目錄的名稱。?
The name of the directory to generate the test report into, relative to the reports directory.
testReportDirFile?(只讀)?
File?(read-only)
reportsDir/testReportDirName生成測(cè)試報(bào)告的目錄。?
The directory to generate the test report into.
libsDirNameStringlibs相對(duì)于構(gòu)建目錄,生成庫(kù)的目錄的名稱。?
The name of the directory to generate libraries into, relative to the build directory.
libsDirFile?(只讀)?
File?(read-only)
buildDir/libsDirName要生成庫(kù)的目錄。?
The directory to generate libraries into.
distsDirNameStringdistributions相對(duì)于構(gòu)建目錄的目錄名稱,該目錄用于生成分發(fā)的文件。?
The name of the directory to generate distributions into, relative to the build directory.
distsDirFile?(只讀)?
File?(read-only)
buildDir/distsDirName生成分發(fā)文件的目錄。?
The directory to generate distributions into.
docsDirNameStringdocs相對(duì)于構(gòu)建目錄的目錄名稱,該目錄用于生成文檔。?
The name of the directory to generate documentation into, relative to the build directory.
docsDirFile?(只讀)?
File?(read-only)
buildDir/docsDirName用于生成文檔的目錄。?
The directory to generate documentation into.
dependencyCacheDirNameStringdependency-cache相對(duì)于構(gòu)建目錄的目錄名稱,該目錄用于緩存源代碼的依賴信息。?
The name of the directory to use to cache source dependency information, relative to the build directory.
dependencyCacheDirFile?(只讀)?
File?(read-only)
buildDir/dependencyCacheDirName用于緩存源代碼的依賴信息的目錄。?
The directory to use to cache source dependency information.

表 23.8. Java 插件——其他屬性 - Table?23.8.?Java plugin - other properties

屬性名稱
Property name
類型
Type
默認(rèn)值
Default value
描述
Description
sourceSetsSourceSetContainer?(只讀)
SourceSetContainer?(read-only)
不為 null
Not null
包含項(xiàng)目的源集。
Contains the project's source sets.
sourceCompatibilityJavaVersion。也可以使用字符串或數(shù)字來(lái)設(shè)置,如?'1.5'?或?1.5。?
JavaVersion. Can also set using a String or a Number, e.g.?'1.5'?or?1.5.
當(dāng)前所使用的 JVM 的值
Value of the current used JVM
當(dāng)編譯 Java 源代碼時(shí)所使用的 Java 版本兼容性。
Java version compatibility to use when compiling Java source.
targetCompatibilityJavaVersion。也可以使用字符串或數(shù)字來(lái)設(shè)置,如?'1.5'?或?1.5。?
JavaVersion. Can also set using a String or Number, e.g.?'1.5'?or?1.5.
sourceCompatibility要生成的類的 Java 版本。
Java version to generate classes for.
archivesBaseNameStringprojectName像 JAR 或 ZIP 文件這樣的工件的基本名稱。
The basename to use for archives, such as JAR or ZIP files.
manifestManifest一個(gè)空的清單
an empty manifest
包含在所有 JAR 文件中的清單。
The manifest to include in all JAR files.

這些屬性由?JavaPluginConvention?和BasePluginConvention?這些類型的約定對(duì)象提供。?
These properties are provided by convention objects of type?JavaPluginConvention, and?BasePluginConvention.

23.7.?使用源集

23.7.?Working with source sets

你可以使用?sourceSets?屬性訪問(wèn)項(xiàng)目的源集。這是項(xiàng)目源集的容器,它的類型是?SourceSetContainer。除此之外,還有一個(gè)?sourceSets{}?腳本塊,可以傳入一個(gè)閉包來(lái)配置源集容器。源集容器的使用方式與其他的容器幾乎一樣,例如?tasks。?
You can access the source sets of a project using the?sourceSets?property. This is a container for the project's source sets, of type?SourceSetContainer. There is also a?sourceSets { }?script block, which you can pass a closure to configure the source set container. The source set container works pretty much the same way as other containers, such as?tasks.

示例 23.3. 訪問(wèn)源集 - Example?23.3.?Accessing a source set

build.gradle

// Various ways to access the main source set println sourceSets.main.output.classesDir println sourceSets['main'].output.classesDir sourceSets {println main.output.classesDir } sourceSets {main {println output.classesDir} }// Iterate over the source sets sourceSets.all {println name }

要配置一個(gè)現(xiàn)有的源集,你只需要使用上面的其中一種訪問(wèn)方法來(lái)設(shè)置源集的屬性。這些屬性將在下文中進(jìn)行介紹。以下是配置main 的 Java 和資源目錄的示例:
To configure an existing source set, you simply use one of the above access methods to set the properties of the source set. The properties are described below. Here is an example which configures the main Java and resources directories:

示例 23.4. 配置源集的源代碼目錄 - Example?23.4.?Configuring the source directories of a source set

build.gradle

sourceSets {main {java {srcDir 'src/java'}resources {srcDir 'src/resources'}} }

23.7.1. 源集屬性

23.7.1.?Source set properties

下表列出了一些重要的源集屬性。你可以在 API 文檔中找到更多有關(guān)?SourceSet?的詳細(xì)信息。?
The following table lists some of the important properties of a source set. You can find more details in the API documentation for?SourceSet.

表 23.9. Java 插件——源集屬性 - Table?23.9.?Java plugin - source set properties

屬性名稱
Property name
類型
Type
默認(rèn)值
Default value
描述
Description
nameString?(只讀)?
String?(read-only)
不為 null?
Not null
用來(lái)確定一個(gè)源集的源集名稱。?
The name of the source set, used to identify it.
outputSourceSetOutput?(只讀)?
SourceSetOutput?(read-only)
不為 null?
Not null
源集的輸出文件,包含其編譯過(guò)的類和資源。?
The output files of the source set, containing its compiled classes and resources.
output.classesDirFilebuildDir/classes/name生成該源集的類的目錄。?
The directory to generate the classes of this source set into.
output.resourcesDirFilebuildDir/resources/name生成該源集的資源的目錄。?
The directory to generate the resources of this source set into.
compileClasspathFileCollectioncompileSourceSet?配置。?
compileSourceSet?configuration.
編譯該源集的源文件時(shí)使用的類路徑。?
The classpath to use when compiling the source files of this source set.
runtimeClasspathFileCollectionoutput?+?runtimeSourceSet?配置。?
output?+?runtimeSourceSetconfiguration.
執(zhí)行此源集的類時(shí)使用的類路徑。?
The classpath to use when executing the classes of this source set.
javaSourceDirectorySet?(只讀)?
SourceDirectorySet?(read-only)
不為 null?
Not null
此源集的 Java 源文件。僅包含 Java 源目錄中找到的?.java?文件,并排除所有其他文件。?
The Java source files of this source set. Contains only?.java?files found in the Java source directories, and excludes all other files.
java.srcDirsSet<File>??梢允褂谩兜?16.5 節(jié),“指定一組輸入文件”》中所講到的任何一種方法來(lái)設(shè)置。?
Set<File>. Can set using anything described in?Section?16.5, “Specifying a set of input files”.
[projectDir/src/name/java]該源目錄包含了此源集的所有 Java 源文件。?
The source directories containing the Java source files of this source set.
resourcesSourceDirectorySet?(只讀)?
SourceDirectorySet?(read-only)
不為 null?
Not null
此源集的資源。僅包含資源,并且排除在資源源目錄中找到的所有?.java?文件。其他插件(如 Groovy 插件)會(huì)從此集合中排除其他類型的文件。?
The resources of this source set. Contains only resources, and excludes any?.java?files found in the resource source directories. Other plugins, such as the Groovy plugin, exclude additional types of files from this collection.
resources.srcDirsSet<File>。可以使用《第 16.5 節(jié),“指定一組輸入文件”》中所講到的任何一種方法來(lái)設(shè)置。?
Set<File>. Can set using anything described in?Section?16.5, “Specifying a set of input files”.
[projectDir/src/name/resources]包含此源集資源的源目錄。?
The source directories containing the resources of this source set.
allJavaSourceDirectorySet?(只讀)?
SourceDirectorySet?(read-only)
java該源集的所有?.java?文件。有些插件,如Groovy 插件,會(huì)將其他 Java 源文件添加到此集合中。?
All?.java?files of this source set. Some plugins, such as the Groovy plugin, add additional Java source files to this collection.
allSourceSourceDirectorySet?(只讀)?
SourceDirectorySet?(read-only)
resources + java該源集的所有源文件,包括所有資源文件和 Java 源文件。有些插件(如 Groovy 插件)會(huì)將其他源文件添加到此集合中。?
All source files of this source set. This include all resource files and all Java source files. Some plugins, such as the Groovy plugin, add additional source files to this collection.

23.7.2. 定義新的源集

23.7.2.?Defining new source sets

要定義一個(gè)新的源集,你只需在?sourceSets {}?塊引用它。示例如下:?
To define a new source set, you simply reference it in the?sourceSets { }?block. Here's an example:

示例 23.5. 定義一個(gè)源集 - Example?23.5.?Defining a source set

build.gradle

sourceSets {intTest }

當(dāng)你定義一個(gè)新的源集時(shí),Java 插件會(huì)為該源集添加一些依賴配置,如表 23.6,“Java 插件——源集依賴性配置”所示。你可以使用這些配置來(lái)定義源集的編譯和運(yùn)行時(shí)依賴。?
When you define a new source set, the Java plugin adds some dependency configurations for the source set, as shown in?Table?23.6, “Java plugin - source set dependency configurations”. You can use these configurations to define the compile and runtime dependencies of the source set.

示例 23.6. 定義源集依賴 - Example?23.6.?Defining source set dependencies

build.gradle

sourceSets {intTest }dependencies {intTestCompile 'junit:junit:4.11'intTestRuntime 'org.ow2.asm:asm-all:4.0' }

Java 插件還添加了大量的任務(wù)用于組裝源集的類,如表 23.2,“Java 插件——源集任務(wù)”所示。例如,對(duì)于一個(gè)名為?intTest?的源集,你可以通過(guò)運(yùn)行gradle intTestClasses來(lái)編譯 int 測(cè)試類。?
The Java plugin also adds a number of tasks which assemble the classes for the source set, as shown in?Table?23.2, “Java plugin - source set tasks”. For example, for a source set called?intTest, you can run?gradle intTestClasses?to compile the int test classes.

示例 23.7. 編譯源集 - Example?23.7.?Compiling a source set

gradle intTestClasses?的輸出結(jié)果
Output of?gradle intTestClasses

> gradle intTestClasses :compileIntTestJava :processIntTestResources :intTestClassesBUILD SUCCESSFULTotal time: 1 secs

23.7.3. 一些源集的范例

23.7.3.?Some source set examples

添加一個(gè)包含源集的類的 JAR 包
Adding a JAR containing the classes of a source set:

示例 23.8. 為一個(gè)源集組裝一個(gè) JAR 文件 - Example?23.8.?Assembling a JAR for a source set

build.gradle

task intTestJar(type: Jar) {from sourceSets.intTest.output }

為一個(gè)源集生成 Javadoc:
Generating Javadoc for a source set:

示例 23.9. 為一個(gè)源集生成 Javadoc: - Example?23.9.?Generating the Javadoc for a source set

build.gradle

task intTestJavadoc(type: Javadoc) {source sourceSets.intTest.allJava }

添加測(cè)試套件以運(yùn)行源集里的測(cè)試
Adding a test suite to run the tests in a source set:

示例 23.10. 運(yùn)行源集里的測(cè)試 - Example?23.10.?Running tests in a source set

build.gradle

task intTest(type: Test) {testClassesDir = sourceSets.intTest.output.classesDirclasspath = sourceSets.intTest.runtimeClasspath }

23.8. Javadoc

23.8.?Javadoc

Javadoc?任務(wù)是?Javadoc?的一個(gè)實(shí)例。它支持核心 javadoc 的參數(shù)選項(xiàng),以及在 Javadoc 可執(zhí)行文件的參考文檔中描述的標(biāo)準(zhǔn) doclet 參數(shù)選項(xiàng)。對(duì)于所支持的 Javadoc 參數(shù)選項(xiàng)的完整列表,請(qǐng)參考下面的類的 API 文檔:?CoreJavadocOptions?和?StandardJavadocDocletOptions。?
The?javadoc?task is an instance of?Javadoc. It supports the core javadoc options and the options of the standard doclet described in the?reference documentation?of the Javadoc executable. For a complete list of supported Javadoc options consult the API documentation of the following classes:?CoreJavadocOptions?and?StandardJavadocDocletOptions.

表 23.10. Java 插件—— Javadoc 屬性 - Table?23.10.?Java plugin - Javadoc properties

任務(wù)屬性
Task Property
類型
Type
默認(rèn)值
Default Value
classpathFileCollectionsourceSets.main.output + sourceSets.main.compileClasspath
sourceFileTree。可以使用《第 16.5 節(jié),“指定一組輸入文件”》中所講到的任何一種方法來(lái)設(shè)置。
FileTree. Can set using anything described in?Section?16.5, “Specifying a set of input files”.
sourceSets.main.allJava
destinationDirFiledocsDir/javadoc
titleString項(xiàng)目的名稱和版本
The name and version of the project

23.9.?Clean

23.9.?Clean

clean?任務(wù)是?Delete?的一個(gè)實(shí)例。它只是刪除由?dir?屬性表示的目錄。?
The?clean?task is an instance of?Delete. It simply removes the directory denoted by its?dir?property.

表 23.11. Java 插件—— Clean 屬性 - Table?23.11.?Java plugin - Clean properties

任務(wù)屬性
Task Property
類型
Type
默認(rèn)值
Default Value
dirFilebuildDir

23.10.?Resources

23.10.?Resources

Java 插件使用?Copy?任務(wù)進(jìn)行資源的處理,它為項(xiàng)目中的每個(gè)源集添加一個(gè)實(shí)例。你可以在《第 16.6 節(jié),“復(fù)制文件”》找到更多關(guān)于復(fù)制任務(wù)的信息。?
The Java plugin uses the?Copy?task for resource handling. It adds an instance for each source set in the project. You can find out more about the copy task in?Section?16.6, “Copying files”.

表 23.12. Java 插件—— ProcessResources 屬性 - Table?23.12.?Java plugin - ProcessResources properties

任務(wù)屬性
Task Property
類型
Type
默認(rèn)值
Default Value
srcDirsObject??梢允褂谩兜?16.5 節(jié),“指定一組輸入文件”》中所講到的任何一種方法來(lái)設(shè)置。
Object. Can set using anything described in?Section?16.5, “Specifying a set of input files”.
sourceSet.resources
destinationDirFile。可以使用《第 16.1 節(jié),“查找文件”》中所述的任何設(shè)置。
File. Can set using anything described in?Section?16.1, “Locating files”.
sourceSet.output.resourcesDir

23.11.?CompileJava

23.11.?CompileJava

Java 插件為項(xiàng)目里的每一個(gè)源集添加一個(gè)?JavaCompile?實(shí)例。一些最常見(jiàn)的配置選項(xiàng)如下所示。?
The Java plugin adds a?JavaCompile?instance for each source set in the project. Some of the most common configuration options are shown below.

表 23.13. Java 插件—— Compile 屬性 - Table?23.13.?Java plugin - Compile properties

任務(wù)屬性
Task Property
類型
Type
默認(rèn)值
Default Value
classpathFileCollectionsourceSet.compileClasspath
sourceFileTree??梢允褂谩兜?16.5 節(jié),“指定一組輸入文件”》中所講到的任何一種方法來(lái)設(shè)置。
FileTree. Can set using anything described in?Section?16.5, “Specifying a set of input files”.
sourceSet.java
destinationDirFile.sourceSet.output.classesDir

默認(rèn)情況下,Java 編譯器在 Gradle 進(jìn)程中運(yùn)行。將?options.fork?設(shè)置為?true?將使得在一個(gè)單獨(dú)的進(jìn)程中進(jìn)行編譯。在Ant javac 任務(wù)的情況中,意味著每個(gè)編譯任務(wù)都會(huì) fork 一個(gè)新進(jìn)程,這樣就會(huì)使編譯變慢。相反,Gradle 的直接編譯器集成(見(jiàn)上文)將盡可能地重用相同的編譯器進(jìn)程。在這兩種情況下,使用?options.forkOptions?指定的所有 fork 選項(xiàng)都將得到重視。?
By default, the Java compiler runs in the Gradle process. Setting?options.fork?to?true?causes compilation to occur in a separate process. In the case of the Ant javac task, this means that a new process will be forked for each compile task, which can slow down compilation. Conversely, Gradle's direct compiler integration (see above) will reuse the same compiler process as much as possible. In both cases, all fork options specified with?options.forkOptions?will be honored.

23.12.?Test

23.12.?Test

test?任務(wù)是?Test?的一個(gè)實(shí)例。它會(huì)自動(dòng)檢測(cè)并執(zhí)行?test?源集中的所有單元測(cè)試。測(cè)試執(zhí)行完成后,它還會(huì)生成一個(gè)報(bào)告。它同時(shí)支持 JUnit 和 TestNG,可以看一看?test?的完整 API。?
The?test?task is an instance of?Test. It automatically detects and executes all unit tests in the?test?source set. It also generates a report once test execution is complete. JUnit and TestNG are both supported. Have a look at?Testfor the complete API.

23.12.1. 測(cè)試執(zhí)行

23.12.1.?Test execution

測(cè)試在單獨(dú)的 JVM 進(jìn)程中執(zhí)行,與主構(gòu)建進(jìn)程隔離。Test?任務(wù)的 API 允許你對(duì)這種情況進(jìn)行一些控制。?
Tests are executed in a separate JVM, isolated from the main build process. The?Test?task's API allows you some control over how this happens.

有很多屬性可以控制測(cè)試進(jìn)程的啟動(dòng),包括系統(tǒng)屬性、JVM 參數(shù)以及要使用的Java 可執(zhí)行文件。?
There are a number of properties which control how the test process is launched. This includes things such as system properties, JVM arguments, and the Java executable to use.

你可以指定是否要并行執(zhí)行測(cè)試。Gradle 通過(guò)同時(shí)運(yùn)行多個(gè)測(cè)試進(jìn)程來(lái)提供并行測(cè)試的執(zhí)行。每個(gè)測(cè)試進(jìn)程一次只執(zhí)行一個(gè)測(cè)試,所以通常不需要為測(cè)試做任何特殊的配置就可以利用這一點(diǎn)。maxParallelForks?屬性指定了在給定的任何時(shí)間可以運(yùn)行的最大測(cè)試進(jìn)程數(shù)。默認(rèn)值為1,即不并行執(zhí)行測(cè)試。?
You can specify whether or not to execute your tests in parallel. Gradle provides parallel test execution by running multiple test processes concurrently. Each test process executes only a single test at a time, so you generally don't need to do anything special to your tests to take advantage of this. The?maxParallelForks?property specifies the maximum number of test processes to run at any given time. The default is 1, that is, do not execute the tests in parallel.

測(cè)試進(jìn)程程會(huì)將?org.gradle.test.worker?系統(tǒng)屬性設(shè)置為該測(cè)試進(jìn)程的一個(gè)唯一標(biāo)識(shí)符,這個(gè)標(biāo)識(shí)符可以用于文件名稱或其他資源標(biāo)識(shí)符。?
The test process sets the?org.gradle.test.worker?system property to a unique identifier for that test process, which you can use, for example, in files names or other resource identifiers.

你可以指定在執(zhí)行了一定數(shù)量的測(cè)試類之后,重新啟動(dòng)測(cè)試進(jìn)程。這是一個(gè)很有用的替代方案,可以讓你的測(cè)試進(jìn)程有非常大的堆內(nèi)存。forkEvery?屬性指定了要在測(cè)試進(jìn)程中執(zhí)行的最大測(cè)試類的數(shù)量。默認(rèn)是在每個(gè)測(cè)試進(jìn)程中執(zhí)行的測(cè)試數(shù)量不限。
You can specify that test processes should be restarted after it has executed a certain number of test classes. This can be a useful alternative to giving your test process a very large heap. The?forkEvery?property specifies the maximum number of test classes to execute in a test process. The default is to execute an unlimited number of tests in each test process.

該任務(wù)有一個(gè)?ignoreFailures?屬性,用于控制測(cè)試失敗時(shí)的行為。測(cè)試任務(wù)始終執(zhí)行它檢測(cè)到的每個(gè)測(cè)試,如果?ignoreFailures?值為 false,并且有測(cè)試不通過(guò),那它就會(huì)停止繼續(xù)構(gòu)建。ignoreFailures?的默認(rèn)值為 false。?
The task has an?ignoreFailures?property to control the behavior when tests fail. Test always executes every test that it detects. It stops the build afterwards if?ignoreFailures?is false and there are failing tests. The default value of?ignoreFailures?is false.

testLogging?屬性可以配置哪些測(cè)試事件需要記錄,并且使用什么樣的日志級(jí)別。默認(rèn)情況下,對(duì)于每個(gè)失敗的測(cè)試都只會(huì)打印一個(gè)簡(jiǎn)潔的消息。請(qǐng)參閱?TestLoggingContainer,查看如何把測(cè)試日志調(diào)整為你的偏好設(shè)置。?
The?testLogging?property allows to configure which test events are going to be logged and at which detail level. By default, a concise message will be logged for every failed test. See?TestLoggingContainer?for how to tune test logging to your preferences.

23.12.2.?調(diào)試

23.12.2.?Debugging

test 任務(wù)提供了一個(gè)?Test.getDebug()?屬性,可以設(shè)置為啟動(dòng),使 JVM 在執(zhí)行測(cè)試之前等待調(diào)試器連接到它的 5005 端口上。?
The test task provides a?Test.getDebug()?property that can be set to launch to make the JVM wait for a debugger to attach to port 5005 before proceeding with test execution.

這也可以在調(diào)用時(shí)通過(guò)?--debug-vm?任務(wù)選項(xiàng)進(jìn)行啟用。?
This can also be enabled at invocation time via the?--debug-jvm?task option.

23.12.3. 測(cè)試過(guò)濾

23.12.3.?Test filtering

從 Gradle 1.10 開(kāi)始,可以基于測(cè)試名稱模式,只包含特定測(cè)試。過(guò)濾是與測(cè)試類包含或排除所不同的一種機(jī)制,接下來(lái)的段落中將會(huì)對(duì)其詳細(xì)介紹(-Dtest.single,?test.include?和其他相關(guān)的)。后者基于文件,例如測(cè)試實(shí)現(xiàn)類的物理位置。文件級(jí)測(cè)試選擇不支持的許多有趣的場(chǎng)景,都可以用測(cè)試級(jí)過(guò)濾來(lái)實(shí)現(xiàn)。其中一些 Gradle 現(xiàn)在就可以處理,而有一些將在未來(lái)的版本中得到實(shí)現(xiàn):?
Starting with Gradle 1.10, it is possible to include only specific tests, based on the test name pattern. Filtering is a different mechanism than test class inclusion / exclusion that will be described in the next few paragraphs (-Dtest.single,?test.include?and friends). The latter is based on files, e.g. the physical location of the test implementation class. File-level test selection does not support many interesting scenarios that are possible with test-level filtering. Some of them Gradle handles now and some will be satisfied in the future releases:

  • 在指定的測(cè)試方法級(jí)別上過(guò)濾;執(zhí)行單個(gè)測(cè)試方法
    Filtering at the level of specific test methods; executing a single test method
  • 基于自定義注解進(jìn)行過(guò)濾(以后實(shí)現(xiàn))
    Filtering based on custom annotations (future)
  • 基于測(cè)試層次結(jié)構(gòu)進(jìn)行過(guò)濾;執(zhí)行所有繼承了某一基類的測(cè)試(以后實(shí)現(xiàn))
    Filtering based on test hierarchy; executing all tests that extend ceratain base class (future)
  • 基于一些自定義的運(yùn)行時(shí)規(guī)則進(jìn)行過(guò)濾,例如某個(gè)系統(tǒng)屬性或一些靜態(tài)的特定值(以后實(shí)現(xiàn))
    Filtering based on some custom runtime rule, e.g. particular value of a system property or some static state (future)

測(cè)試過(guò)濾功能具有以下的特征:?
Test filtering feature has following characteristic:

  • 支持完整的限定類名稱或完整的限定方法名稱,例如“org.gradle.SomeTest”、“org.gradle.SomeTest.someMethod”
    Fully qualified class name or fully qualified method name is supported, e.g. "org.gradle.SomeTest", "org.gradle.SomeTest.someMethod"
  • 通配符 “*” 支持匹配任何字符
    Wildcard '*' is supported for matching any characters
  • 提供了“--tests”命令行選項(xiàng),以方便設(shè)置測(cè)試過(guò)濾器。特別適用于傳統(tǒng)的“單一測(cè)試方法執(zhí)行”用例。當(dāng)使用該命令行選項(xiàng)時(shí),構(gòu)建腳本中聲明的包含過(guò)濾器將被忽略。?
    Command line option "--tests" is provided to conveniently set the test filter. Especially useful for the classic 'single test method execution' use case. When the command line option is used, the inclusion filters declared in the build script are ignored.
  • 鑒于特定測(cè)試框架 API 的限制,Gradle 會(huì)盡最大努力過(guò)濾測(cè)試。一些高級(jí)的、綜合的測(cè)試可能不完全符合過(guò)濾條件。但是,絕大多數(shù)測(cè)試和用例都應(yīng)該能被較好地處理。?
    Gradle tries best to filter the tests given limitations of particular test framework API. Some advanced, synthetic tests may not be fully compatible with filtering. However, vast majority of tests and use cases should be handled neatly.
  • 測(cè)試過(guò)濾取代了基于文件的測(cè)試選擇。后者可能會(huì)在將來(lái)被完全取代。我們將會(huì)增加測(cè)試過(guò)濾 API 并添加更多類型的過(guò)濾器。?
    Test filtering supersedes the file-based test selection. The latter may be completely replaced in future. We will grow the the test filtering api and add more kinds of filters.

示例 23.11. 在構(gòu)建腳本中過(guò)濾測(cè)試 - Example?23.11.?Filtering tests in the build script

build.gradle

test {filter {//include specific method in any of the testsincludeTestsMatching "*UiCheck"//include all tests from packageincludeTestsMatching "org.gradle.internal.*"//include all integration testsincludeTestsMatching "*IntegTest"} }

有關(guān)更多的詳細(xì)信息和示例,請(qǐng)參閱?TestFilter?的文檔。?
For more details and examples please see the?TestFilter?reference.

使用命令行選項(xiàng)的一些示例:?
Some examples of using the command line option:

  • gradle test --tests org.gradle.SomeTest.someSpecificFeature

  • gradle test --tests *SomeTest.someSpecificFeature

  • gradle test --tests *SomeSpecificTest

  • gradle test --tests all.in.specific.package*

  • gradle test --tests *IntegTest

  • gradle test --tests *IntegTest*ui*

  • gradle someTestTask --tests *UiTest someOtherTestTask --tests *WebTest*ui

23.12.4. 通過(guò)系統(tǒng)屬性執(zhí)行單個(gè)測(cè)試

23.12.4.?Single test execution via System Properties
如上所述,這種機(jī)制已經(jīng)被“測(cè)試過(guò)濾”所取代。

設(shè)置一個(gè)?taskName.single?=?testNamePattern?的系統(tǒng)屬性將會(huì)只執(zhí)行匹配指定的?testNamePattern?的測(cè)試。該?taskName?可以是完整的多項(xiàng)目路徑,如“:sub1:sub2:test”,或者僅是一個(gè)任務(wù)名稱。該?testNamePattern?將被用于形成“**/testNamePattern*.class”的包含模式。如果找不到這種模式的測(cè)試,那么將會(huì)拋出一個(gè)異常。這是為了避免你誤認(rèn)為測(cè)試通過(guò)。如果執(zhí)行多個(gè)子項(xiàng)目的測(cè)試,則該模式將應(yīng)用于每個(gè)子項(xiàng)目。如果找不到特定子項(xiàng)目的測(cè)試,則會(huì)引發(fā)異常。在這種情況下,你可以使用模式的路徑標(biāo)記法,以便模式僅應(yīng)用于特定子項(xiàng)目的測(cè)試任務(wù)?;蛘吣憧梢灾付ㄒ獔?zhí)行的任務(wù)的完整限定名稱。你還可以指定多個(gè)模式。示例:?
Setting a system property of?taskName.single?=?testNamePattern?will only execute tests that match the specified?testNamePattern. The?taskName?can be a full multi-project path like ":sub1:sub2:test" or just the task name. The?testNamePattern?will be used to form an include pattern of "**/testNamePattern*.class". If no tests with this pattern can be found an exception is thrown. This is to shield you from false security. If tests of more than one subproject are executed, the pattern is applied to each subproject. An exception is thrown if no tests can be found for a particular subproject. In such a case you can use the path notation of the pattern, so that the pattern is applied only to the test task of a specific subproject. Alternatively you can specify the fully qualified task name to be executed. You can also specify multiple patterns. Examples:

  • gradle -Dtest.single=ThisUniquelyNamedTest test

  • gradle -Dtest.single=a/b/ test

  • gradle -DintegTest.single=*IntegrationTest integTest

  • gradle -Dtest.single=:proj1:test:Customer build

  • gradle -DintegTest.single=c/d/ :proj1:integTest

23.12.5. 測(cè)試檢測(cè)

23.12.5.?Test detection

Test?任務(wù)通過(guò)檢查編譯的測(cè)試類來(lái)檢測(cè)哪些類是測(cè)試類。默認(rèn)情況下,它會(huì)掃描所有?.class?文件。你可以設(shè)置自定義包含或排除哪些類,只有這些類才會(huì)被掃描。根據(jù)所使用的測(cè)試框架(JUnit 或 TestNG),會(huì)使用不同的標(biāo)準(zhǔn)進(jìn)行測(cè)試類的檢測(cè)。?
The?Test?task detects which classes are test classes by inspecting the compiled test classes. By default it scans all?.class?files. You can set custom includes / excludes, only those classes will be scanned. Depending on the test framework used (JUnit / TestNG) the test class detection uses different criteria.

當(dāng)使用 JUnit 時(shí),我們掃描 JUnit 3 和 4 的測(cè)試類。如果符合以下任何標(biāo)準(zhǔn),則該類將被視為 JUnit 測(cè)試類:?
When using JUnit, we scan for both JUnit 3 and 4 test classes. If any of the following criteria match, the class is considered to be a JUnit test class:

  • 類或超類繼承自?TestCase?或?GroovyTestCase

    Class or a super class extends?TestCase?or?GroovyTestCase

  • 類或超類使用了?@RunWith?注解

    Class or a super class is annotated with?@RunWith

  • 類或超類含有一個(gè)帶?@Test?注解的方法

    Class or a super class contain a method annotated with?@Test

當(dāng)使用 TestNG 時(shí),我們掃描帶有?@Test?注解的方法。?
When using TestNG, we scan for methods annotated with?@Test.

請(qǐng)注意,抽象類不會(huì)被執(zhí)行。 Gradle 還將掃描測(cè)試類路徑中的 jar 文件的繼承樹(shù)。?
Note that abstract classes are not executed. Gradle also scan up the inheritance tree into jar files on the test classpath.

如果您不想使用測(cè)試類檢測(cè),則可以通過(guò)設(shè)置?scanForTestClasses?為 false 來(lái)禁用它。這將使測(cè)試任務(wù)僅使用包含或排除來(lái)查找測(cè)試類。如果?scanForTestClasses?被禁用,并且沒(méi)有指定包含或排除模式,則使用相應(yīng)的默認(rèn)值。對(duì)于包含的默認(rèn)值是?“**/*Tests.class”,“**/*Test.class”,而排除的默認(rèn)值是?“**/Abstract*.class”。?
In case you don't want to use the test class detection, you can disable it by setting?scanForTestClasses?to false. This will make the test task only use the includes / excludes to find test classes. If?scanForTestClasses?is disabled and no include or exclude patterns are specified, the respective defaults are used. For include this is?"**/*Tests.class", "**/*Test.class"?and the for exclude it is?"**/Abstract*.class".

23.12.6. 測(cè)試分組

23.12.6.?Test grouping

JUnit 和 TestNG 支持復(fù)雜的測(cè)試方法分組。?
JUnit and TestNG allows sophisticated groupings of test methods.

為對(duì) JUnit 的測(cè)試類和方法進(jìn)行分組,JUnit 4.8 引入了類別的概念。?[9]test?任務(wù)允許指定要包含和排除的 JUnit 類別。?
For grouping JUnit test classes and methods JUnit 4.8 introduces the concept of categories.?[9]?The?test?task allows the specification of the JUnit categories you want to include and exclude.

示例 23.12. JUnit 類別 - Example?23.12.?JUnit Categories

build.gradle

test {useJUnit {includeCategories 'org.gradle.junit.CategoryA'excludeCategories 'org.gradle.junit.CategoryB'} }

TestNG 框架則有一個(gè)非常相似的概念。在 TestNG 中,你可以指定不同的測(cè)試組。?[10]你可以在測(cè)試任務(wù)中配置應(yīng)該包含在測(cè)試執(zhí)行中或從測(cè)試執(zhí)行中排除的測(cè)試組。?
The TestNG framework has a quite similar concept. In TestNG you can specify different test groups.?[10]?The test groups that should be included or excluded from the test execution can be configured in the test task.

示例 23.13. 對(duì) TestNG 測(cè)試分組 - Example?23.13.?Grouping TestNG tests

build.gradle

test {useTestNG {excludeGroups 'integrationTests'includeGroups 'unitTests'} }

23.12.7. 測(cè)試報(bào)告

23.12.7.?Test reporting

test?任務(wù)默認(rèn)情況下會(huì)生成以下結(jié)果。
The?Test?task generates the following results by default.

  • 一個(gè) HTML 測(cè)試報(bào)告。

    An HTML test report.

  • 與 Ant Junit report 任務(wù)兼容的 XML 格式的結(jié)果。許多工具都支持這一格式,比如 CI 服務(wù)器。

    The results in an XML format that is compatible with the Ant JUnit report task. This format is supported by many other tools, such as CI servers.

  • 有效的二進(jìn)制格式的結(jié)果。該任務(wù)從這些二進(jìn)制結(jié)果生成其他結(jié)果。

    Results in an efficient binary format. The task generates the other results from these binary results.

還有一個(gè)獨(dú)立的?TestReport?任務(wù)類型,它可以從一個(gè)或多個(gè)?Test?任務(wù)實(shí)例生成的二進(jìn)制結(jié)果中生成 HTML 測(cè)試報(bào)告。要使用此任務(wù)類型,你需要定義一個(gè)?destinationDir?以及要包含在報(bào)告的測(cè)試結(jié)果。下面是一個(gè)從子項(xiàng)目的單元測(cè)試中生成一個(gè)組合報(bào)告的示例:?
There is also a stand-alone?TestReport?task type which can generate the HTML test report from the binary results generated by one or more?Test?task instances. To use this task type, you need to define a?destinationDir?and the test results to include in the report. Here is a sample which generates a combined report for the unit tests from subprojects:

示例 23.14. 為多個(gè)子項(xiàng)目創(chuàng)建一個(gè)單元測(cè)試報(bào)告 - Example?23.14.?Creating a unit test report for subprojects

build.gradle

subprojects {apply plugin: 'java'// Disable the test report for the individual test tasktest {reports.html.enabled = false} }task testReport(type: TestReport) {destinationDir = file("$buildDir/reports/allTests")// Include the results from the `test` task in all subprojectsreportOn subprojects*.test }

你應(yīng)該注意的是,TestReport?類型結(jié)合了多個(gè)測(cè)試任務(wù)的結(jié)果,并需要匯總各個(gè)測(cè)試類的結(jié)果。這意味著如果給定的測(cè)試類由多個(gè)測(cè)試任務(wù)執(zhí)行,那么測(cè)試報(bào)告將包括該類的執(zhí)行結(jié)果,但很難區(qū)分這個(gè)類的單獨(dú)執(zhí)行和它們的輸出。?
You should note that the?TestReport?type combines the results from multiple test tasks and needs to aggregate the results of individual test classes. This means that if a given test class is executed by multiple test tasks, then the test report will include executions of that class, but it can be hard to distinguish individual executions of that class and their output.

23.12.7.1. TestNG 參數(shù)化方法和報(bào)告

23.12.7.1.?TestNG parameterized methods and reporting

TestNG 支持參數(shù)化測(cè)試方法,允許使用不同的輸入多次執(zhí)行特定的測(cè)試方法。 Gradle 會(huì)在這個(gè)測(cè)試方法執(zhí)行的報(bào)告中包含參數(shù)值。?
TestNG supports?parameterizing test methods, allowing a particular test method to be executed multiple times with different inputs. Gradle includes the parameter values in its reporting of the test method execution.

給定一個(gè)帶有兩個(gè)參數(shù),名為?aParameterizedTestMethod?的參數(shù)化測(cè)試方法,它將使用這個(gè)名稱進(jìn)行報(bào)告 :aParameterizedTestMethod(toStringValueOfParam1, toStringValueOfParam2)。這使得在特定的迭代中,很容易識(shí)別參數(shù)值。?
Given a parameterized test method named?aParameterizedTestMethod?that takes two parameters, it will be reported with the name:?aParameterizedTestMethod(toStringValueOfParam1, toStringValueOfParam2). This makes identifying the parameter values for a particular iteration easy.

23.12.8. 約定值

23.12.8.?Convention values

表 23.14. Java 插件——測(cè)試屬性 - Table?23.14.?Java plugin - test properties

任務(wù)屬性
Task Property
類型
Type
默認(rèn)值
Default Value
testClassesDirFilesourceSets.test.output.classesDir
classpathFileCollectionsourceSets.test.runtimeClasspath
testResultsDirFiletestResultsDir
testReportDirFiletestReportDir
testSrcDirsList<File>sourceSets.test.java.srcDirs

23.13.?Jar

23.13.?Jar

jar?任務(wù)創(chuàng)建一個(gè)包含項(xiàng)目的類文件和資源的 JAR 文件。 JAR文件被聲明為在?archives?依賴配置中的一個(gè)構(gòu)件。這意味著這個(gè) JAR 文件在依賴它的項(xiàng)目的類路徑中可用。如果將項(xiàng)目上傳到倉(cāng)庫(kù)中,則這個(gè) JAR 文件會(huì)被聲明為依賴描述符的一部分。關(guān)于如何處理檔案,可以在《第 16.8 節(jié),“創(chuàng)建檔案”》中了解,而構(gòu)件配置則可參考《第五十一章,發(fā)布構(gòu)件》。?
The?jar?task creates a JAR file containing the class files and resources of the project. The JAR file is declared as an artifact in the?archives?dependency configuration. This means that the JAR is available in the classpath of a dependent project. If you upload your project into a repository, this JAR is declared as part of the dependency descriptor. You can learn more about how to work with archives in?Section?16.8, “Creating archives”?and artifact configurations in?Chapter?51,?Publishing artifacts.

23.13.1.?Manifest

23.13.1.?Manifest

每個(gè) jar 或 war 對(duì)象都有一個(gè)?manifest?屬性,它是一個(gè)單獨(dú)的?Manifest?屬性。當(dāng)生成檔案時(shí),相應(yīng)的?MANIFEST.MF?文件會(huì)被寫(xiě)入存檔。?
Each jar or war object has a?manifest?property with a separate instance of?Manifest. When the archive is generated, a corresponding?MANIFEST.MF?file is written into the archive.

示例 7.5. 自定義的 MANIFEST.MF - Example?23.15.?Customization of MANIFEST.MF

build.gradle

jar {manifest {attributes("Implementation-Title": "Gradle", "Implementation-Version": version)} }

你可以創(chuàng)建一個(gè)獨(dú)立的?Manifest?實(shí)例。例如,可以用它來(lái)在 jar 之間共享清單信息。?
You can create stand alone instances of a?Manifest. You can use that for example, to share manifest information between jars.

示例 23.16. 創(chuàng)建一個(gè)清單對(duì)象。 - Example?23.16.?Creating a manifest object.

build.gradle

ext.sharedManifest = manifest {attributes("Implementation-Title": "Gradle", "Implementation-Version": version) } task fooJar(type: Jar) {manifest = project.manifest {from sharedManifest} }

你可以把其他清單合并到任意的一個(gè)?Manifest?對(duì)象。其他清單可以用文件路徑來(lái)描述,或者像上面的例子那樣,通過(guò)引用另一個(gè)?Manifest?對(duì)象來(lái)描述。?
You can merge other manifests into any?Manifest?object. The other manifests might be either described by a file path or, like in the example above, by a reference to another?Manifest?object.

示例 23.17. 指定檔案的單獨(dú) MANIFEST.MF - Example?23.17.?Separate MANIFEST.MF for a particular archive

build.gradle

task barJar(type: Jar) {manifest {attributes key1: 'value1'from sharedManifest, 'src/config/basemanifest.txt'from('src/config/javabasemanifest.txt', 'src/config/libbasemanifest.txt') {eachEntry { details ->if (details.baseValue != details.mergeValue) {details.value = baseValue}if (details.key == 'foo') {details.exclude()}}}} }

Manifest 會(huì)根據(jù)在?from?語(yǔ)句中所聲明的順序進(jìn)行合并。如果基本的清單和合并清單都定義了同一個(gè)鍵的值,那么默認(rèn)情況下會(huì)采用要合并的清單的值。你可以通過(guò)添加?eachEntry?來(lái)完全自定義結(jié)果清單的每一個(gè)實(shí)體的合并行為,它讓你可以訪問(wèn)?ManifestMergeDetails?實(shí)例。合并不會(huì)立即由 from 語(yǔ)句觸發(fā)。它是惰性執(zhí)行的,在生成 jar 或者是通過(guò)調(diào)用?writeTo?或?effectiveManifest?的時(shí)候完成。
Manifest are merged in the order they are declared by the?from?statement. If the based manifest and the merged manifest both define values for the same key, the merged manifest wins by default. You can fully customize the merge behavior by adding?eachEntry?actions in which you have access to a?ManifestMergeDetails?instance for each entry of the resulting manifest. The merge is not immediately triggered by the from statement. It is done lazily, either when generating the jar, or by calling?writeTo?or?effectiveManifest

你可以很輕松地把一個(gè)清單寫(xiě)入磁盤(pán)。?
You can easily write a manifest to disk.

示例 23.18. 指定檔案的單獨(dú) MANIFEST.MF - Example?23.18.?Separate MANIFEST.MF for a particular archive

build.gradle

jar.manifest.writeTo("$buildDir/mymanifest.mf")

23.14. 上傳

23.14.?Uploading

關(guān)于如何上傳檔案,將在《第五十一章,發(fā)布構(gòu)件》中描述。?
How to upload your archives is described in?Chapter?51,?Publishing artifacts.



[9]?JUnit wiki 包含了有關(guān)如何使用 JUnit 類別的詳細(xì)說(shuō)明:?https://github.com/junit-team/junit/wiki/Categories。?
[9]?The JUnit wiki contains a detailed description on how to work with JUnit categories:?https://github.com/junit-team/junit/wiki/Categories.

[10]?TestNG 文檔包含了有關(guān)測(cè)試組的更多詳細(xì)信息:http://testng.org/doc/documentation-main.html#test-groups。?
[10]?The TestNG documentation contains more details about test groups:?http://testng.org/doc/documentation-main.html#test-groups.


總結(jié)

以上是生活随笔為你收集整理的Gradle 2.0 用户指南翻译——第二十三章. Java 插件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

av黄色在线| 国产高清福利在线 | 国内成人精品视频 | 欧美成人精品三级在线观看播放 | 国产91av视频在线观看 | 精产嫩模国品一二三区 | 超级av在线| 久久精品中文字幕免费mv | 日韩在线视频一区 | 在线观看免费av网站 | 欧美在线91| av免费观看在线 | 国产成人久久 | 福利视频第一页 | 亚洲开心激情 | 国产精品久久久久久久久久妇女 | 成年人视频免费在线 | 亚洲精品久久在线 | 日韩伦理片一区二区三区 | 亚洲人成人99网站 | www国产亚洲精品久久麻豆 | 久久网站免费 | 亚洲精品 在线视频 | 国产va饥渴难耐女保洁员在线观看 | 狠狠色丁香久久综合网 | 一区二区 精品 | 欧美黑吊大战白妞欧美 | 日本在线观看一区 | 成人午夜在线电影 | 五月婷婷六月丁香激情 | 久久成人资源 | 国产第一页福利影院 | 中文字幕在线观看免费高清电影 | 久久国产精品视频观看 | 久久久毛片 | 久久观看免费视频 | 免费精品在线视频 | 一区二区三区免费看 | 中文字幕xxxx | 激情视频亚洲 | 精品久久久亚洲 | 久久综合中文字幕 | 爱av在线网 | 精品久久九九 | 网站在线观看你们懂的 | 国产一级二级三级视频 | 国产精品 9999 | 五月香婷| av 一区二区三区四区 | 999久久久久久久久 69av视频在线观看 | 久久婷五月| 国产精品国产亚洲精品看不卡 | 亚洲精品视频在线观看免费视频 | 中文字幕在线看视频国产 | 91传媒免费观看 | 亚洲国产中文字幕在线观看 | 欧美日韩高清免费 | 天天操天天添 | 黄色成品视频 | 久艹视频在线免费观看 | 久久人人艹 | a视频免费在线观看 | www..com黄色片| 99综合影院在线 | 欧美亚洲精品在线观看 | 免费在线中文字幕 | 欧美激情综合五月色丁香小说 | 亚洲国产日韩精品 | 国产在线欧美在线 | 三级a视频| 日韩精品极品视频 | 深夜免费福利在线 | 日韩专区一区二区 | 久久久精品电影 | 国产手机免费视频 | 亚洲精品国产拍在线 | 狠狠色丁香婷婷综合久小说久 | 中文字幕色在线视频 | 国产精品视频大全 | 久久精品欧美一区二区三区麻豆 | 中文在线免费看视频 | 久久亚洲二区 | 国产精品视频地址 | 国产精品1区2区在线观看 | av+在线播放在线播放 | 99av在线视频| 亚洲精品影视 | 欧美va电影 | 天天草综合网 | 激情一区二区三区欧美 | 久热免费在线 | 国内精品在线一区 | aaa日本高清在线播放免费观看 | 日韩免费成人av | 麻豆系列在线观看 | 精品久久一级片 | 国产视频综合在线 | 高潮久久久久久 | 日本精品久久久久中文字幕5 | 91av电影 | 亚在线播放中文视频 | 午夜视频色 | 四虎影视国产精品免费久久 | 精品国产乱码久久久久久天美 | 欧美成人理伦片 | 久久久精品影视 | 啪啪动态视频 | 麻豆视频免费入口 | 在线视频观看你懂的 | 久久在线观看视频 | 九色琪琪久久综合网天天 | 成人a视频在线观看 | 欧美成人黄色片 | 99久久精品免费一区 | 久久综合精品国产一区二区三区 | 超碰夜夜| 国产探花在线看 | 97超碰总站 | 国内揄拍国产精品 | 人人爽人人澡人人添人人人人 | 黄色特级一级片 | 国产精品女人久久久久久 | 欧美国产日韩一区二区三区 | 欧美性生活免费看 | 在线亚洲天堂网 | 亚洲精品网站在线 | 91av社区| 国产成人精品国内自产拍免费看 | 亚洲天堂网视频 | 激情综合一区 | 久久久三级视频 | 五月婷婷导航 | 欧美日本一区 | 亚洲精品永久免费视频 | 超碰av在线免费观看 | 国产一区二区免费 | 欧美性做爰猛烈叫床潮 | 一本之道乱码区 | 91精品久久久久久综合乱菊 | 欧美爽爽爽 | 欧美日本一区 | 国产专区日韩专区 | 日韩免费在线视频 | 欧产日产国产69 | 国产日韩中文字幕 | 欧美人牲 | 久草a视频| 免费看国产曰批40分钟 | 日韩在线资源 | 中文国产成人精品久久一 | 国产精品亚州 | 久久久久97国产 | 日韩精品一区二区三区视频播放 | 国产一区高清在线观看 | 国产偷国产偷亚洲清高 | 欧美一区日韩精品 | av在线收看| 2021国产在线视频 | 欧美日韩免费在线观看视频 | 国产亚洲精品综合一区91 | 在线播放日韩av | 日韩一级精品 | 亚洲欧美一区二区三区孕妇写真 | 久久网站av | 国产手机av| 久久,天天综合 | 不卡的av电影在线观看 | 成片免费观看视频 | 91av综合| 欧美成亚洲 | 久久99久久99免费视频 | 天天躁日日躁狠狠躁av麻豆 | 成人资源在线播放 | 国产精品一区二区久久精品爱微奶 | 九色精品免费永久在线 | 精品成人国产 | 又黄又刺激又爽的视频 | 欧美性脚交 | 99欧美精品 | 日韩精品高清视频 | 黄色激情网址 | 国产成人av电影在线观看 | 成人精品福利 | 精品天堂av | 亚洲电影第一页av | 在线观看激情av | 激情综合亚洲精品 | 国产色在线| 狠狠操导航 | 一区二区三区在线视频111 | 国产国语在线 | 久久精品视频在线观看免费 | 玖玖综合网| 日本激情视频中文字幕 | 亚洲在线精品视频 | 很黄很污的视频网站 | 免费在线观看一区二区三区 | 久草久热 | 成人在线免费看视频 | 亚洲一二三在线 | 亚洲三级在线播放 | 欧美91精品久久久久国产性生爱 | 亚洲免费不卡 | 国产91电影在线观看 | 亚洲精品一区二区三区四区高清 | 成人在线免费观看视视频 | 最近更新的中文字幕 | 久久久久女教师免费一区 | 午夜精品一区二区三区免费 | 精品美女久久久久 | 99热在线看 | 精品99在线 | 99热在线免费观看 | 在线观看成年人 | 国产精品九九九九九 | 天天操天天色天天 | 91精品999| 亚洲综合激情小说 | 青青草国产精品 | 成人av资源网 | 精品视频专区 | 日韩三级视频在线观看 | 日韩精品播放 | 久久综合九色欧美综合狠狠 | 成人中文字幕+乱码+中文字幕 | 在线观看视频你懂得 | 九九免费在线观看视频 | www亚洲视频 | 亚洲精色| 色wwwww | а中文在线天堂 | 久久久久久久久爱 | 国产亚洲情侣一区二区无 | 91高清一区 | 97超碰在线久草超碰在线观看 | 手机在线看永久av片免费 | 成片人卡1卡2卡3手机免费看 | 国产伦精品一区二区三区无广告 | 久久99精品国产麻豆婷婷 | 日韩精品一区二区三区免费视频观看 | 99精品亚洲| 色中文字幕在线观看 | 欧美三级在线播放 | 国内丰满少妇猛烈精品播放 | 在线免费av网站 | 久久久国产日韩 | www最近高清中文国语在线观看 | 最近2019好看的中文字幕免费 | 久久伊人色综合 | 黄色免费网站大全 | 欧美日韩另类在线 | 日日爽日日操 | 久久久久久久久久久久影院 | 一区二区三区 亚洲 | 天天操天天添 | 91成品视频| 91久久精品一区二区三区 | 丰满少妇在线 | 日韩av成人在线观看 | 日韩视频在线一区 | 国产麻豆剧果冻传媒视频播放量 | 国产精品久久久久亚洲影视 | 九九免费精品 | 日韩在线观看中文字幕 | 久久99精品热在线观看 | 国产精品国产精品 | 免费精品国产va自在自线 | 激情五月网站 | 日本免费久久高清视频 | 亚洲成人999 | 中文 一区二区 | 去干成人网 | 午夜18视频在线观看 | 国产99精品在线观看 | 天天操天天干天天操天天干 | 欧洲成人免费 | 国产91免费看 | 午夜精品久久久久久中宇69 | 日韩理论在线 | 99色在线播放 | 免费看国产曰批40分钟 | 狠狠色伊人亚洲综合网站色 | 日韩xxxbbb | 亚洲资源视频 | 亚洲国产中文字幕在线视频综合 | 日韩免费视频网站 | 免费看高清毛片 | 天天射天天干天天插 | 国产一级免费观看 | 天天干天天干天天干天天干天天干天天干 | 人人搞人人爽 | 日韩视频中文字幕 | 国产精品视频全国免费观看 | 久久精品国产精品亚洲精品 | 亚洲综合色视频在线观看 | 亚洲国产精品va在线 | 久久久久久视频 | 国产专区第一页 | 蜜臀av一区二区 | 91在线视频一区 | 国产视频一区二区在线观看 | 日韩av片免费在线观看 | 一区二区三区免费在线 | 亚洲人片在线观看 | 瑞典xxxx性hd极品 | 一区二区三区免费在线观看 | 911av视频| 伊人影院av | 国产视频资源在线观看 | 香蕉在线视频观看 | 色婷婷国产精品 | 国产免费黄视频在线观看 | 五月激情视频 | 四虎最新域名 | 在线观看黄色小视频 | 国产精品一区二区在线观看免费 | 香蕉视频久久久 | 欧美精品乱码久久久久 | 日韩欧美69 | 韩日电影在线免费看 | 欧美一区免费在线观看 | 天天插天天操天天干 | av中文字幕剧情 | av电影在线观看完整版一区二区 | 久久高清av | 亚洲一二区视频 | 四虎影视国产精品免费久久 | 日韩a级免费视频 | 一级免费黄视频 | 国产黄色一级片在线 | 精品国产网址 | 色综合久久88色综合天天人守婷 | 黄色tv视频 | 久草91视频 | 日韩精品一区二区三区不卡 | 免费美女久久99 | 丁香婷婷基地 | 日韩午夜大片 | 色狠狠久久av五月综合 | 在线免费黄色片 | 日韩欧美国产成人 | 国产精品不卡av | 91精品国产福利在线观看 | 国产亚洲精品xxoo | 97在线视频免费 | 九九九电影免费看 | 色婷五月天 | 欧美作爱视频 | av一区二区三区在线观看 | 欧美日韩国产二区三区 | 欧美日韩国产mv | 欧美激情奇米色 | 日韩毛片在线一区二区毛片 | www.亚洲精品在线 | 天天干夜夜夜 | 亚洲综合五月 | 国产午夜精品免费一区二区三区视频 | 精品女同一区二区三区在线观看 | 亚洲成aⅴ人在线观看 | 国产在线一卡 | 久久成人国产精品入口 | 丰满少妇高潮在线观看 | 成 人 黄 色 视频 免费观看 | 色婷婷综合久久久 | 中文字幕亚洲精品日韩 | 综合在线亚洲 | 亚洲精品视频在线免费 | 天天操比 | 在线观看免费观看在线91 | 日韩网站在线播放 | 亚洲理论电影网 | 国产专区在线看 | 免费看片网页 | 亚洲亚洲精品在线观看 | 久久五月精品 | 97人人模人人爽人人喊中文字 | 免费看一及片 | 2023亚洲精品国偷拍自产在线 | 欧美91精品久久久久国产性生爱 | 手机在线看永久av片免费 | 国产九九九九九 | 婷婷久久久 | 在线观看精品一区 | 中文亚洲欧美日韩 | 欧美激情精品久久久久久免费 | 丝袜足交在线 | 成年人免费在线观看网站 | 在线性视频日韩欧美 | 国产精品高清一区二区三区 | 国产99在线| 青青河边草免费观看完整版高清 | 亚洲精品午夜国产va久久成人 | 97香蕉久久超级碰碰高清版 | 婷婷综合网 | 久久91网 | 免费在线国产精品 | 国产精品成久久久久 | 欧美日韩高清国产 | 麻豆一区二区三区视频 | 丁香婷婷在线观看 | 亚洲精品99 | 亚洲丁香久久久 | 91精品啪在线观看国产 | 国内精品久久久久影院一蜜桃 | 亚洲国产操 | 精品亚洲男同gayvideo网站 | 九月婷婷色| 免费a视频在线 | 狠狠干狠狠久久 | 天天色成人网 | 白丝av免费观看 | 国产又粗又硬又爽的视频 | 亚洲婷婷综合色高清在线 | 狠狠色丁香婷婷综合久小说久 | 免费看片日韩 | 最近中文字幕国语免费高清6 | 91少妇精拍在线播放 | 丝袜美腿在线 | 欧美一级电影片 | av电影av在线 | 在线观看中文字幕一区 | 91精品国产自产在线观看永久 | 国产91精品在线观看 | 色婷婷午夜 | 国产黄色精品在线 | 亚洲一区日韩精品 | 一级片在线 | 国产精品免费麻豆入口 | 中文字幕在线网址 | 香蕉在线观看视频 | 欧美一二在线 | 欧美日韩高清在线一区 | 成人免费大片黄在线播放 | 精品久久久久久电影 | 亚洲日本国产精品 | 国产夫妻性生活自拍 | 狠狠的干 | 日韩免费av网址 | 国产日产精品一区二区三区四区的观看方式 | 日日噜噜噜噜夜夜爽亚洲精品 | 欧美孕妇视频 | 九九在线高清精品视频 | a视频在线播放 | 久久久久久久久精 | 国产手机视频精品 | 精品国产成人av | 天天射综合网视频 | 日日爱网址 | 韩国精品在线 | 五月婷av | 香蕉日日 | 国产精品视频免费在线观看 | 91亚洲精品久久久蜜桃网站 | 在线观看激情av | 色午夜| 中文字幕乱码视频 | 色成人亚洲 | 欧美一级特黄aaaaaa大片在线观看 | 久久免费视频一区 | 中文字幕在线观看你懂的 | 国产无套一区二区三区久久 | 国产免费精彩视频 | 欧美91精品久久久久国产性生爱 | 亚洲视频999 | 99热国产在线中文 | 91黄色免费网站 | 美女视频永久黄网站免费观看国产 | 久久天天躁 | 国产69久久久欧美一级 | 亚洲国产欧美一区二区三区丁香婷 | 97人人模人人爽人人少妇 | 播五月综合 | 欧美极品一区二区三区 | 国产午夜三级一区二区三桃花影视 | 国产日韩精品在线观看 | 国产精品99久久免费黑人 | 国产免费区 | 国产码电影 | 亚洲禁18久人片 | 国产操在线 | 日韩av资源站 | 欧美一区二区三区四区夜夜大片 | 福利视频一二区 | 嫩草伊人久久精品少妇av | av免费电影在线观看 | 66av99精品福利视频在线 | 免费在线观看污 | 国产精品区在线观看 | 欧美一级视频免费看 | av福利超碰网站 | 麻豆视频免费在线观看 | 欧美久久99| 少妇bbw揉bbb欧美 | 日韩a在线观看 | 特级西西人体444是什么意思 | 中文字幕黄色网址 | 丁香婷婷在线观看 | 成人免费视频网站 | 午夜久久久久久久 | 国产亚洲精品久久久久久无几年桃 | 国产色爽 | 日本中文不卡 | 天天操天天操天天操天天操天天操天天操 | 黄色小说视频在线 | 午夜在线观看影院 | 97视频久久久 | 国产日产精品久久久久快鸭 | 国产精品s色 | 午夜婷婷在线播放 | 国产欧美精品一区aⅴ影院 99视频国产精品免费观看 | 婷五月激情 | 日韩毛片在线一区二区毛片 | 在线国产日本 | 成人国产精品入口 | 久久久精品99| 免费一级片在线观看 | 热久久这里只有精品 | 人人射人人爽 | 国产一级电影 | 日韩中文免费视频 | 国产不卡在线 | 国产一区二区免费 | 五月天.com | 日韩网站免费观看 | 九九热只有精品 | 亚洲综合射 | 国产精品成人自产拍在线观看 | 福利av影院 | 99热手机在线观看 | 成年人在线电影 | 久草9视频 | 国产剧情一区二区在线观看 | 国产日韩精品一区二区在线观看播放 | 国产特黄色片 | www.av免费观看 | 久久久99精品免费观看乱色 | 久久久久久久久久久福利 | 国产色网 | 亚洲无吗av | 久热av在线 | 日本中文字幕一二区观 | 玖玖视频 | 综合色伊人| 色多多污污 | 国产精品乱码高清在线看 | 国产又粗又猛又爽又黄的视频免费 | 成人网在线免费视频 | 日韩欧美高清一区二区三区 | 日日草av | 久久免费视频8 | 亚洲精品国产精品久久99 | 日韩久久一区二区 | 日本久久成人中文字幕电影 | 亚洲黄色免费电影 | 天天做综合网 | 丁香激情视频 | 久草在线视频国产 | 亚洲视频在线观看免费 | 91在线播放视频 | 99精品免费久久久久久久久 | 一区二区三区电影大全 | 日韩欧美在线视频一区二区 | 国产中文字幕精品 | 玖玖国产精品视频 | 一色屋精品视频在线观看 | 五月天六月婷婷 | 蜜臀av网址| 亚洲午夜久久久久 | 国产在线探花 | 91成人精品一区在线播放 | 在线观看色网站 | 久久视频网址 | 久久久午夜精品福利内容 | 久久久久免费精品视频 | 激情伊人五月天久久综合 | 91免费在线播放 | 久久69av | av色网站 | 在线日韩三级 | 久久电影色 | 麻豆超碰 | 欧美成人性网 | 久久精品999 | 在线视频 精品 | 欧美日本高清视频 | 国产精品麻豆三级一区视频 | 夜夜躁日日躁 | 天天综合入口 | 黄色资源在线观看 | 久久久久 免费视频 | av在线之家电影网站 | 国产精品福利在线观看 | 成人黄色大片在线观看 | 国产 一区二区三区 在线 | 久久免费精彩视频 | 91中文在线 | 亚洲综合色视频在线观看 | 91精品视屏 | 九色福利视频 | 日本深夜福利视频 | 很黄很污的视频网站 | 丁香视频全集免费观看 | 久久亚洲私人国产精品 | 99热这里是精品 | 欧美伦理电影一区二区 | av免费播放 | 久久视频免费看 | 欧洲av不卡 | a午夜在线 | 欧美成人h版电影 | 久久伊人精品一区二区三区 | 在线观看精品黄av片免费 | 亚洲在线视频播放 | 97在线精品国自产拍中文 | 国产成人精品一区二区在线观看 | 国产精品视频99 | 欧美性受极品xxxx喷水 | av黄色在线播放 | 久久专区| 99精品欧美一区二区三区黑人哦 | 免费的黄色的网站 | 免费观看v片在线观看 | 一区二区三区精品在线 | 国产精品免费av | 日韩免费不卡av | 天天综合网久久 | 欧美日韩一级在线 | 91精品国产自产在线观看 | 久久综合爱 | 成人91免费视频 | 中文字幕成人网 | 天天天插| 在线观看色网 | 亚洲开心激情 | 深爱激情五月网 | 国产午夜精品福利视频 | 国产精品欧美久久久久三级 | 97成人在线观看视频 | 91网在线看 | 日韩在线视频线视频免费网站 | 久久精品一区二区三区中文字幕 | 日韩小视频网站 | 精品网站999www | 国产九九九视频 | 日韩簧片在线观看 | 在线国产一区 | 黄色在线网站噜噜噜 | 日韩中文字幕亚洲一区二区va在线 | 国产精品久久久久久久妇 | 一区免费在线 | 91片黄在线观 | 亚洲精品18日本一区app | 米奇影视7777 | 国产精品一区在线 | 国产福利av | av日韩国产| 五月天丁香 | 全黄色一级片 | 在线观看视频一区二区三区 | 国产麻豆果冻传媒在线观看 | 国产在线不卡精品 | 一区二区三区三区在线 | 国产99久久久久久免费看 | av福利在线看 | 99久久影院 | 1000部国产精品成人观看 | 久久综合色8888 | 中国一级片在线播放 | 中文字幕2021| 国产精品免费成人 | 精品国产大片 | 麻豆91精品 | 五月婷婷一区 | 99视频这里只有 | 亚洲欧洲国产精品 | 五月综合在线观看 | 久久久国产精品麻豆 | 国产欧美综合视频 | 欧美日韩一区三区 | 久久久国产精品成人免费 | 91一区啪爱嗯打偷拍欧美 | 一级免费观看 | 欧美色精品天天在线观看视频 | 久久成人18免费网站 | 不卡视频在线 | 国产成人无码AⅤ片在线观 日韩av不卡在线 | 天天干天天干天天射 | 免费网站色 | 久久久久久欧美二区电影网 | 免费a视频 | 成人动漫视频在线 | 91成人破解版 | 国产91精品欧美 | 国产精品麻豆91 | 激情婷婷在线观看 | 国产精品久久久久久69 | 91超国产 | 91夜夜夜| 久久久久久久免费看 | 国产精品99久久久久久人免费 | 亚洲综合视频在线观看 | 精品 激情 | 97碰在线 | 91丨九色丨蝌蚪丨老版 | 国产原创中文在线 | 在线观看aa | 三三级黄色片之日韩 | 精品福利在线 | 亚洲国产精品久久久久 | 成 人 a v天堂 | 精品美女在线视频 | 五月婷婷开心 | 午夜性盈盈 | 日韩欧美亚州 | 99久久一区| 天天操天天能 | 日韩在线大片 | 久久精品在线 | 欧美成人aa| 久久乐九色婷婷综合色狠狠182 | 精品久久久久久久久久久久久久久久 | 久久国产网站 | av成人免费在线观看 | 国产精品成人久久 | 日韩videos| 国产成人精品午夜在线播放 | 成人午夜剧场在线观看 | 亚州精品成人 | 激情伊人五月天久久综合 | 97精品国产一二三产区 | 日韩一级黄色av | 色91在线视频 | 成人cosplay福利网站 | 亚洲电影毛片 | 成人xxxx | 人人爱人人爽 | 天天玩夜夜操 | 免费福利在线 | 国产色 在线 | 天天干 天天摸 天天操 | 97人人超| a一片一级 | 91亚洲国产成人 | 亚洲自拍自偷 | 91麻豆国产福利在线观看 | 91亚洲精品国偷拍自产在线观看 | 日韩在线观看你懂的 | 亚洲精品午夜久久久 | 国产99在线 | 激情视频免费在线 | 久爱精品在线 | 亚洲男女精品 | 天天干天天操天天操 | 天天操天天摸天天爽 | 久久久久久久久久久电影 | 热久久精品在线 | 婷婷av在线| 又黄又爽的免费高潮视频 | 日本免费久久高清视频 | av经典在线 | 久久男人视频 | 日韩18p| 久久综合久久综合这里只有精品 | 麻豆视频免费网站 | 97视频免费看 | 日韩免费在线观看 | 亚洲狠狠操 | 九九热国产视频 | 国产一区二区三区黄 | 欧美一级视频在线观看 | 国产成人综合在线观看 | 婷婷五情天综123 | 久久精品成人欧美大片古装 | 亚洲第一区在线播放 | 久草在线| 亚洲国产剧情av | 久久久久久毛片 | 91爱爱免费观看 | 国产精彩视频一区 | 91大片网站| 国产精品亚洲片在线播放 | 欧美成人va| 欧美精品日韩 | 日日干,天天干 | 日本久久免费电影 | 成人黄色电影免费观看 | 成人一级电影在线观看 | 黄色毛片大全 | 欧美日韩一区二区在线 | 黄色的片子| 亚洲国产成人久久综合 | 五月婷婷在线播放 | 超碰人人超 | 婷婷九月激情 | 99久久婷婷国产一区二区三区 | 久久不色 | 麻豆免费精品视频 | 日韩av高潮 | 国产色婷婷精品综合在线手机播放 | 蜜桃av观看 | 波多野结衣在线播放视频 | wwxxxx日本 | 国产亚洲久一区二区 | 99精品99| 美女网站色在线观看 | 亚洲欧美久久 | 精品亚洲男同gayvideo网站 | 97精品欧美91久久久久久 | 99精品视频精品精品视频 | 欧美性黄网官网 | av一级片在线观看 | 久草亚洲视频 | 国产精品成人在线 | 亚洲精品在线免费观看视频 | av千婊在线免费观看 | av电影免费观看 | 精品一区二区三区香蕉蜜桃 | 黄av免费在线观看 | 午夜精品一区二区三区在线播放 | 免费观看性生交大片3 | 国产精品成久久久久三级 | 天天操人人干 | 欧美日韩久久 | 成人午夜免费剧场 | 2023亚洲精品国偷拍自产在线 | 永久中文字幕 | 亚洲热久久 | 狠狠久久伊人 | 亚洲美女视频网 | 欧洲亚洲女同hd | 色视频成人在线观看免 | 激情黄色一级片 | 欧美资源 | 丝袜av网站 | 日韩精品一区二区三区电影 | 久久福利在线 | 日韩在线一二三区 | 免费国产在线视频 | 久久久精品 一区二区三区 国产99视频在线观看 | 午夜国产福利在线 | 九九天堂 | 色婷丁香| 日韩欧美电影在线 | 国内精品美女在线观看 | 99热99re6国产在线播放 | 亚洲精品视频在线免费播放 | 国产免码va在线观看免费 | av日韩不卡 | 在线亚洲欧美日韩 | 日韩精品你懂的 | 色多多污污| 亚洲人成免费 | 国内精品一区二区 | 亚洲综合色站 | 成人免费xxx在线观看 | 91丨精品丨蝌蚪丨白丝jk | 国产 日韩 欧美 中文 在线播放 | 免费看久久 | 91精品国产三级a在线观看 | 国产视频久久久 | 久久成视频 | 国产一区二区三区网站 | 亚洲国产精品va在线看黑人动漫 | 黄色成人av | 国产精品国产自产拍高清av | 人人要人人澡人人爽人人dvd | 91福利区一区二区三区 | 久久伦理 | 99视频在线观看免费 | 超碰在线9| 欧美黑人性猛交 | 99草在线视频| 亚洲 成人 欧美 | 欧美淫视频 | 国产91区| 国产精久久久 | 天天骚夜夜操 | 丁香婷婷在线观看 | 在线a人v观看视频 | 亚洲精品自在在线观看 | 国产91对白在线播 | 伊人欧美 | 欧美日韩视频在线观看一区二区 | 日韩黄色软件 | av电影不卡在线 | 欧美精品第一 | 夜夜操网站 | 日韩在线播放视频 | 成人av在线影视 | 精品久久久久久久久久久久 | 久热av| 91大神dom调教在线观看 | 成年人视频在线免费观看 | 婷婷伊人综合 | 久久另类小说 | 久久超级碰 | 欧美日韩国产精品久久 | 亚洲一级黄色大片 | 日韩视频一二三区 | 国产亚洲精品久久久久久网站 | 日韩一级片观看 | 欧美成人高清 | 粉嫩一二三区 | 日韩精品久久中文字幕 | 久草在线视频免费资源观看 | 蜜臀久久99精品久久久无需会员 | 97视频网址 | 性色在线视频 | 久久婷婷一区 | 欧美日韩在线视频一区二区 | 国产精品婷婷午夜在线观看 | 成片免费观看视频999 | 永久免费观看视频 | 久久伊人操 | 日韩av有码在线 | 欧美视频日韩视频 | 久久久久久综合 | 免费无遮挡动漫网站 | 亚洲最大色 | 久艹视频在线免费观看 | 亚洲国产wwwccc36天堂 | 亚洲美女视频在线 | 国产午夜精品一区二区三区在线观看 | 欧美精品久久久久性色 | 粉嫩av一区二区三区四区 | 国产精品小视频网站 | 丁香亚洲 | 四川妇女搡bbbb搡bbbb搡 | 91视频免费看片 | 日韩视频一区二区在线 | 久久综合久久88 | 中文字幕免费成人 | 日韩在线视频播放 | 国产一区二区高清不卡 | 色综合久久久久综合 | 久草免费在线视频观看 | 国产精品中文在线 | 色综合久久久久久久 | 午夜视频日本 | 国产 在线 高清 精品 | 国产热re99久久6国产精品 | av三区在线 | 在线视频一区观看 | 免费日韩视频 | 人人爽人人乐 | 亚洲精品欧美精品 | 在线免费观看麻豆 | 国产不卡视频 | 午夜精品久久久久久久99 | av日韩在线网站 | 日韩精品中文字幕一区二区 | 久久久免费观看完整版 | 亚洲精品国偷拍自产在线观看蜜桃 | 成人高清av在线 | 香蕉久久久久久久 | 成年人视频在线免费播放 | 亚洲精品国产欧美在线观看 | 色香蕉网 | 国产精品乱码久久久久久1区2区 | 欧美伦理一区二区 | 三级动图 | 中文在线中文a | 免费在线观看一级片 | 色吊丝在线永久观看最新版本 | 韩国视频一区二区三区 | 日韩美女久久 | 91网在线看 | 久久综合成人网 | 欧美日韩一区二区三区在线观看视频 | a级国产毛片 | 波多野结衣在线视频免费观看 | 视频国产在线观看18 | 亚洲天天综合网 | 欧美色图p | 日韩在线第一 | 亚洲黄色高清 | 青青草在久久免费久久免费 | 亚洲 欧美 综合 在线 精品 | 亚洲精品麻豆视频 | 日韩欧美在线一区 | 在线观看aa| 五月天婷婷免费视频 | 久草在线视频免费资源观看 | 日韩欧美在线高清 | 六月婷婷久香在线视频 | 高清av在线 | 一区电影 | 四虎国产精品成人免费4hu | 99在线热播 | 欧美极品少妇xxxx | 一区二区三区在线免费观看视频 | 国产精品毛片久久久久久久久久99999999 | 国产一区二区三区午夜 | 国产成人一区二区精品非洲 | 亚洲成人资源在线观看 | 特级西西444www大精品视频免费看 | 九九热在线视频免费观看 | 天天操天天操天天操天天操天天操 |