org.gradle.model.Model Java Examples

The following examples show how to use org.gradle.model.Model. 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: BaseComponentModelPlugin.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@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 #2
Source File: BaseComponentModelPlugin.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@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 #3
Source File: ModelCreationRuleDefinitionHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private String determineModelName(MethodRuleDefinition<?> ruleDefinition) {
    String annotationValue = ruleDefinition.getAnnotation(Model.class).value();
    if (annotationValue == null || annotationValue.isEmpty()) {
        return ruleDefinition.getMethodName();
    } else {
        return annotationValue;
    }
}
 
Example #4
Source File: VisualStudioPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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 #5
Source File: VisualStudioPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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 #6
Source File: ModelCreationRuleDefinitionHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private String determineModelName(MethodRuleDefinition<?> ruleDefinition) {
    String annotationValue = ruleDefinition.getAnnotation(Model.class).value();
    if (annotationValue == null || annotationValue.isEmpty()) {
        return ruleDefinition.getMethodName();
    } else {
        return annotationValue;
    }
}
 
Example #7
Source File: AndroidComponentModelPlugin.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@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 #8
Source File: LanguageBasePlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
ProjectSourceSet sources(ExtensionContainer extensions) {
    return extensions.getByType(ProjectSourceSet.class);
}
 
Example #9
Source File: JvmComponentPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) {
    return components.withType(JvmLibrarySpec.class);
}
 
Example #10
Source File: JvmComponentPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
BinaryNamingSchemeBuilder binaryNamingSchemeBuilder() {
    return new DefaultBinaryNamingSchemeBuilder();
}
 
Example #11
Source File: JvmComponentPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
JavaToolChainRegistry javaToolChain(ServiceRegistry serviceRegistry) {
    JavaToolChainInternal toolChain = serviceRegistry.get(JavaToolChainInternal.class);
    return new DefaultJavaToolChainRegistry(toolChain);
}
 
Example #12
Source File: ComponentModelBasePlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
LanguageRegistry languages(ExtensionContainer extensions) {
    return extensions.getByType(LanguageRegistry.class);
}
 
Example #13
Source File: ComponentModelBasePlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
PlatformContainer platforms(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultPlatformContainer.class, Platform.class, instantiator);
}
 
Example #14
Source File: BaseComponentModelPlugin.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
@Model(EXTRA_MODEL_INFO)
public ExtraModelInfo createExtraModelInfo(
        Project project,
        @NonNull @Path("isApplication") Boolean isApplication) {
    return new ExtraModelInfo(project, isApplication);
}
 
Example #15
Source File: PublishingPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
PublishingExtension publishing(ExtensionContainer extensions) {
    return extensions.getByType(PublishingExtension.class);
}
 
Example #16
Source File: PublishingPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
ProjectPublicationRegistry projectPublicationRegistry(ServiceRegistry serviceRegistry) {
    return serviceRegistry.get(ProjectPublicationRegistry.class);
}
 
Example #17
Source File: NativeBinariesTestPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
TestSuiteContainer testSuites(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultTestSuiteContainer.class, instantiator);
}
 
Example #18
Source File: JvmComponentPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) {
    return components.withType(JvmLibrarySpec.class);
}
 
Example #19
Source File: AndroidComponentModelPlugin.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
@Model
public AndroidComponentModelSourceSet androidSources(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return new AndroidComponentModelSourceSet(instantiator);
}
 
Example #20
Source File: AndroidComponentModelPlugin.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Create "android" model block.
 */
@Model("android")
public void android(AndroidConfig androidModel) {
}
 
Example #21
Source File: NativeBinariesTestPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
TestSuiteContainer testSuites(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultTestSuiteContainer.class, instantiator);
}
 
Example #22
Source File: PublishingPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
ProjectPublicationRegistry projectPublicationRegistry(ServiceRegistry serviceRegistry) {
    return serviceRegistry.get(ProjectPublicationRegistry.class);
}
 
Example #23
Source File: PublishingPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
PublishingExtension publishing(ExtensionContainer extensions) {
    return extensions.getByType(PublishingExtension.class);
}
 
Example #24
Source File: LanguageBasePlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
ProjectSourceSet sources(ExtensionContainer extensions) {
    return extensions.getByType(ProjectSourceSet.class);
}
 
Example #25
Source File: ComponentModelBasePlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
PlatformContainer platforms(ServiceRegistry serviceRegistry) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    return instantiator.newInstance(DefaultPlatformContainer.class, Platform.class, instantiator);
}
 
Example #26
Source File: ComponentModelBasePlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
LanguageRegistry languages(ExtensionContainer extensions) {
    return extensions.getByType(LanguageRegistry.class);
}
 
Example #27
Source File: JvmComponentPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
JavaToolChainRegistry javaToolChain(ServiceRegistry serviceRegistry) {
    JavaToolChainInternal toolChain = serviceRegistry.get(JavaToolChainInternal.class);
    return new DefaultJavaToolChainRegistry(toolChain);
}
 
Example #28
Source File: JvmComponentPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Model
BinaryNamingSchemeBuilder binaryNamingSchemeBuilder() {
    return new DefaultBinaryNamingSchemeBuilder();
}