org.gradle.api.internal.file.TemporaryFileProvider Java Examples
The following examples show how to use
org.gradle.api.internal.file.TemporaryFileProvider.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FileCollectionBackedArchiveTextResource.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public FileCollectionBackedArchiveTextResource(final FileOperations fileOperations, final TemporaryFileProvider tempFileProvider, final FileCollection fileCollection, final String path, Charset charset) { super(tempFileProvider, new LazilyInitializedFileTree() { @Override public FileTree createDelegate() { File archiveFile = fileCollection.getSingleFile(); String fileExtension = Files.getFileExtension(archiveFile.getName()); FileTree archiveContents = fileExtension.equals("jar") || fileExtension.equals("zip") ? fileOperations.zipTree(archiveFile) : fileOperations.tarTree(archiveFile); PatternSet patternSet = new PatternSet(); patternSet.include(path); return archiveContents.matching(patternSet); } public TaskDependency getBuildDependencies() { return fileCollection.getBuildDependencies(); } }, charset); }
Example #2
Source File: HttpTransport.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public HttpTransport(String name, PasswordCredentials credentials, ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager) { super(name); HttpClientHelper http = new HttpClientHelper(new DefaultHttpSettings(credentials)); HttpResourceAccessor accessor = new HttpResourceAccessor(http); HttpResourceUploader uploader = new HttpResourceUploader(http); ProgressLoggingExternalResourceAccessor loggingAccessor = new ProgressLoggingExternalResourceAccessor(accessor, progressLoggerFactory); resourceAccessor = new DefaultCacheAwareExternalResourceAccessor(loggingAccessor, cachedExternalResourceIndex, timeProvider, temporaryFileProvider, cacheLockingManager); repository = new DefaultExternalResourceRepository( name, accessor, new ProgressLoggingExternalResourceUploader(uploader, progressLoggerFactory), new HttpResourceLister(accessor) ); }
Example #3
Source File: SftpTransport.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public SftpTransport(String name, PasswordCredentials credentials, ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider, SftpClientFactory sftpClientFactory, CacheLockingManager cacheLockingManager) { super(name); SftpResourceAccessor accessor = new SftpResourceAccessor(sftpClientFactory, credentials); SftpResourceUploader uploader = new SftpResourceUploader(sftpClientFactory, credentials); ProgressLoggingExternalResourceAccessor loggingAccessor = new ProgressLoggingExternalResourceAccessor(accessor, progressLoggerFactory); resourceAccessor = new DefaultCacheAwareExternalResourceAccessor(loggingAccessor, cachedExternalResourceIndex, timeProvider, temporaryFileProvider, cacheLockingManager); repository = new DefaultExternalResourceRepository( name, accessor, new ProgressLoggingExternalResourceUploader(uploader, progressLoggerFactory), new SftpResourceLister(sftpClientFactory, credentials) ); }
Example #4
Source File: SftpTransport.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public SftpTransport(String name, PasswordCredentials credentials, ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider, SftpClientFactory sftpClientFactory, CacheLockingManager cacheLockingManager) { super(name); SftpResourceAccessor accessor = new SftpResourceAccessor(sftpClientFactory, credentials); SftpResourceUploader uploader = new SftpResourceUploader(sftpClientFactory, credentials); ProgressLoggingExternalResourceAccessor loggingAccessor = new ProgressLoggingExternalResourceAccessor(accessor, progressLoggerFactory); resourceAccessor = new DefaultCacheAwareExternalResourceAccessor(loggingAccessor, cachedExternalResourceIndex, timeProvider, temporaryFileProvider, cacheLockingManager); repository = new DefaultExternalResourceRepository( name, accessor, new ProgressLoggingExternalResourceUploader(uploader, progressLoggerFactory), new SftpResourceLister(sftpClientFactory, credentials) ); }
Example #5
Source File: HttpTransport.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public HttpTransport(String name, PasswordCredentials credentials, ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager) { super(name); HttpClientHelper http = new HttpClientHelper(new DefaultHttpSettings(credentials)); HttpResourceAccessor accessor = new HttpResourceAccessor(http); HttpResourceUploader uploader = new HttpResourceUploader(http); ProgressLoggingExternalResourceAccessor loggingAccessor = new ProgressLoggingExternalResourceAccessor(accessor, progressLoggerFactory); resourceAccessor = new DefaultCacheAwareExternalResourceAccessor(loggingAccessor, cachedExternalResourceIndex, timeProvider, temporaryFileProvider, cacheLockingManager); repository = new DefaultExternalResourceRepository( name, accessor, new ProgressLoggingExternalResourceUploader(uploader, progressLoggerFactory), new HttpResourceLister(accessor) ); }
Example #6
Source File: FileCollectionBackedArchiveTextResource.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public FileCollectionBackedArchiveTextResource(final FileOperations fileOperations, final TemporaryFileProvider tempFileProvider, final FileCollection fileCollection, final String path, Charset charset) { super(tempFileProvider, new LazilyInitializedFileTree() { @Override public FileTree createDelegate() { File archiveFile = fileCollection.getSingleFile(); String fileExtension = Files.getFileExtension(archiveFile.getName()); FileTree archiveContents = fileExtension.equals("jar") || fileExtension.equals("zip") ? fileOperations.zipTree(archiveFile) : fileOperations.tarTree(archiveFile); PatternSet patternSet = new PatternSet(); patternSet.include(path); return archiveContents.matching(patternSet); } public TaskDependency getBuildDependencies() { return fileCollection.getBuildDependencies(); } }, charset); }
Example #7
Source File: DependencyManagementBuildScopeServices.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
RepositoryTransportFactory createRepositoryTransportFactory(ProgressLoggerFactory progressLoggerFactory, LocalFileRepositoryArtifactCache localFileRepositoryArtifactCache, DownloadingRepositoryArtifactCache downloadingRepositoryArtifactCache, TemporaryFileProvider temporaryFileProvider, ByUrlCachedExternalResourceIndex externalResourceIndex, BuildCommencedTimeProvider buildCommencedTimeProvider) { return new RepositoryTransportFactory( progressLoggerFactory, localFileRepositoryArtifactCache, downloadingRepositoryArtifactCache, temporaryFileProvider, externalResourceIndex, buildCommencedTimeProvider ); }
Example #8
Source File: RepositoryTransportFactory.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public RepositoryTransportFactory(ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider, SftpClientFactory sftpClientFactory, CacheLockingManager cacheLockingManager) { this.progressLoggerFactory = progressLoggerFactory; this.temporaryFileProvider = temporaryFileProvider; this.cachedExternalResourceIndex = cachedExternalResourceIndex; this.timeProvider = timeProvider; this.sftpClientFactory = sftpClientFactory; this.cacheLockingManager = cacheLockingManager; }
Example #9
Source File: DependencyManagementBuildScopeServices.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
DownloadingRepositoryArtifactCache createDownloadingRepositoryArtifactCache(ArtifactIdentifierFileStore artifactIdentifierFileStore, ByUrlCachedExternalResourceIndex externalResourceIndex, TemporaryFileProvider temporaryFileProvider, CacheLockingManager cacheLockingManager) { return new DownloadingRepositoryArtifactCache(artifactIdentifierFileStore, externalResourceIndex, temporaryFileProvider, cacheLockingManager); }
Example #10
Source File: DownloadingRepositoryArtifactCache.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public DownloadingRepositoryArtifactCache(FileStore<ModuleVersionArtifactMetaData> fileStore, CachedExternalResourceIndex<String> artifactUrlCachedResolutionIndex, TemporaryFileProvider temporaryFileProvider, CacheLockingManager cacheLockingManager) { this.fileStore = fileStore; this.artifactUrlCachedResolutionIndex = artifactUrlCachedResolutionIndex; this.temporaryFileProvider = temporaryFileProvider; this.cacheLockingManager = cacheLockingManager; }
Example #11
Source File: DownloadingRepositoryCacheManager.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public DownloadingRepositoryCacheManager(String name, FileStore<ModuleVersionArtifactMetaData> fileStore, TemporaryFileProvider temporaryFileProvider, CacheLockingManager cacheLockingManager) { super(name); this.fileStore = fileStore; this.temporaryFileProvider = temporaryFileProvider; this.cacheLockingManager = cacheLockingManager; }
Example #12
Source File: DownloadingRepositoryCacheManager.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DownloadingRepositoryCacheManager(String name, FileStore<ModuleVersionArtifactMetaData> fileStore, TemporaryFileProvider temporaryFileProvider, CacheLockingManager cacheLockingManager) { super(name); this.fileStore = fileStore; this.temporaryFileProvider = temporaryFileProvider; this.cacheLockingManager = cacheLockingManager; }
Example #13
Source File: ProjectBuilderImpl.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public File prepareProjectDir(File projectDir) { if (projectDir == null) { TemporaryFileProvider temporaryFileProvider = new TmpDirTemporaryFileProvider(); projectDir = temporaryFileProvider.createTemporaryDirectory("gradle", "projectDir"); // TODO deleteOnExit won't clean up non-empty directories (and it leaks memory for long-running processes). projectDir.deleteOnExit(); } else { projectDir = GFileUtils.canonicalise(projectDir); } return projectDir; }
Example #14
Source File: DependencyManagementBuildScopeServices.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
LegacyDependencyResolverRepositoryFactory createCustomerResolverRepositoryFactory(ProgressLoggerFactory progressLoggerFactory, ArtifactIdentifierFileStore artifactIdentifierFileStore, TemporaryFileProvider temporaryFileProvider, CacheLockingManager cacheLockingManager) { return new CustomIvyResolverRepositoryFactory( progressLoggerFactory, new LocalFileRepositoryCacheManager("local"), new DownloadingRepositoryCacheManager( "downloading", artifactIdentifierFileStore, temporaryFileProvider, cacheLockingManager ) ); }
Example #15
Source File: ProjectBuilderImpl.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public File prepareProjectDir(File projectDir) { if (projectDir == null) { TemporaryFileProvider temporaryFileProvider = new TmpDirTemporaryFileProvider(); projectDir = temporaryFileProvider.createTemporaryDirectory("gradle", "projectDir"); // TODO deleteOnExit won't clean up non-empty directories (and it leaks memory for long-running processes). projectDir.deleteOnExit(); } else { projectDir = GFileUtils.canonicalise(projectDir); } return projectDir; }
Example #16
Source File: GroovyCompile.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public GroovyCompile() { ProjectInternal projectInternal = (ProjectInternal) getProject(); IsolatedAntBuilder antBuilder = getServices().get(IsolatedAntBuilder.class); ClassPathRegistry classPathRegistry = getServices().get(ClassPathRegistry.class); Factory<AntBuilder> antBuilderFactory = getServices().getFactory(AntBuilder.class); JavaCompilerFactory inProcessCompilerFactory = new InProcessJavaCompilerFactory(); tempFileProvider = projectInternal.getServices().get(TemporaryFileProvider.class); CompilerDaemonManager compilerDaemonManager = getServices().get(CompilerDaemonManager.class); InProcessCompilerDaemonFactory inProcessCompilerDaemonFactory = getServices().get(InProcessCompilerDaemonFactory.class); DefaultJavaCompilerFactory javaCompilerFactory = new DefaultJavaCompilerFactory(projectInternal, antBuilderFactory, inProcessCompilerFactory, compilerDaemonManager); GroovyCompilerFactory groovyCompilerFactory = new GroovyCompilerFactory(projectInternal, antBuilder, classPathRegistry, javaCompilerFactory, compilerDaemonManager, inProcessCompilerDaemonFactory); Compiler<GroovyJavaJointCompileSpec> delegatingCompiler = new DelegatingGroovyCompiler(groovyCompilerFactory); compiler = new CleaningGroovyCompiler(delegatingCompiler, getOutputs()); }
Example #17
Source File: DependencyManagementBuildScopeServices.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
RepositoryTransportFactory createRepositoryTransportFactory(ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, ByUrlCachedExternalResourceIndex externalResourceIndex, BuildCommencedTimeProvider buildCommencedTimeProvider, SftpClientFactory sftpClientFactory, CacheLockingManager cacheLockingManager) { return new RepositoryTransportFactory( progressLoggerFactory, temporaryFileProvider, externalResourceIndex, buildCommencedTimeProvider, sftpClientFactory, cacheLockingManager ); }
Example #18
Source File: RepositoryTransportFactory.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public RepositoryTransportFactory(ProgressLoggerFactory progressLoggerFactory, RepositoryArtifactCache localCacheManager, RepositoryArtifactCache downloadingCacheManager, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider) { this.progressLoggerFactory = progressLoggerFactory; this.localCacheManager = localCacheManager; this.downloadingCacheManager = downloadingCacheManager; this.temporaryFileProvider = temporaryFileProvider; this.cachedExternalResourceIndex = cachedExternalResourceIndex; this.timeProvider = timeProvider; }
Example #19
Source File: DependencyManagementBuildScopeServices.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
LegacyDependencyResolverRepositoryFactory createCustomerResolverRepositoryFactory(ProgressLoggerFactory progressLoggerFactory, ArtifactIdentifierFileStore artifactIdentifierFileStore, TemporaryFileProvider temporaryFileProvider, CacheLockingManager cacheLockingManager) { return new CustomIvyResolverRepositoryFactory( progressLoggerFactory, new LocalFileRepositoryCacheManager("local"), new DownloadingRepositoryCacheManager( "downloading", artifactIdentifierFileStore, temporaryFileProvider, cacheLockingManager ) ); }
Example #20
Source File: ProjectBuilderImpl.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public File prepareProjectDir(File projectDir) { if (projectDir == null) { TemporaryFileProvider temporaryFileProvider = new TmpDirTemporaryFileProvider(); projectDir = temporaryFileProvider.createTemporaryDirectory("gradle", "projectDir"); // TODO deleteOnExit won't clean up non-empty directories (and it leaks memory for long-running processes). projectDir.deleteOnExit(); } else { projectDir = GFileUtils.canonicalise(projectDir); } return projectDir; }
Example #21
Source File: GroovyCompile.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public GroovyCompile() { ProjectInternal projectInternal = (ProjectInternal) getProject(); IsolatedAntBuilder antBuilder = getServices().get(IsolatedAntBuilder.class); ClassPathRegistry classPathRegistry = getServices().get(ClassPathRegistry.class); Factory<AntBuilder> antBuilderFactory = getServices().getFactory(AntBuilder.class); JavaCompilerFactory inProcessCompilerFactory = new InProcessJavaCompilerFactory(); tempFileProvider = projectInternal.getServices().get(TemporaryFileProvider.class); CompilerDaemonManager compilerDaemonManager = getServices().get(CompilerDaemonManager.class); InProcessCompilerDaemonFactory inProcessCompilerDaemonFactory = getServices().get(InProcessCompilerDaemonFactory.class); DefaultJavaCompilerFactory javaCompilerFactory = new DefaultJavaCompilerFactory(projectInternal, antBuilderFactory, inProcessCompilerFactory, compilerDaemonManager); GroovyCompilerFactory groovyCompilerFactory = new GroovyCompilerFactory(projectInternal, antBuilder, classPathRegistry, javaCompilerFactory, compilerDaemonManager, inProcessCompilerDaemonFactory); Compiler<GroovyJavaJointCompileSpec> delegatingCompiler = new DelegatingGroovyCompiler(groovyCompilerFactory); compiler = new CleaningGroovyCompiler(delegatingCompiler, getOutputs()); }
Example #22
Source File: DefaultExternalResourceRepository.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultExternalResourceRepository(String name, ExternalResourceAccessor accessor, ExternalResourceUploader uploader, ExternalResourceLister lister, TemporaryFileProvider temporaryFileProvider, CacheAwareExternalResourceAccessor cacheAwareAccessor) { this.name = name; this.accessor = accessor; this.uploader = uploader; this.lister = lister; this.temporaryFileProvider = temporaryFileProvider; this.cacheAwareAccessor = cacheAwareAccessor; }
Example #23
Source File: HttpTransport.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private ExternalResourceRepository createRepository(PasswordCredentials credentials, ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider) { HttpClientHelper http = new HttpClientHelper(new DefaultHttpSettings(credentials)); HttpResourceAccessor accessor = new HttpResourceAccessor(http); HttpResourceUploader uploader = new HttpResourceUploader(http); ProgressLoggingExternalResourceAccessor loggingAccessor = new ProgressLoggingExternalResourceAccessor(accessor, progressLoggerFactory); return new DefaultExternalResourceRepository( name, accessor, new ProgressLoggingExternalResourceUploader(uploader, progressLoggerFactory), new HttpResourceLister(accessor), temporaryFileProvider, new DefaultCacheAwareExternalResourceAccessor(loggingAccessor, cachedExternalResourceIndex, timeProvider) ); }
Example #24
Source File: CompressFileOperationsImpl.java From gradle-plugins with MIT License | 5 votes |
public CompressFileOperationsImpl(ProjectInternal project) { fileOperations = project.getFileOperations(); temporaryFileProvider = project.getServices().get(TemporaryFileProvider.class); fileHasher = project.getServices().get(FileHasher.class); fileSystem = project.getServices().get(FileSystem.class); directoryFileTreeFactory = project.getServices().get(DirectoryFileTreeFactory.class); patternSetFactory = project.getServices().getFactory(PatternSet.class); }
Example #25
Source File: CompressFileOperationsImpl.java From gradle-plugins with MIT License | 5 votes |
public CompressFileOperationsImpl(ProjectInternal project) { fileOperations = project.getFileOperations(); temporaryFileProvider = project.getServices().get(TemporaryFileProvider.class); fileHasher = project.getServices().get(FileHasher.class); fileSystem = project.getServices().get(FileSystem.class); directoryFileTreeFactory = project.getServices().get(DirectoryFileTreeFactory.class); patternSetFactory = project.getServices().getFactory(PatternSet.class); }
Example #26
Source File: HttpTransport.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public HttpTransport(String name, PasswordCredentials credentials, RepositoryArtifactCache repositoryCacheManager, ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider) { this.name = name; this.repositoryCacheManager = repositoryCacheManager; repository = createRepository(credentials, progressLoggerFactory, temporaryFileProvider, cachedExternalResourceIndex, timeProvider); }
Example #27
Source File: RepositoryTransportFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public RepositoryTransportFactory(ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider, SftpClientFactory sftpClientFactory, CacheLockingManager cacheLockingManager) { this.progressLoggerFactory = progressLoggerFactory; this.temporaryFileProvider = temporaryFileProvider; this.cachedExternalResourceIndex = cachedExternalResourceIndex; this.timeProvider = timeProvider; this.sftpClientFactory = sftpClientFactory; this.cacheLockingManager = cacheLockingManager; }
Example #28
Source File: DependencyManagementBuildScopeServices.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
RepositoryTransportFactory createRepositoryTransportFactory(ProgressLoggerFactory progressLoggerFactory, TemporaryFileProvider temporaryFileProvider, ByUrlCachedExternalResourceIndex externalResourceIndex, BuildCommencedTimeProvider buildCommencedTimeProvider, SftpClientFactory sftpClientFactory, CacheLockingManager cacheLockingManager) { return new RepositoryTransportFactory( progressLoggerFactory, temporaryFileProvider, externalResourceIndex, buildCommencedTimeProvider, sftpClientFactory, cacheLockingManager ); }
Example #29
Source File: DefaultCacheAwareExternalResourceAccessor.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultCacheAwareExternalResourceAccessor(ExternalResourceAccessor delegate, CachedExternalResourceIndex<String> cachedExternalResourceIndex, BuildCommencedTimeProvider timeProvider, TemporaryFileProvider temporaryFileProvider, CacheLockingManager cacheLockingManager) { this.delegate = delegate; this.cachedExternalResourceIndex = cachedExternalResourceIndex; this.timeProvider = timeProvider; this.temporaryFileProvider = temporaryFileProvider; this.cacheLockingManager = cacheLockingManager; }
Example #30
Source File: ProjectBuilderImpl.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public File prepareProjectDir(File projectDir) { if (projectDir == null) { TemporaryFileProvider temporaryFileProvider = new TmpDirTemporaryFileProvider(); projectDir = temporaryFileProvider.createTemporaryDirectory("gradle", "projectDir"); // TODO deleteOnExit won't clean up non-empty directories (and it leaks memory for long-running processes). projectDir.deleteOnExit(); } else { projectDir = GFileUtils.canonicalise(projectDir); } return projectDir; }