運行時類別路徑正規化的組態。
多種方法接受檔案模式以選擇性地正規化檔案。模式可能包含
- '*' 以匹配任意數量的字元
- '?' 以匹配任意單個字元
- '**' 以匹配任意數量的目錄或檔案
在模式中使用 '/' 或 '\' 來分隔目錄。以 '/' 或 '\' 結尾的模式將自動附加 '**'。
範例
all files ending with '.json' (including files in subdirectories) **/*.json
all files beginning with 'build-' in the level1/level2 directory
level1/level2/build-*
all files (including subdirectories) beneath config/build-data config/build-data/
all properties files in a build directory beneath com/acme (including subdirectories)
com/acme/**/build/*.properties
方法 | 描述 |
ignore(模式) | 忽略類別路徑條目中匹配 |
properties(模式, 組態) | 將匹配 |
properties(組態) | 根據 |
void
ignore
(String
模式)
忽略類別路徑條目中匹配 pattern
的資源。
void
properties
(String
模式, Action
<? super PropertiesFileNormalization
>
組態)
Action
<? super PropertiesFileNormalization
>將匹配 pattern
的檔案正規化為屬性檔案,忽略註解和屬性順序,並應用由 configuration
提供的規則。
void
properties
(Action
<? super PropertiesFileNormalization
>
組態)
Action
<? super PropertiesFileNormalization
>根據 configuration
提供的規則,正規化所有屬性檔案。這等同於調用 RuntimeClasspathNormalization.properties(java.lang.String, org.gradle.api.Action)
以及 '**/*.properties' 模式。