@TaskAction void generate() { File jarFileDestination = getJarFile(); File unixScript = getScriptFile(); FileResolver resolver = getFileLookup().getFileResolver(unixScript.getParentFile()); String jarFileRelativePath = resolver.resolveAsRelativePath(jarFileDestination); writeProperties(getPropertiesFile()); writeWrapperTo(jarFileDestination); StartScriptGenerator generator = new StartScriptGenerator(); generator.setApplicationName("Gradle"); generator.setMainClassName(GradleWrapperMain.class.getName()); generator.setClasspath(WrapUtil.toList(jarFileRelativePath)); generator.setOptsEnvironmentVar("GRADLE_OPTS"); generator.setExitEnvironmentVar("GRADLE_EXIT_CONSOLE"); generator.setAppNameSystemProperty("org.gradle.appname"); generator.setScriptRelPath(unixScript.getName()); generator.generateUnixScript(unixScript); generator.generateWindowsScript(getBatchScript()); }
@Defaults public static void addToolChain(NativeToolChainRegistryInternal toolChainRegistry, ServiceRegistry serviceRegistry) { final FileResolver fileResolver = serviceRegistry.get(FileResolver.class); final ExecActionFactory execActionFactory = serviceRegistry.get(ExecActionFactory.class); final Instantiator instantiator = serviceRegistry.get(Instantiator.class); final BuildOperationProcessor buildOperationProcessor = serviceRegistry.get(BuildOperationProcessor.class); final CompilerMetaDataProviderFactory metaDataProviderFactory = serviceRegistry.get(CompilerMetaDataProviderFactory.class); toolChainRegistry.registerFactory(Gcc.class, new NamedDomainObjectFactory<Gcc>() { public Gcc create(String name) { return instantiator.newInstance(GccToolChain.class, instantiator, name, buildOperationProcessor, OperatingSystem.current(), fileResolver, execActionFactory, metaDataProviderFactory); } }); toolChainRegistry.registerDefaultToolChain(GccToolChain.DEFAULT_NAME, Gcc.class); }
public Project createProject(String name, File inputProjectDir, File gradleUserHomeDir) { File projectDir = prepareProjectDir(inputProjectDir); final File homeDir = new File(projectDir, "gradleHome"); StartParameter startParameter = new StartParameter(); File userHomeDir = gradleUserHomeDir == null ? new File(projectDir, "userHome") : FileUtils.canonicalize(gradleUserHomeDir); startParameter.setGradleUserHomeDir(userHomeDir); NativeServices.initialize(userHomeDir); ServiceRegistry topLevelRegistry = new TestBuildScopeServices(getUserHomeServices(userHomeDir), startParameter, homeDir); GradleInternal gradle = CLASS_GENERATOR.newInstance(DefaultGradle.class, null, startParameter, topLevelRegistry.get(ServiceRegistryFactory.class)); DefaultProjectDescriptor projectDescriptor = new DefaultProjectDescriptor(null, name, projectDir, new DefaultProjectDescriptorRegistry(), topLevelRegistry.get(FileResolver.class)); ClassLoaderScope baseScope = gradle.getClassLoaderScope(); ClassLoaderScope rootProjectScope = baseScope.createChild("root-project"); ProjectInternal project = topLevelRegistry.get(IProjectFactory.class).createProject(projectDescriptor, null, gradle, rootProjectScope, baseScope); gradle.setRootProject(project); gradle.setDefaultProject(project); return project; }
public DefaultPlayToolChain(FileResolver fileResolver, WorkerDaemonManager compilerDaemonManager, ConfigurationContainer configurationContainer, DependencyHandler dependencyHandler, WorkerProcessFactory workerProcessBuilderFactory) { this.fileResolver = fileResolver; this.compilerDaemonManager = compilerDaemonManager; this.configurationContainer = configurationContainer; this.dependencyHandler = dependencyHandler; this.workerProcessBuilderFactory = workerProcessBuilderFactory; }
protected ScriptHandlerFactory createScriptHandlerFactory() { return new DefaultScriptHandlerFactory( get(DependencyManagementServices.class), get(FileResolver.class), get(DependencyMetaDataProvider.class) ); }
@Model public static VisualStudioExtensionInternal visualStudio(ServiceRegistry serviceRegistry, ProjectIdentifier projectIdentifier) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); ProjectModelResolver projectModelResolver = serviceRegistry.get(ProjectModelResolver.class); FileResolver fileResolver = serviceRegistry.get(FileResolver.class); return instantiator.newInstance(DefaultVisualStudioExtension.class, projectIdentifier, instantiator, projectModelResolver, fileResolver); }
public DefaultMavenPomFactory(ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer conf2ScopeMappingContainer, PomDependenciesConverter pomDependenciesConverter, FileResolver fileResolver) { this.configurationContainer = configurationContainer; this.conf2ScopeMappingContainer = conf2ScopeMappingContainer; this.pomDependenciesConverter = pomDependenciesConverter; this.fileResolver = fileResolver; }
public DefaultDeployerFactory(MavenFactory mavenFactory, Factory<LoggingManagerInternal> loggingManagerFactory, FileResolver fileResolver, MavenPomMetaInfoProvider pomMetaInfoProvider, ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer scopeMapping, MavenSettingsProvider mavenSettingsProvider, LocalMavenRepositoryLocator mavenRepositoryLocator) { this.mavenFactory = mavenFactory; this.loggingManagerFactory = loggingManagerFactory; this.fileResolver = fileResolver; this.pomMetaInfoProvider = pomMetaInfoProvider; this.configurationContainer = configurationContainer; this.scopeMapping = scopeMapping; this.mavenSettingsProvider = mavenSettingsProvider; this.mavenRepositoryLocator = mavenRepositoryLocator; }
@Inject public MavenPublishPlugin(Instantiator instantiator, DependencyMetaDataProvider dependencyMetaDataProvider, FileResolver fileResolver, ProjectDependencyPublicationResolver projectDependencyResolver, FileCollectionFactory fileCollectionFactory) { this.instantiator = instantiator; this.dependencyMetaDataProvider = dependencyMetaDataProvider; this.fileResolver = fileResolver; this.projectDependencyResolver = projectDependencyResolver; this.fileCollectionFactory = fileCollectionFactory; }
@Inject public MavenPlugin(Factory<LoggingManagerInternal> loggingManagerFactory, FileResolver fileResolver, ProjectPublicationRegistry publicationRegistry, ProjectConfigurationActionContainer configurationActionContainer, MavenSettingsProvider mavenSettingsProvider, LocalMavenRepositoryLocator mavenRepositoryLocator) { this.loggingManagerFactory = loggingManagerFactory; this.fileResolver = fileResolver; this.publicationRegistry = publicationRegistry; this.configurationActionContainer = configurationActionContainer; this.mavenSettingsProvider = mavenSettingsProvider; this.mavenRepositoryLocator = mavenRepositoryLocator; }
public JavaLibraryProjectInitDescriptor(TemplateOperationFactory templateOperationFactory, FileResolver fileResolver, TemplateLibraryVersionProvider libraryVersionProvider, ProjectInitDescriptor globalSettingsDescriptor, DocumentationRegistry documentationRegistry) { super(templateOperationFactory, fileResolver, libraryVersionProvider, globalSettingsDescriptor, documentationRegistry); }
public DefaultSourceSetContainer(FileResolver fileResolver, TaskResolver taskResolver, Instantiator classGenerator, SourceDirectorySetFactory sourceDirectorySetFactory) { super(SourceSet.class, classGenerator, new Namer<SourceSet>() { public String determineName(SourceSet ss) { return ss.getName(); } }); this.fileResolver = fileResolver; this.taskResolver = taskResolver; this.instantiator = classGenerator; this.sourceDirectorySetFactory = sourceDirectorySetFactory; }
public DefaultPlayToolProvider(FileResolver fileResolver, WorkerDaemonManager compilerDaemonManager, WorkerProcessFactory workerProcessBuilderFactory, PlayPlatform targetPlatform, Set<File> twirlClasspath, Set<File> routesClasspath, Set<File> javaScriptClasspath) { this.fileResolver = fileResolver; this.compilerDaemonManager = compilerDaemonManager; this.workerProcessBuilderFactory = workerProcessBuilderFactory; this.targetPlatform = targetPlatform; this.twirlClasspath = twirlClasspath; this.routesClasspath = routesClasspath; this.javaScriptClasspath = javaScriptClasspath; // validate that the targetPlatform is valid PlayMajorVersion.forPlatform(targetPlatform); }
DefaultPluginRepositoryFactory createPluginRepositoryFactory(PluginResolutionServiceResolver pluginResolutionServiceResolver, VersionSelectorScheme versionSelectorScheme, final DependencyManagementServices dependencyManagementServices, final FileResolver fileResolver, final DependencyMetaDataProvider dependencyMetaDataProvider, Instantiator instantiator, final AuthenticationSchemeRegistry authenticationSchemeRegistry) { final Factory<DependencyResolutionServices> dependencyResolutionServicesFactory = makeDependencyResolutionServicesFactory( dependencyManagementServices, fileResolver, dependencyMetaDataProvider); return instantiator.newInstance( DefaultPluginRepositoryFactory.class, pluginResolutionServiceResolver, dependencyResolutionServicesFactory, versionSelectorScheme, instantiator, authenticationSchemeRegistry); }
private Factory<DependencyResolutionServices> makeDependencyResolutionServicesFactory(final DependencyManagementServices dependencyManagementServices, final FileResolver fileResolver, final DependencyMetaDataProvider dependencyMetaDataProvider) { return new Factory<DependencyResolutionServices>() { public DependencyResolutionServices create() { return dependencyManagementServices.create(fileResolver, dependencyMetaDataProvider, makeUnknownProjectFinder(), new BasicDomainObjectContext()); } }; }
@Override public MavenPluginRepository maven(Action<? super MavenPluginRepository> configurationAction, FileResolver fileResolver) { AuthenticationContainer authenticationContainer = makeAuthenticationContainer(instantiator, authenticationSchemeRegistry); AuthenticationSupportedInternal delegate = new AuthenticationSupporter(instantiator, authenticationContainer); DefaultMavenPluginRepository mavenPluginRepository = instantiator.newInstance( DefaultMavenPluginRepository.class, fileResolver, dependencyResolutionServicesFactory.create(), versionSelectorScheme, delegate); configurationAction.execute(mavenPluginRepository); return mavenPluginRepository; }
@Override public IvyPluginRepository ivy(Action<? super IvyPluginRepository> configurationAction, FileResolver fileResolver) { AuthenticationContainer authenticationContainer = makeAuthenticationContainer(instantiator, authenticationSchemeRegistry); AuthenticationSupportedInternal delegate = new AuthenticationSupporter(instantiator, authenticationContainer); DefaultIvyPluginRepository ivyPluginRepository = instantiator.newInstance( DefaultIvyPluginRepository.class, fileResolver, dependencyResolutionServicesFactory.create(), versionSelectorScheme, delegate); configurationAction.execute(ivyPluginRepository); return ivyPluginRepository; }
AbstractPluginRepository( String defaultName, FileResolver fileResolver, DependencyResolutionServices dependencyResolutionServices, VersionSelectorScheme versionSelectorScheme, AuthenticationSupportedInternal authenticationSupport) { this.authenticationSupport = authenticationSupport; this.fileResolver = fileResolver; this.dependencyResolutionServices = dependencyResolutionServices; this.versionSelectorScheme = versionSelectorScheme; this.name = defaultName; this.hasYieldedArtifactRepository = new AtomicBoolean(false); }
public DefaultIvyArtifactRepository(FileResolver fileResolver, RepositoryTransportFactory transportFactory, LocallyAvailableResourceFinder<ModuleComponentArtifactMetadata> locallyAvailableResourceFinder, Instantiator instantiator, FileStore<ModuleComponentArtifactIdentifier> artifactFileStore, AuthenticationContainer authenticationContainer, IvyContextManager ivyContextManager) { super(instantiator, authenticationContainer); this.fileResolver = fileResolver; this.transportFactory = transportFactory; this.locallyAvailableResourceFinder = locallyAvailableResourceFinder; this.artifactFileStore = artifactFileStore; this.additionalPatternsLayout = new AdditionalPatternsRepositoryLayout(fileResolver); this.layout = new GradleRepositoryLayout(); this.metaDataProvider = new MetaDataProvider(); this.instantiator = instantiator; this.ivyContextManager = ivyContextManager; }
public DefaultMavenArtifactRepository(FileResolver fileResolver, RepositoryTransportFactory transportFactory, LocallyAvailableResourceFinder<ModuleComponentArtifactMetadata> locallyAvailableResourceFinder, Instantiator instantiator, FileStore<ModuleComponentArtifactIdentifier> artifactFileStore, MetaDataParser<MutableMavenModuleResolveMetadata> pomParser, AuthenticationContainer authenticationContainer) { super(instantiator, authenticationContainer); this.fileResolver = fileResolver; this.transportFactory = transportFactory; this.locallyAvailableResourceFinder = locallyAvailableResourceFinder; this.artifactFileStore = artifactFileStore; this.pomParser = pomParser; }
public DefaultFlatDirArtifactRepository(FileResolver fileResolver, RepositoryTransportFactory transportFactory, LocallyAvailableResourceFinder<ModuleComponentArtifactMetadata> locallyAvailableResourceFinder, FileStore<ModuleComponentArtifactIdentifier> artifactFileStore, IvyContextManager ivyContextManager) { this.fileResolver = fileResolver; this.transportFactory = transportFactory; this.locallyAvailableResourceFinder = locallyAvailableResourceFinder; this.artifactFileStore = artifactFileStore; this.ivyContextManager = ivyContextManager; }
public ResolvedPattern(String rawPattern, FileResolver fileResolver) { // get rid of the ivy [] token, as [ ] are not valid URI characters int pos = rawPattern.indexOf('['); String basePath = pos < 0 ? rawPattern : rawPattern.substring(0, pos); this.baseUri = fileResolver.resolveUri(basePath); this.pattern = pos < 0 ? "" : rawPattern.substring(pos); scheme = baseUri.getScheme().toLowerCase(); absolutePattern = constructAbsolutePattern(baseUri, pattern); }
public DependencyResolutionServices create(FileResolver fileResolver, DependencyMetaDataProvider dependencyMetaDataProvider, ProjectFinder projectFinder, DomainObjectContext domainObjectContext) { DefaultServiceRegistry services = new DefaultServiceRegistry(parent); services.add(FileResolver.class, fileResolver); services.add(DependencyMetaDataProvider.class, dependencyMetaDataProvider); services.add(ProjectFinder.class, projectFinder); services.add(DomainObjectContext.class, domainObjectContext); services.addProvider(new DependencyResolutionScopeServices()); return services.get(DependencyResolutionServices.class); }
public DependencyClassPathNotationConverter( Instantiator instantiator, ClassPathRegistry classPathRegistry, FileResolver fileResolver, RuntimeShadedJarFactory runtimeShadedJarFactory, CurrentGradleInstallation currentGradleInstallation) { this.instantiator = instantiator; this.classPathRegistry = classPathRegistry; this.fileResolver = fileResolver; this.runtimeShadedJarFactory = runtimeShadedJarFactory; this.currentGradleInstallation = currentGradleInstallation; }
AbstractGccCompatibleToolChain(String name, BuildOperationProcessor buildOperationProcessor, OperatingSystem operatingSystem, FileResolver fileResolver, ExecActionFactory execActionFactory, ToolSearchPath tools, CompilerMetaDataProvider metaDataProvider, Instantiator instantiator) { super(name, buildOperationProcessor, operatingSystem, fileResolver); this.execActionFactory = execActionFactory; this.toolSearchPath = tools; this.metaDataProvider = metaDataProvider; this.instantiator = instantiator; target(new Intel32Architecture()); target(new Intel64Architecture()); configInsertLocation = 0; }
@Defaults public static void addToolChain(NativeToolChainRegistryInternal toolChainRegistry, ServiceRegistry serviceRegistry) { final FileResolver fileResolver = serviceRegistry.get(FileResolver.class); final ExecActionFactory execActionFactory = serviceRegistry.get(ExecActionFactory.class); final Instantiator instantiator = serviceRegistry.get(Instantiator.class); final BuildOperationProcessor buildOperationProcessor = serviceRegistry.get(BuildOperationProcessor.class); final CompilerMetaDataProviderFactory metaDataProviderFactory = serviceRegistry.get(CompilerMetaDataProviderFactory.class); toolChainRegistry.registerFactory(Clang.class, new NamedDomainObjectFactory<Clang>() { public Clang create(String name) { return instantiator.newInstance(ClangToolChain.class, name, buildOperationProcessor, OperatingSystem.current(), fileResolver, execActionFactory, metaDataProviderFactory, instantiator); } }); toolChainRegistry.registerDefaultToolChain(ClangToolChain.DEFAULT_NAME, Clang.class); }
public JavaExecHandleBuilder(FileResolver fileResolver) { super(fileResolver); this.fileResolver = fileResolver; javaOptions = new DefaultJavaForkOptions(fileResolver); classpath = new DefaultConfigurableFileCollection(fileResolver, null); executable(javaOptions.getExecutable()); }
@Inject public IvyPublishPlugin(Instantiator instantiator, DependencyMetaDataProvider dependencyMetaDataProvider, FileResolver fileResolver, ProjectDependencyPublicationResolver projectDependencyResolver, FileCollectionFactory fileCollectionFactory) { this.instantiator = instantiator; this.dependencyMetaDataProvider = dependencyMetaDataProvider; this.fileResolver = fileResolver; this.projectDependencyResolver = projectDependencyResolver; this.fileCollectionFactory = fileCollectionFactory; }
@Override protected CopySpecInternal createRootSpec() { Instantiator instantiator = getInstantiator(); FileResolver fileResolver = getFileResolver(); return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec()); }
public CompositeTaskOutputPropertySpec(TaskOutputs taskOutputs, String taskName, FileResolver resolver, CacheableTaskOutputFilePropertySpec.OutputType outputType, Object[] paths) { super(taskOutputs); this.taskName = taskName; this.resolver = resolver; this.outputType = outputType; this.paths = (paths != null && paths.length == 1) ? paths[0] : paths; }
public DefaultTaskInputs(FileResolver resolver, TaskInternal task, TaskMutator taskMutator) { this.resolver = resolver; this.task = task; this.taskMutator = taskMutator; String taskName = task.getName(); this.allInputFiles = new TaskInputUnionFileCollection("task '" + taskName + "' input files", false, filePropertiesInternal); this.allSourceFiles = new TaskInputUnionFileCollection("task '" + taskName + "' source files", true, filePropertiesInternal); }
public DefaultTaskOutputs(FileResolver resolver, final TaskInternal task, TaskMutator taskMutator) { this.resolver = resolver; this.task = task; this.taskMutator = taskMutator; final DefaultTaskDependency buildDependencies = new DefaultTaskDependency(); buildDependencies.add(task); this.allOutputFiles = new TaskOutputUnionFileCollection("task '" + task.getName() + "' output files", buildDependencies); }
public TaskPropertyFileCollection(String taskName, String type, TaskFilePropertySpec property, FileResolver resolver, Object paths) { this.taskName = taskName; this.type = type; this.property = property; this.resolver = resolver; this.paths = paths; }
public DefaultCacheableTaskOutputFilePropertySpec(TaskOutputs taskOutputs, String taskName, FileResolver resolver, OutputType outputType, Object path) { super(taskOutputs); this.resolver = resolver; this.outputType = outputType; this.path = path; this.files = new TaskPropertyFileCollection(taskName, "output", this, resolver, path); }
public DefaultScriptHandlerFactory(DependencyManagementServices dependencyManagementServices, FileResolver fileResolver, DependencyMetaDataProvider dependencyMetaDataProvider) { this.dependencyManagementServices = dependencyManagementServices; this.fileResolver = fileResolver; this.dependencyMetaDataProvider = dependencyMetaDataProvider; }
public DefaultSourceSetOutput(String sourceSetDisplayName, FileResolver fileResolver, TaskResolver taskResolver) { this.fileResolver = fileResolver; String displayName = sourceSetDisplayName + " classes"; outputDirectories = new DefaultConfigurableFileCollection(displayName, fileResolver, taskResolver, new Callable() { public Object call() throws Exception { return getClassesDir(); } }, new Callable() { public Object call() throws Exception { return getResourcesDir(); } }); dirs = new DefaultConfigurableFileCollection("dirs", fileResolver, taskResolver); }
public DefaultObjectConfigurationAction(FileResolver resolver, ScriptPluginFactory configurerFactory, ScriptHandlerFactory scriptHandlerFactory, ClassLoaderScope classLoaderScope, Object defaultTarget) { this.resolver = resolver; this.configurerFactory = configurerFactory; this.scriptHandlerFactory = scriptHandlerFactory; this.classLoaderScope = classLoaderScope; this.defaultTarget = defaultTarget; }
public SimpleReport(String name, String displayName, OutputType outputType, FileResolver fileResolver) { this.name = name; this.displayName = displayName; this.fileResolver = fileResolver; this.outputType = outputType; }
public DefaultJavaExecAction(FileResolver fileResolver) { super(fileResolver); }