Java Code Examples for org.gradle.model.Model
The following examples show how to use
org.gradle.model.Model. 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: VisualStudioPlugin.java License: BSD 2-Clause "Simplified" License | 5 votes |
@Model public static VisualStudioExtensionInternal visualStudio(ServiceRegistry serviceRegistry) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); ProjectLocator projectLocator = serviceRegistry.get(ProjectLocator.class); FileResolver fileResolver = serviceRegistry.get(FileResolver.class); return instantiator.newInstance(DefaultVisualStudioExtension.class, instantiator, projectLocator, fileResolver); }
Example 2
Source Project: pushfish-android Source File: ModelCreationRuleDefinitionHandler.java License: BSD 2-Clause "Simplified" License | 5 votes |
private String determineModelName(MethodRuleDefinition<?> ruleDefinition) { String annotationValue = ruleDefinition.getAnnotation(Model.class).value(); if (annotationValue == null || annotationValue.isEmpty()) { return ruleDefinition.getMethodName(); } else { return annotationValue; } }
Example 3
Source Project: javaide Source File: AndroidComponentModelPlugin.java License: GNU General Public License v3.0 | 5 votes |
@Model public List<ProductFlavorCombo<ProductFlavor>> createProductFlavorCombo( @Path("android.productFlavors") ModelMap<ProductFlavor> productFlavors) { // TODO: Create custom product flavor container to manually configure flavor dimensions. Set<String> flavorDimensionList = Sets.newHashSet(); for (ProductFlavor flavor : productFlavors.values()) { if (flavor.getDimension() != null) { flavorDimensionList.add(flavor.getDimension()); } } return ProductFlavorCombo.createCombinations( Lists.newArrayList(flavorDimensionList), productFlavors.values()); }
Example 4
Source Project: javaide Source File: BaseComponentModelPlugin.java License: GNU General Public License v3.0 | 5 votes |
@Model(ANDROID_BUILDER) public AndroidBuilder createAndroidBuilder(Project project, ExtraModelInfo extraModelInfo) { String creator = "Android Gradle"; ILogger logger = new LoggerWrapper(project.getLogger()); return new AndroidBuilder(project.equals(project.getRootProject()) ? project.getName() : project.getPath(), creator, new GradleProcessExecutor(project), new GradleJavaProcessExecutor(project), extraModelInfo, logger, project.getLogger().isEnabled(LogLevel.INFO)); }
Example 5
Source Project: javaide Source File: BaseComponentModelPlugin.java License: GNU General Public License v3.0 | 5 votes |
@Model(ANDROID_CONFIG_ADAPTOR) public com.android.build.gradle.AndroidConfig createModelAdaptor( ServiceRegistry serviceRegistry, AndroidConfig androidExtension, Project project, @Path("isApplication") Boolean isApplication) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); return new AndroidConfigAdaptor(androidExtension, AndroidConfigHelper .createSourceSetsContainer(project, instantiator, !isApplication)); }
Example 6
Source Project: Pushjet-Android Source File: VisualStudioPlugin.java License: BSD 2-Clause "Simplified" License | 5 votes |
@Model public static VisualStudioExtensionInternal visualStudio(ServiceRegistry serviceRegistry) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); ProjectLocator projectLocator = serviceRegistry.get(ProjectLocator.class); FileResolver fileResolver = serviceRegistry.get(FileResolver.class); return instantiator.newInstance(DefaultVisualStudioExtension.class, instantiator, projectLocator, fileResolver); }
Example 7
Source Project: Pushjet-Android Source File: ModelCreationRuleDefinitionHandler.java License: BSD 2-Clause "Simplified" License | 5 votes |
private String determineModelName(MethodRuleDefinition<?> ruleDefinition) { String annotationValue = ruleDefinition.getAnnotation(Model.class).value(); if (annotationValue == null || annotationValue.isEmpty()) { return ruleDefinition.getMethodName(); } else { return annotationValue; } }
Example 8
Source Project: pushfish-android Source File: JvmComponentPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) { return components.withType(JvmLibrarySpec.class); }
Example 9
Source Project: pushfish-android Source File: JvmComponentPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model BinaryNamingSchemeBuilder binaryNamingSchemeBuilder() { return new DefaultBinaryNamingSchemeBuilder(); }
Example 10
Source Project: pushfish-android Source File: JvmComponentPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model JavaToolChainRegistry javaToolChain(ServiceRegistry serviceRegistry) { JavaToolChainInternal toolChain = serviceRegistry.get(JavaToolChainInternal.class); return new DefaultJavaToolChainRegistry(toolChain); }
Example 11
Source Project: pushfish-android Source File: ComponentModelBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model LanguageRegistry languages(ExtensionContainer extensions) { return extensions.getByType(LanguageRegistry.class); }
Example 12
Source Project: pushfish-android Source File: ComponentModelBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model PlatformContainer platforms(ServiceRegistry serviceRegistry) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); return instantiator.newInstance(DefaultPlatformContainer.class, Platform.class, instantiator); }
Example 13
Source Project: pushfish-android Source File: LanguageBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model ProjectSourceSet sources(ExtensionContainer extensions) { return extensions.getByType(ProjectSourceSet.class); }
Example 14
Source Project: pushfish-android Source File: PublishingPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model PublishingExtension publishing(ExtensionContainer extensions) { return extensions.getByType(PublishingExtension.class); }
Example 15
Source Project: pushfish-android Source File: PublishingPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model ProjectPublicationRegistry projectPublicationRegistry(ServiceRegistry serviceRegistry) { return serviceRegistry.get(ProjectPublicationRegistry.class); }
Example 16
Source Project: pushfish-android Source File: NativeBinariesTestPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model TestSuiteContainer testSuites(ServiceRegistry serviceRegistry) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); return instantiator.newInstance(DefaultTestSuiteContainer.class, instantiator); }
Example 17
Source Project: javaide Source File: AndroidComponentModelPlugin.java License: GNU General Public License v3.0 | 4 votes |
/** * Create "android" model block. */ @Model("android") public void android(AndroidConfig androidModel) { }
Example 18
Source Project: javaide Source File: AndroidComponentModelPlugin.java License: GNU General Public License v3.0 | 4 votes |
@Model public AndroidComponentModelSourceSet androidSources(ServiceRegistry serviceRegistry) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); return new AndroidComponentModelSourceSet(instantiator); }
Example 19
Source Project: javaide Source File: BaseComponentModelPlugin.java License: GNU General Public License v3.0 | 4 votes |
@Model(EXTRA_MODEL_INFO) public ExtraModelInfo createExtraModelInfo( Project project, @NonNull @Path("isApplication") Boolean isApplication) { return new ExtraModelInfo(project, isApplication); }
Example 20
Source Project: Pushjet-Android Source File: JvmComponentPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) { return components.withType(JvmLibrarySpec.class); }
Example 21
Source Project: Pushjet-Android Source File: JvmComponentPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model BinaryNamingSchemeBuilder binaryNamingSchemeBuilder() { return new DefaultBinaryNamingSchemeBuilder(); }
Example 22
Source Project: Pushjet-Android Source File: JvmComponentPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model JavaToolChainRegistry javaToolChain(ServiceRegistry serviceRegistry) { JavaToolChainInternal toolChain = serviceRegistry.get(JavaToolChainInternal.class); return new DefaultJavaToolChainRegistry(toolChain); }
Example 23
Source Project: Pushjet-Android Source File: ComponentModelBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model LanguageRegistry languages(ExtensionContainer extensions) { return extensions.getByType(LanguageRegistry.class); }
Example 24
Source Project: Pushjet-Android Source File: ComponentModelBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model PlatformContainer platforms(ServiceRegistry serviceRegistry) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); return instantiator.newInstance(DefaultPlatformContainer.class, Platform.class, instantiator); }
Example 25
Source Project: Pushjet-Android Source File: LanguageBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model ProjectSourceSet sources(ExtensionContainer extensions) { return extensions.getByType(ProjectSourceSet.class); }
Example 26
Source Project: Pushjet-Android Source File: PublishingPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model PublishingExtension publishing(ExtensionContainer extensions) { return extensions.getByType(PublishingExtension.class); }
Example 27
Source Project: Pushjet-Android Source File: PublishingPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model ProjectPublicationRegistry projectPublicationRegistry(ServiceRegistry serviceRegistry) { return serviceRegistry.get(ProjectPublicationRegistry.class); }
Example 28
Source Project: Pushjet-Android Source File: NativeBinariesTestPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model TestSuiteContainer testSuites(ServiceRegistry serviceRegistry) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); return instantiator.newInstance(DefaultTestSuiteContainer.class, instantiator); }