use of org.gradle.api.Nullable in project gradle by gradle.
the class AstUtils method extractBareMethodCall.
@Nullable
public static MethodCallExpression extractBareMethodCall(Statement statement) {
if (!(statement instanceof ExpressionStatement)) {
return null;
}
ExpressionStatement expressionStatement = (ExpressionStatement) statement;
if (!(expressionStatement.getExpression() instanceof MethodCallExpression)) {
return null;
}
MethodCallExpression methodCall = (MethodCallExpression) expressionStatement.getExpression();
if (!targetIsThis(methodCall)) {
return null;
}
return methodCall;
}
use of org.gradle.api.Nullable in project gradle by gradle.
the class PrebuiltLibraryBinaryLocator method getBinaries.
@Nullable
@Override
public DomainObjectSet<NativeLibraryBinary> getBinaries(LibraryIdentifier library) {
ModelRegistry projectModel = projectModelResolver.resolveProjectModel(library.getProjectPath());
Repositories repositories = projectModel.find("repositories", Repositories.class);
if (repositories == null) {
return null;
}
PrebuiltLibrary prebuiltLibrary = getPrebuiltLibrary(repositories.withType(PrebuiltLibraries.class), library.getLibraryName());
return prebuiltLibrary != null ? prebuiltLibrary.getBinaries() : null;
}
use of org.gradle.api.Nullable in project gradle by gradle.
the class ProjectLibraryBinaryLocator method getBinaries.
// Converts the binaries of a project library into regular binary instances
@Nullable
@Override
public DomainObjectSet<NativeLibraryBinary> getBinaries(LibraryIdentifier libraryIdentifier) {
ModelRegistry projectModel = projectModelResolver.resolveProjectModel(libraryIdentifier.getProjectPath());
ComponentSpecContainer components = projectModel.find("components", ComponentSpecContainer.class);
if (components == null) {
return null;
}
String libraryName = libraryIdentifier.getLibraryName();
NativeLibrarySpec library = components.withType(NativeLibrarySpec.class).get(libraryName);
if (library == null) {
return null;
}
ModelMap<NativeBinarySpec> projectBinaries = library.getBinaries().withType(NativeBinarySpec.class);
DomainObjectSet<NativeLibraryBinary> binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
for (NativeBinarySpec nativeBinarySpec : projectBinaries.values()) {
binaries.add((NativeLibraryBinary) nativeBinarySpec);
}
return binaries;
}
use of org.gradle.api.Nullable in project gradle by gradle.
the class DefaultPluginManager method addPluginInternal.
// if the plugin has already been added
@Nullable
private Runnable addPluginInternal(final PluginImplementation<?> plugin) {
final Class<?> pluginClass = plugin.asClass();
if (plugins.containsKey(pluginClass)) {
return null;
}
plugins.put(pluginClass, plugin);
return new Runnable() {
@Override
public void run() {
// Take a copy because adding to an idMappings value may result in new mappings being added (i.e. ConcurrentModificationException)
Iterable<PluginId> pluginIds = Lists.newArrayList(idMappings.keySet());
for (PluginId id : pluginIds) {
if (plugin.isAlsoKnownAs(id)) {
idMappings.get(id).add(new PluginWithId(id, pluginClass));
}
}
}
};
}
use of org.gradle.api.Nullable in project gradle by gradle.
the class Signature method defaultDate.
@Nullable
private Date defaultDate() {
File file = getFile();
if (file == null) {
return null;
}
long modified = file.lastModified();
if (modified == 0L) {
return null;
}
return new Date(modified);
}
Aggregations