use of org.gradle.api.internal.file.DefaultFileOperations in project gradle by gradle.
the class DefaultScript method init.
@Override
public void init(final Object target, ServiceRegistry services) {
super.init(target, services);
this.__scriptServices = services;
loggingManager = services.get(LoggingManager.class);
Instantiator instantiator = services.get(Instantiator.class);
FileLookup fileLookup = services.get(FileLookup.class);
DirectoryFileTreeFactory directoryFileTreeFactory = services.get(DirectoryFileTreeFactory.class);
if (target instanceof FileOperations) {
fileOperations = (FileOperations) target;
} else {
File sourceFile = getScriptSource().getResource().getLocation().getFile();
if (sourceFile != null) {
fileOperations = new DefaultFileOperations(fileLookup.getFileResolver(sourceFile.getParentFile()), null, null, instantiator, fileLookup, directoryFileTreeFactory);
} else {
fileOperations = new DefaultFileOperations(fileLookup.getFileResolver(), null, null, instantiator, fileLookup, directoryFileTreeFactory);
}
}
processOperations = (ProcessOperations) fileOperations;
}
Aggregations