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
@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
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
@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
@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
@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
@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
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
@Model
NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) {
    return components.withType(JvmLibrarySpec.class);
}
 
Example 9
@Model
BinaryNamingSchemeBuilder binaryNamingSchemeBuilder() {
    return new DefaultBinaryNamingSchemeBuilder();
}
 
Example 10
@Model
JavaToolChainRegistry javaToolChain(ServiceRegistry serviceRegistry) {
    JavaToolChainInternal toolChain = serviceRegistry.get(JavaToolChainInternal.class);
    return new DefaultJavaToolChainRegistry(toolChain);
}
 
Example 11
@Model
LanguageRegistry languages(ExtensionContainer extensions) {
    return extensions.getByType(LanguageRegistry.class);
}
 
Example 12
@Model
PlatformContainer platforms(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultPlatformContainer.class, Platform.class, instantiator);
}
 
Example 13
@Model
ProjectSourceSet sources(ExtensionContainer extensions) {
    return extensions.getByType(ProjectSourceSet.class);
}
 
Example 14
@Model
PublishingExtension publishing(ExtensionContainer extensions) {
    return extensions.getByType(PublishingExtension.class);
}
 
Example 15
@Model
ProjectPublicationRegistry projectPublicationRegistry(ServiceRegistry serviceRegistry) {
    return serviceRegistry.get(ProjectPublicationRegistry.class);
}
 
Example 16
@Model
TestSuiteContainer testSuites(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultTestSuiteContainer.class, instantiator);
}
 
Example 17
/**
 * Create "android" model block.
 */
@Model("android")
public void android(AndroidConfig androidModel) {
}
 
Example 18
@Model
public AndroidComponentModelSourceSet androidSources(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return new AndroidComponentModelSourceSet(instantiator);
}
 
Example 19
@Model(EXTRA_MODEL_INFO)
public ExtraModelInfo createExtraModelInfo(
        Project project,
        @NonNull @Path("isApplication") Boolean isApplication) {
    return new ExtraModelInfo(project, isApplication);
}
 
Example 20
@Model
NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) {
    return components.withType(JvmLibrarySpec.class);
}
 
Example 21
@Model
BinaryNamingSchemeBuilder binaryNamingSchemeBuilder() {
    return new DefaultBinaryNamingSchemeBuilder();
}
 
Example 22
@Model
JavaToolChainRegistry javaToolChain(ServiceRegistry serviceRegistry) {
    JavaToolChainInternal toolChain = serviceRegistry.get(JavaToolChainInternal.class);
    return new DefaultJavaToolChainRegistry(toolChain);
}
 
Example 23
@Model
LanguageRegistry languages(ExtensionContainer extensions) {
    return extensions.getByType(LanguageRegistry.class);
}
 
Example 24
@Model
PlatformContainer platforms(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultPlatformContainer.class, Platform.class, instantiator);
}
 
Example 25
@Model
ProjectSourceSet sources(ExtensionContainer extensions) {
    return extensions.getByType(ProjectSourceSet.class);
}
 
Example 26
@Model
PublishingExtension publishing(ExtensionContainer extensions) {
    return extensions.getByType(PublishingExtension.class);
}
 
Example 27
@Model
ProjectPublicationRegistry projectPublicationRegistry(ServiceRegistry serviceRegistry) {
    return serviceRegistry.get(ProjectPublicationRegistry.class);
}
 
Example 28
@Model
TestSuiteContainer testSuites(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultTestSuiteContainer.class, instantiator);
}