use of org.gradle.internal.hash.StreamHasher 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);
ExecFactory execFactory = services.get(ExecFactory.class);
DirectoryFileTreeFactory directoryFileTreeFactory = services.get(DirectoryFileTreeFactory.class);
StreamHasher streamHasher = services.get(StreamHasher.class);
FileHasher fileHasher = services.get(FileHasher.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, streamHasher, fileHasher, execFactory);
} else {
fileOperations = new DefaultFileOperations(fileLookup.getFileResolver(), null, null, instantiator, fileLookup, directoryFileTreeFactory, streamHasher, fileHasher, execFactory);
}
}
processOperations = (ProcessOperations) fileOperations;
providerFactory = services.get(ProviderFactory.class);
}
Aggregations