本文整理匯總了Java中org.gradle.api.artifacts.Configuration.setTransitive方法的典型用法代碼示例。如果您正苦於以下問題:Java Configuration.setTransitive方法的具體用法?Java Configuration.setTransitive怎麽用?Java Configuration.setTransitive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.artifacts.Configuration
的用法示例。
在下文中一共展示了Configuration.setTransitive方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBaseApFile
import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
private File getBaseApFile(Project project, TBuildType tBuildType) {
File apBaseFile;
File buildTypeBaseApFile = tBuildType.getBaseApFile();
if (null != buildTypeBaseApFile && buildTypeBaseApFile.exists()) {
apBaseFile = buildTypeBaseApFile;
} else if (!isNullOrEmpty(tBuildType.getBaseApDependency())) {
String apDependency = tBuildType.getBaseApDependency();
// Preconditions.checkNotNull(apDependency,
// "You have to specify the baseApFile property or the baseApDependency
// dependency");
Dependency dependency = project.getDependencies().create(apDependency);
Configuration configuration = project.getConfigurations().detachedConfiguration(dependency);
configuration.setTransitive(false);
apBaseFile = Iterables.getOnlyElement(Collections2.filter(configuration.getFiles(), new Predicate<File>() {
@Override
public boolean apply(@Nullable File file) {
return file.getName().endsWith(".ap");
}
}));
} else {
throw new IllegalStateException("AP is missing");
}
return apBaseFile;
}
示例2: createConfigurations
import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
protected void createConfigurations() {
Configuration configuration = project.getConfigurations().create(getConfigurationName());
configuration.setVisible(false);
configuration.setTransitive(true);
configuration.setDescription("The " + getToolName() + " libraries to be used for this project.");
// Don't need these things, they're provided by the runtime
configuration.exclude(excludeProperties("ant", "ant"));
configuration.exclude(excludeProperties("org.apache.ant", "ant"));
configuration.exclude(excludeProperties("org.apache.ant", "ant-launcher"));
configuration.exclude(excludeProperties("org.slf4j", "slf4j-api"));
configuration.exclude(excludeProperties("org.slf4j", "jcl-over-slf4j"));
configuration.exclude(excludeProperties("org.slf4j", "log4j-over-slf4j"));
configuration.exclude(excludeProperties("commons-logging", "commons-logging"));
configuration.exclude(excludeProperties("log4j", "log4j"));
}
示例3: exists
import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
private boolean exists(PluginRequest request) {
// This works because the corresponding BackedByArtifactRepository PluginRepository sets
// registers an ArtifactRepository in the DependencyResolutionServices instance which is
// exclusively used by this ArtifactRepositoryPluginResolver. If the plugin marker
// doesn't exist in that isolated ArtifactRepository, this resolver won't look anywhere else.
Dependency dependency = resolution.getDependencyHandler().create(getMarkerCoordinates(request));
ConfigurationContainer configurations = resolution.getConfigurationContainer();
Configuration configuration = configurations.detachedConfiguration(dependency);
configuration.setTransitive(false);
return !configuration.getResolvedConfiguration().hasError();
}
示例4: addJacocoConfigurations
import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
/**
* Creates the configurations used by plugin.
*/
private void addJacocoConfigurations() {
Configuration agentConf = project.getConfigurations().create(AGENT_CONFIGURATION_NAME);
agentConf.setVisible(false);
agentConf.setTransitive(true);
agentConf.setDescription("The Jacoco agent to use to get coverage data.");
Configuration antConf = project.getConfigurations().create(ANT_CONFIGURATION_NAME);
antConf.setVisible(false);
antConf.setTransitive(true);
antConf.setDescription("The Jacoco ant tasks to use to get execute Gradle tasks.");
}
示例5: configureFindBugsConfigurations
import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
private void configureFindBugsConfigurations() {
Configuration configuration = project.getConfigurations().create("findbugsPlugins");
configuration.setVisible(false);
configuration.setTransitive(true);
configuration.setDescription("The FindBugs plugins to be used for this project.");
}
示例6: generate
import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
/**
* Directory of so
*/
@TaskAction
void generate() throws IOException, DocumentException {
Project project = getProject();
File apBaseFile = null;
File apFile = getApFile();
if (null != apFile && apFile.exists()) {
apBaseFile = apFile;
} else {
String apDependency = getApDependency();
if (StringUtils.isNotBlank(apContext.getApDependency())) {
Dependency dependency = project.getDependencies().create(apDependency);
Configuration configuration = project.getConfigurations().detachedConfiguration(dependency);
configuration.setTransitive(false);
configuration.getResolutionStrategy().cacheChangingModulesFor(0, TimeUnit.MILLISECONDS);
configuration.getResolutionStrategy().cacheDynamicVersionsFor(0, TimeUnit.MILLISECONDS);
for (File file : configuration.getFiles()) {
if (file.getName().endsWith(".ap")) {
apBaseFile = file;
break;
}
}
}
}
if (null != apBaseFile && apBaseFile.exists()) {
try {
explodedDir = getExplodedDir();
BetterZip.unzipDirectory(apBaseFile, explodedDir);
apContext.setApExploredFolder(explodedDir);
Set<String> awbBundles = getAwbBundles();
if (awbBundles != null) {
// Unzip the baseline Bundle
for (String awbBundle : awbBundles) {
File awbFile = BetterZip.extractFile(new File(explodedDir, AP_INLINE_APK_FILENAME),
"lib/armeabi/" + awbBundle,
new File(explodedDir, AP_INLINE_AWB_EXTRACT_DIRECTORY));
File awbExplodedDir = new File(new File(explodedDir, AP_INLINE_AWB_EXPLODED_DIRECTORY),
FilenameUtils.getBaseName(awbBundle));
BetterZip.unzipDirectory(awbFile, awbExplodedDir);
FileUtils.renameTo(new File(awbExplodedDir, FN_APK_CLASSES_DEX),
new File(awbExplodedDir, "classes2.dex"));
}
// Preprocessing increment androidmanifest.xml
ManifestFileUtils.updatePreProcessBaseManifestFile(
FileUtils.join(explodedDir, "manifest-modify", ANDROID_MANIFEST_XML),
new File(explodedDir, ANDROID_MANIFEST_XML));
}
if (explodedDir.listFiles().length == 0){
throw new RuntimeException("unzip ap exception, no files found");
}
}catch (Throwable e){
FileUtils.deleteIfExists(apBaseFile);
throw new GradleException(e.getMessage(),e);
}
}
}
示例7: resolveAndFetchArchive
import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
private File resolveAndFetchArchive() {
Dependency dep = getProject().getDependencies().create(platformConfig.dependency());
Configuration conf = getProject().getConfigurations().detachedConfiguration(dep);
conf.setTransitive(false);
return conf.resolve().iterator().next();
}