Java Code Examples for org.gradle.internal.reflect.Instantiator
The following examples show how to use
org.gradle.internal.reflect.Instantiator. These examples are extracted from open source projects.
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 Project: pushfish-android Source File: PluginResolvers.java License: BSD 2-Clause "Simplified" License | 6 votes |
public static PluginResolver jcenterGradleOfficial(Instantiator instantiator, DependencyResolutionServices dependencyResolutionServices, final CacheRepository cacheRepository) { Supplier<PersistentIndexedCache<PluginRequest, String>> cacheSupplier = Suppliers.wrap( Suppliers.ofQuietlyClosed(new Factory<PersistentCache>() { public PersistentCache create() { return cacheRepository.cache("plugins").withLockOptions(LockOptionsBuilder.mode(FileLockManager.LockMode.Exclusive)).open(); } }), new Transformer<PersistentIndexedCache<PluginRequest, String>, PersistentCache>() { public PersistentIndexedCache<PluginRequest, String> transform(PersistentCache original) { PersistentIndexedCacheParameters<PluginRequest, String> cacheParams = new PersistentIndexedCacheParameters<PluginRequest, String>("jcenter", new PluginRequestSerializer(), BaseSerializerFactory.STRING_SERIALIZER); return original.createCache(cacheParams); } }); final JCenterPluginMapper mapper = new JCenterPluginMapper(cacheSupplier); return new ModuleMappingPluginResolver("jcenter plugin resolver", dependencyResolutionServices, instantiator, mapper, new JCenterRepositoryConfigurer()) { @Override public String getDescriptionForNotFoundMessage() { return String.format("Gradle Bintray Plugin Repository (listing: %s)", mapper.getBintrayRepoUrl()); } }; }
Example 2
Source Project: pushfish-android Source File: OsgiPluginConvention.java License: BSD 2-Clause "Simplified" License | 6 votes |
private OsgiManifest createDefaultOsgiManifest(final ProjectInternal project) { OsgiManifest osgiManifest = project.getServices().get(Instantiator.class).newInstance(DefaultOsgiManifest.class, project.getFileResolver()); ConventionMapping mapping = ((IConventionAware) osgiManifest).getConventionMapping(); final OsgiHelper osgiHelper = new OsgiHelper(); mapping.map("version", new Callable<Object>() { public Object call() throws Exception { return osgiHelper.getVersion(project.getVersion().toString()); } }); mapping.map("name", new Callable<Object>() { public Object call() throws Exception { return project.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName(); } }); mapping.map("symbolicName", new Callable<Object>() { public Object call() throws Exception { return osgiHelper.getBundleSymbolicName(project); } }); return osgiManifest; }
Example 3
Source Project: pushfish-android Source File: TaskExecutionServices.java License: BSD 2-Clause "Simplified" License | 6 votes |
TaskArtifactStateRepository createTaskArtifactStateRepository(Instantiator instantiator, TaskArtifactStateCacheAccess cacheAccess, StartParameter startParameter, FileSnapshotter fileSnapshotter) { FileCollectionSnapshotter fileCollectionSnapshotter = new DefaultFileCollectionSnapshotter(fileSnapshotter, cacheAccess); FileCollectionSnapshotter outputFilesSnapshotter = new OutputFilesCollectionSnapshotter(fileCollectionSnapshotter, new RandomLongIdGenerator(), cacheAccess); SerializerRegistry<FileCollectionSnapshot> serializerRegistry = new DefaultSerializerRegistry<FileCollectionSnapshot>(); fileCollectionSnapshotter.registerSerializers(serializerRegistry); outputFilesSnapshotter.registerSerializers(serializerRegistry); TaskHistoryRepository taskHistoryRepository = new CacheBackedTaskHistoryRepository(cacheAccess, new CacheBackedFileSnapshotRepository(cacheAccess, serializerRegistry.build(), new RandomLongIdGenerator())); return new ShortCircuitTaskArtifactStateRepository( startParameter, instantiator, new DefaultTaskArtifactStateRepository( taskHistoryRepository, instantiator, outputFilesSnapshotter, fileCollectionSnapshotter ) ); }
Example 4
Source Project: pushfish-android Source File: MicrosoftVisualCppPlugin.java License: BSD 2-Clause "Simplified" License | 6 votes |
@Mutate public static void addGccToolChain(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 OperatingSystem operatingSystem = serviceRegistry.get(OperatingSystem.class); final VisualStudioLocator visualStudioLocator = serviceRegistry.get(VisualStudioLocator.class); final WindowsSdkLocator windowsSdkLocator = serviceRegistry.get(WindowsSdkLocator.class); toolChainRegistry.registerFactory(VisualCpp.class, new NamedDomainObjectFactory<VisualCpp>() { public VisualCpp create(String name) { return instantiator.newInstance(VisualCppToolChain.class, name, operatingSystem, fileResolver, execActionFactory, visualStudioLocator, windowsSdkLocator, instantiator); } }); toolChainRegistry.registerDefaultToolChain(VisualCppToolChain.DEFAULT_NAME, VisualCpp.class); }
Example 5
Source Project: pushfish-android Source File: PluginResolverFactory.java License: BSD 2-Clause "Simplified" License | 5 votes |
public PluginResolverFactory(PluginRegistry pluginRegistry, Instantiator instantiator, DependencyManagementServices dependencyManagementServices, FileResolver fileResolver, DependencyMetaDataProvider dependencyMetaDataProvider, DocumentationRegistry documentationRegistry, CacheRepository cacheRepository) { this.pluginRegistry = pluginRegistry; this.instantiator = instantiator; this.dependencyManagementServices = dependencyManagementServices; this.fileResolver = fileResolver; this.dependencyMetaDataProvider = dependencyMetaDataProvider; this.documentationRegistry = documentationRegistry; this.cacheRepository = cacheRepository; }
Example 6
Source Project: pushfish-android Source File: TestNGTestFramework.java License: BSD 2-Clause "Simplified" License | 5 votes |
public TestNGTestFramework(Test testTask, DefaultTestFilter filter, Instantiator instantiator) { this.testTask = testTask; this.filter = filter; options = instantiator.newInstance(TestNGOptions.class, testTask.getProject().getProjectDir()); options.setAnnotationsOnSourceCompatibility(JavaVersion.toVersion(testTask.getProject().property("sourceCompatibility"))); conventionMapOutputDirectory(options, testTask.getReports().getHtml()); detector = new TestNGDetector(new ClassFileExtractionManager(testTask.getTemporaryDirFactory())); }
Example 7
Source Project: pushfish-android Source File: DefaultTaskArtifactStateRepository.java License: BSD 2-Clause "Simplified" License | 5 votes |
public DefaultTaskArtifactStateRepository(TaskHistoryRepository taskHistoryRepository, Instantiator instantiator, FileCollectionSnapshotter outputFilesSnapshotter, FileCollectionSnapshotter inputFilesSnapshotter) { this.taskHistoryRepository = taskHistoryRepository; this.instantiator = instantiator; this.outputFilesSnapshotter = outputFilesSnapshotter; this.inputFilesSnapshotter = inputFilesSnapshotter; }
Example 8
Source Project: pushfish-android Source File: Copy.java License: BSD 2-Clause "Simplified" License | 5 votes |
@Override protected CopySpecInternal createRootSpec() { Instantiator instantiator = getInstantiator(); FileResolver fileResolver = getFileResolver(); return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec()); }
Example 9
Source Project: pushfish-android Source File: BuildScopeServices.java License: BSD 2-Clause "Simplified" License | 5 votes |
protected SettingsProcessor createSettingsProcessor() { return new PropertiesLoadingSettingsProcessor( new ScriptEvaluatingSettingsProcessor( get(ScriptPluginFactory.class), get(ScriptHandlerFactory.class), new SettingsFactory( get(Instantiator.class), get(ServiceRegistryFactory.class) ), get(IGradlePropertiesLoader.class)), get(IGradlePropertiesLoader.class)); }
Example 10
Source Project: pushfish-android Source File: NativeComponentModelPlugin.java License: BSD 2-Clause "Simplified" License | 5 votes |
@Mutate public void registerNativePlatformFactory(PlatformContainer platforms, ServiceRegistry serviceRegistry) { final Instantiator instantiator = serviceRegistry.get(Instantiator.class); NamedDomainObjectFactory<NativePlatform> nativePlatformFactory = new NamedDomainObjectFactory<NativePlatform>() { public NativePlatform create(String name) { return instantiator.newInstance(DefaultNativePlatform.class, name); } }; //TODO freekh: remove cast/this comment when registerDefault exists on interface ((DefaultPlatformContainer) platforms).registerDefaultFactory(nativePlatformFactory); platforms.registerFactory(NativePlatform.class, nativePlatformFactory); }
Example 11
Source Project: pushfish-android Source File: DependencyClassPathNotationParser.java License: BSD 2-Clause "Simplified" License | 5 votes |
public DependencyClassPathNotationParser(Instantiator instantiator, ClassPathRegistry classPathRegistry, FileResolver fileResolver) { super(DependencyFactory.ClassPathNotation.class); this.instantiator = instantiator; this.classPathRegistry = classPathRegistry; this.fileResolver = fileResolver; }
Example 12
Source Project: pushfish-android Source File: DefaultIvyPublication.java License: BSD 2-Clause "Simplified" License | 5 votes |
public DefaultIvyPublication( String name, Instantiator instantiator, IvyPublicationIdentity publicationIdentity, NotationParser<Object, IvyArtifact> ivyArtifactNotationParser, ProjectDependencyPublicationResolver projectDependencyResolver ) { this.name = name; this.publicationIdentity = publicationIdentity; this.projectDependencyResolver = projectDependencyResolver; configurations = instantiator.newInstance(DefaultIvyConfigurationContainer.class, instantiator); ivyArtifacts = instantiator.newInstance(DefaultIvyArtifactSet.class, name, ivyArtifactNotationParser); ivyDependencies = instantiator.newInstance(DefaultIvyDependencySet.class); descriptor = instantiator.newInstance(DefaultIvyModuleDescriptor.class, this); }
Example 13
Source Project: pushfish-android Source File: ModuleMappingPluginResolver.java License: BSD 2-Clause "Simplified" License | 5 votes |
public ModuleMappingPluginResolver(String name, DependencyResolutionServices dependencyResolutionServices, Instantiator instantiator, Mapper mapper, Action<? super RepositoryHandler> repositoriesConfigurer) { this.name = name; this.dependencyResolutionServices = dependencyResolutionServices; this.instantiator = instantiator; this.mapper = mapper; this.repositoriesConfigurer = repositoriesConfigurer; }
Example 14
Source Project: pushfish-android Source File: DefaultCopySpec.java License: BSD 2-Clause "Simplified" License | 5 votes |
public DefaultCopySpec(FileResolver resolver, Instantiator instantiator) { this.fileResolver = resolver; this.instantiator = instantiator; sourcePaths = new LinkedHashSet<Object>(); childSpecs = new ArrayList<CopySpecInternal>(); patternSet = new PatternSet(); duplicatesStrategy = null; }
Example 15
Source Project: pushfish-android Source File: DefaultFileOperations.java License: BSD 2-Clause "Simplified" License | 5 votes |
public DefaultFileOperations(FileResolver fileResolver, TaskResolver taskResolver, TemporaryFileProvider temporaryFileProvider, Instantiator instantiator, FileLookup fileLookup) { this.fileResolver = fileResolver; this.taskResolver = taskResolver; this.temporaryFileProvider = temporaryFileProvider; this.instantiator = instantiator; this.deleteAction = new DeleteActionImpl(fileResolver); this.resourceHandler = new DefaultResourceHandler(this, temporaryFileProvider); fileCopier = new FileCopier(this.instantiator, this.fileResolver, fileLookup); fileSystem = fileLookup.getFileSystem(); }
Example 16
Source Project: pushfish-android Source File: DefaultConfigurationContainer.java License: BSD 2-Clause "Simplified" License | 5 votes |
public DefaultConfigurationContainer(ConfigurationResolver resolver, Instantiator instantiator, DomainObjectContext context, ListenerManager listenerManager, DependencyMetaDataProvider dependencyMetaDataProvider) { super(Configuration.class, instantiator, new Configuration.Namer()); this.resolver = resolver; this.instantiator = instantiator; this.context = context; this.listenerManager = listenerManager; this.dependencyMetaDataProvider = dependencyMetaDataProvider; }
Example 17
Source Project: pushfish-android Source File: NativeComponentModelPlugin.java License: BSD 2-Clause "Simplified" License | 5 votes |
private DefaultRepositories(final Instantiator instantiator, final FileResolver fileResolver, final Action<PrebuiltLibrary> binaryFactory) { super(ArtifactRepository.class, instantiator, new ArtifactRepositoryNamer()); registerFactory(PrebuiltLibraries.class, new NamedDomainObjectFactory<PrebuiltLibraries>() { public PrebuiltLibraries create(String name) { return instantiator.newInstance(DefaultPrebuiltLibraries.class, name, instantiator, fileResolver, binaryFactory); } }); }
Example 18
Source Project: pushfish-android Source File: DefaultDependencyManagementServices.java License: BSD 2-Clause "Simplified" License | 5 votes |
BaseRepositoryFactory createBaseRepositoryFactory(LocalMavenRepositoryLocator localMavenRepositoryLocator, Instantiator instantiator, FileResolver fileResolver, RepositoryTransportFactory repositoryTransportFactory, LocallyAvailableResourceFinder<ModuleComponentArtifactMetaData> locallyAvailableResourceFinder, ResolverStrategy resolverStrategy, ArtifactIdentifierFileStore artifactIdentifierFileStore) { return new DefaultBaseRepositoryFactory( localMavenRepositoryLocator, fileResolver, instantiator, repositoryTransportFactory, locallyAvailableResourceFinder, resolverStrategy, artifactIdentifierFileStore ); }
Example 19
Source Project: pushfish-android Source File: DefaultDependencyManagementServices.java License: BSD 2-Clause "Simplified" License | 5 votes |
ConfigurationContainerInternal createConfigurationContainer(Instantiator instantiator, ConfigurationResolver configurationResolver, DomainObjectContext domainObjectContext, ListenerManager listenerManager, DependencyMetaDataProvider metaDataProvider) { return instantiator.newInstance(DefaultConfigurationContainer.class, configurationResolver, instantiator, domainObjectContext, listenerManager, metaDataProvider); }
Example 20
Source Project: pushfish-android Source File: BuildScopeServices.java License: BSD 2-Clause "Simplified" License | 5 votes |
protected PluginResolverFactory createPluginResolverFactory() { return new PluginResolverFactory( get(PluginRegistry.class), get(Instantiator.class), get(DependencyManagementServices.class), get(FileResolver.class), new DependencyMetaDataProviderImpl(), get(DocumentationRegistry.class), get(CacheRepository.class) ); }
Example 21
Source Project: pushfish-android Source File: PrebuiltLibraryInitializer.java License: BSD 2-Clause "Simplified" License | 5 votes |
public PrebuiltLibraryInitializer(Instantiator instantiator, Collection<? extends Platform> allPlatforms, Collection<? extends BuildType> allBuildTypes, Collection<? extends Flavor> allFlavors) { this.instantiator = instantiator; this.allPlatforms.addAll(allPlatforms); this.allBuildTypes.addAll(allBuildTypes); this.allFlavors.addAll(allFlavors); }
Example 22
Source Project: pushfish-android Source File: AbstractGccCompatibleToolChain.java License: BSD 2-Clause "Simplified" License | 5 votes |
AbstractGccCompatibleToolChain(String name, OperatingSystem operatingSystem, FileResolver fileResolver, ExecActionFactory execActionFactory, ToolSearchPath tools, CompilerMetaDataProvider metaDataProvider, Instantiator instantiator) { super(name, operatingSystem, fileResolver); this.execActionFactory = execActionFactory; this.toolSearchPath = tools; this.metaDataProvider = metaDataProvider; this.instantiator = instantiator; target(new ToolChainDefaultArchitecture()); target(new Intel32Architecture()); target(new Intel64Architecture()); configInsertLocation = 0; }
Example 23
Source Project: pushfish-android Source File: DefaultDependencyManagementServices.java License: BSD 2-Clause "Simplified" License | 5 votes |
ConfigurationContainerInternal createConfigurationContainer(Instantiator instantiator, ConfigurationResolver configurationResolver, DomainObjectContext domainObjectContext, ListenerManager listenerManager, DependencyMetaDataProvider metaDataProvider) { return instantiator.newInstance(DefaultConfigurationContainer.class, configurationResolver, instantiator, domainObjectContext, listenerManager, metaDataProvider); }
Example 24
Source Project: pushfish-android Source File: DefaultTestLoggingContainer.java License: BSD 2-Clause "Simplified" License | 5 votes |
public DefaultTestLoggingContainer(Instantiator instantiator) { for (LogLevel level: LogLevel.values()) { perLevelTestLogging.put(level, instantiator.newInstance(DefaultTestLogging.class)); } setEvents(EnumSet.of(TestLogEvent.FAILED)); setExceptionFormat(TestExceptionFormat.SHORT); getInfo().setEvents(EnumSet.of(TestLogEvent.FAILED, TestLogEvent.SKIPPED, TestLogEvent.STANDARD_OUT, TestLogEvent.STANDARD_ERROR)); getInfo().setStackTraceFilters(EnumSet.of(TestStackTraceFilter.TRUNCATE)); getDebug().setEvents(EnumSet.allOf(TestLogEvent.class)); getDebug().setMinGranularity(0); getDebug().setStackTraceFilters(EnumSet.noneOf(TestStackTraceFilter.class)); }
Example 25
Source Project: pushfish-android Source File: ReflectiveNamedDomainObjectFactory.java License: BSD 2-Clause "Simplified" License | 4 votes |
public ReflectiveNamedDomainObjectFactory(Class<? extends T> type, Instantiator instantiator, Object... extraArgs) { this.type = type; this.instantiator = instantiator; this.extraArgs = extraArgs; }
Example 26
Source Project: pushfish-android Source File: ThreadGlobalInstantiator.java License: BSD 2-Clause "Simplified" License | 4 votes |
public static Instantiator get() { Stack<Instantiator> stack = getStack(); return stack.empty() ? null : stack.peek(); }
Example 27
Source Project: pushfish-android Source File: GenerateBuildDashboard.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Inject protected Instantiator getInstantiator() { throw new UnsupportedOperationException(); }
Example 28
Source Project: pushfish-android Source File: NativeExecutableSpecFactory.java License: BSD 2-Clause "Simplified" License | 4 votes |
public NativeExecutableSpecFactory(Instantiator instantiator, ProjectSourceSet sources, Project project) { this.instantiator = instantiator; this.sources = sources; this.project = project; }
Example 29
Source Project: pushfish-android Source File: DefaultFlavorContainer.java License: BSD 2-Clause "Simplified" License | 4 votes |
public DefaultFlavorContainer(Instantiator instantiator) { super(Flavor.class, instantiator); }
Example 30
Source Project: pushfish-android Source File: AbstractNamedDomainObjectContainer.java License: BSD 2-Clause "Simplified" License | 4 votes |
protected AbstractNamedDomainObjectContainer(Class<? extends T> type, Instantiator instantiator) { super(type, instantiator, Named.Namer.forType(type)); }