org.gradle.tooling.model.build.BuildEnvironment Java Examples

The following examples show how to use org.gradle.tooling.model.build.BuildEnvironment. 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: ModelMapping.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private static void addModelVersions(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "1.0-milestone-3");
    map.put(EclipseProject.class, "1.0-milestone-3");
    map.put(IdeaProject.class, "1.0-milestone-5");
    map.put(GradleProject.class, "1.0-milestone-5");
    map.put(BasicIdeaProject.class, "1.0-milestone-5");
    map.put(BuildEnvironment.class, "1.0-milestone-8");
    map.put(ProjectOutcomes.class, "1.2");
    map.put(Void.class, "1.0-milestone-3");
    map.put(GradleBuild.class, "1.8");
}
 
Example #2
Source File: BuildActionRunnerBackedConsumerConnection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(ProjectOutcomes.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(BuildEnvironment.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(Void.class);
}
 
Example #3
Source File: InternalConnectionBackedConsumerConnection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(Void.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(BuildEnvironment.class);
}
 
Example #4
Source File: ConnectionVersion4BackedConsumerConnection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public <T> T produceModel(Class<T> modelType, ConsumerOperationParameters operationParameters) {
    if (modelType == BuildEnvironment.class && !versionDetails.maySupportModel(BuildEnvironment.class)) {
        //early versions of provider do not support BuildEnvironment model
        //since we know the gradle version at least we can give back some result
        return adapter.adapt(modelType, new VersionOnlyBuildEnvironment(versionDetails.getVersion()), mapper);
    }
    if (!versionDetails.maySupportModel(modelType)) {
        //don't bother asking the provider for this model
        throw Exceptions.unsupportedModel(modelType, versionDetails.getVersion());
    }
    Class<? extends ProjectVersion3> protocolType = modelMapping.getProtocolType(modelType).asSubclass(ProjectVersion3.class);
    final ProjectVersion3 model = delegate.getModel(protocolType, operationParameters);
    return adapter.adapt(modelType, model, mapper);
}
 
Example #5
Source File: ModelMapping.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelNameMappings(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "org.gradle.tooling.model.eclipse.HierarchicalEclipseProject");
    map.put(EclipseProject.class, "org.gradle.tooling.model.eclipse.EclipseProject");
    map.put(IdeaProject.class, "org.gradle.tooling.model.idea.IdeaProject");
    map.put(GradleProject.class, "org.gradle.tooling.model.GradleProject");
    map.put(BasicIdeaProject.class, "org.gradle.tooling.model.idea.BasicIdeaProject");
    map.put(BuildEnvironment.class, "org.gradle.tooling.model.build.BuildEnvironment");
    map.put(ProjectOutcomes.class, "org.gradle.tooling.model.outcomes.ProjectOutcomes");
    map.put(Void.class, Void.class.getName());
}
 
Example #6
Source File: ModelMapping.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelToProtocolMappings(Map<Class<?>, Class<?>> map) {
    map.put(HierarchicalEclipseProject.class, HierarchicalEclipseProjectVersion1.class);
    map.put(EclipseProject.class, EclipseProjectVersion3.class);
    map.put(IdeaProject.class, InternalIdeaProject.class);
    map.put(GradleProject.class, InternalGradleProject.class);
    map.put(BasicIdeaProject.class, InternalBasicIdeaProject.class);
    map.put(BuildEnvironment.class, InternalBuildEnvironment.class);
    map.put(ProjectOutcomes.class, InternalProjectOutcomes.class);
    map.put(Void.class, Void.class);
}
 
Example #7
Source File: ModelMapping.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private static void addModelVersions(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "1.0-milestone-3");
    map.put(EclipseProject.class, "1.0-milestone-3");
    map.put(IdeaProject.class, "1.0-milestone-5");
    map.put(GradleProject.class, "1.0-milestone-5");
    map.put(BasicIdeaProject.class, "1.0-milestone-5");
    map.put(BuildEnvironment.class, "1.0-milestone-8");
    map.put(ProjectOutcomes.class, "1.2");
    map.put(Void.class, "1.0-milestone-3");
    map.put(GradleBuild.class, "1.8");
}
 
Example #8
Source File: BuildActionRunnerBackedConsumerConnection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(ProjectOutcomes.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(BuildEnvironment.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(Void.class);
}
 
Example #9
Source File: InternalConnectionBackedConsumerConnection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(Void.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(BuildEnvironment.class);
}
 
Example #10
Source File: ModelMapping.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelNameMappings(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "org.gradle.tooling.model.eclipse.HierarchicalEclipseProject");
    map.put(EclipseProject.class, "org.gradle.tooling.model.eclipse.EclipseProject");
    map.put(IdeaProject.class, "org.gradle.tooling.model.idea.IdeaProject");
    map.put(GradleProject.class, "org.gradle.tooling.model.GradleProject");
    map.put(BasicIdeaProject.class, "org.gradle.tooling.model.idea.BasicIdeaProject");
    map.put(BuildEnvironment.class, "org.gradle.tooling.model.build.BuildEnvironment");
    map.put(ProjectOutcomes.class, "org.gradle.tooling.model.outcomes.ProjectOutcomes");
    map.put(Void.class, Void.class.getName());
}
 
Example #11
Source File: ModelMapping.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelToProtocolMappings(Map<Class<?>, Class<?>> map) {
    map.put(HierarchicalEclipseProject.class, HierarchicalEclipseProjectVersion1.class);
    map.put(EclipseProject.class, EclipseProjectVersion3.class);
    map.put(IdeaProject.class, InternalIdeaProject.class);
    map.put(GradleProject.class, InternalGradleProject.class);
    map.put(BasicIdeaProject.class, InternalBasicIdeaProject.class);
    map.put(BuildEnvironment.class, InternalBuildEnvironment.class);
    map.put(ProjectOutcomes.class, InternalProjectOutcomes.class);
    map.put(Void.class, Void.class);
}
 
Example #12
Source File: ModelMapping.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private static void addModelVersions(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "1.0-milestone-3");
    map.put(EclipseProject.class, "1.0-milestone-3");
    map.put(IdeaProject.class, "1.0-milestone-5");
    map.put(GradleProject.class, "1.0-milestone-5");
    map.put(BasicIdeaProject.class, "1.0-milestone-5");
    map.put(BuildEnvironment.class, "1.0-milestone-8");
    map.put(ProjectOutcomes.class, "1.2");
    map.put(Void.class, "1.0-milestone-3");
    map.put(GradleBuild.class, "1.8");
}
 
Example #13
Source File: BuildActionRunnerBackedConsumerConnection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(ProjectOutcomes.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(BuildEnvironment.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(Void.class);
}
 
Example #14
Source File: InternalConnectionBackedConsumerConnection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(Void.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(BuildEnvironment.class);
}
 
Example #15
Source File: ConnectionVersion4BackedConsumerConnection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public <T> T produceModel(Class<T> modelType, ConsumerOperationParameters operationParameters) {
    if (modelType == BuildEnvironment.class && !versionDetails.maySupportModel(BuildEnvironment.class)) {
        //early versions of provider do not support BuildEnvironment model
        //since we know the gradle version at least we can give back some result
        return adapter.adapt(modelType, new VersionOnlyBuildEnvironment(versionDetails.getVersion()), mapper);
    }
    if (!versionDetails.maySupportModel(modelType)) {
        //don't bother asking the provider for this model
        throw Exceptions.unsupportedModel(modelType, versionDetails.getVersion());
    }
    Class<? extends ProjectVersion3> protocolType = modelMapping.getProtocolType(modelType).asSubclass(ProjectVersion3.class);
    final ProjectVersion3 model = delegate.getModel(protocolType, operationParameters);
    return adapter.adapt(modelType, model, mapper);
}
 
Example #16
Source File: ModelMapping.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelNameMappings(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "org.gradle.tooling.model.eclipse.HierarchicalEclipseProject");
    map.put(EclipseProject.class, "org.gradle.tooling.model.eclipse.EclipseProject");
    map.put(IdeaProject.class, "org.gradle.tooling.model.idea.IdeaProject");
    map.put(GradleProject.class, "org.gradle.tooling.model.GradleProject");
    map.put(BasicIdeaProject.class, "org.gradle.tooling.model.idea.BasicIdeaProject");
    map.put(BuildEnvironment.class, "org.gradle.tooling.model.build.BuildEnvironment");
    map.put(ProjectOutcomes.class, "org.gradle.tooling.model.outcomes.ProjectOutcomes");
    map.put(Void.class, Void.class.getName());
}
 
Example #17
Source File: ModelMapping.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelToProtocolMappings(Map<Class<?>, Class<?>> map) {
    map.put(HierarchicalEclipseProject.class, HierarchicalEclipseProjectVersion1.class);
    map.put(EclipseProject.class, EclipseProjectVersion3.class);
    map.put(IdeaProject.class, InternalIdeaProject.class);
    map.put(GradleProject.class, InternalGradleProject.class);
    map.put(BasicIdeaProject.class, InternalBasicIdeaProject.class);
    map.put(BuildEnvironment.class, InternalBuildEnvironment.class);
    map.put(ProjectOutcomes.class, InternalProjectOutcomes.class);
    map.put(Void.class, Void.class);
}
 
Example #18
Source File: ModelMapping.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private static void addModelVersions(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "1.0-milestone-3");
    map.put(EclipseProject.class, "1.0-milestone-3");
    map.put(IdeaProject.class, "1.0-milestone-5");
    map.put(GradleProject.class, "1.0-milestone-5");
    map.put(BasicIdeaProject.class, "1.0-milestone-5");
    map.put(BuildEnvironment.class, "1.0-milestone-8");
    map.put(ProjectOutcomes.class, "1.2");
    map.put(Void.class, "1.0-milestone-3");
    map.put(GradleBuild.class, "1.8");
}
 
Example #19
Source File: BuildActionRunnerBackedConsumerConnection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(ProjectOutcomes.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(BuildEnvironment.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(Void.class);
}
 
Example #20
Source File: InternalConnectionBackedConsumerConnection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean maySupportModel(Class<?> modelType) {
    return modelType.equals(Void.class)
            || modelType.equals(HierarchicalEclipseProject.class)
            || modelType.equals(EclipseProject.class)
            || modelType.equals(IdeaProject.class)
            || modelType.equals(BasicIdeaProject.class)
            || modelType.equals(GradleProject.class)
            || modelType.equals(BuildEnvironment.class);
}
 
Example #21
Source File: ModelMapping.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelNameMappings(Map<Class<?>, String> map) {
    map.put(HierarchicalEclipseProject.class, "org.gradle.tooling.model.eclipse.HierarchicalEclipseProject");
    map.put(EclipseProject.class, "org.gradle.tooling.model.eclipse.EclipseProject");
    map.put(IdeaProject.class, "org.gradle.tooling.model.idea.IdeaProject");
    map.put(GradleProject.class, "org.gradle.tooling.model.GradleProject");
    map.put(BasicIdeaProject.class, "org.gradle.tooling.model.idea.BasicIdeaProject");
    map.put(BuildEnvironment.class, "org.gradle.tooling.model.build.BuildEnvironment");
    map.put(ProjectOutcomes.class, "org.gradle.tooling.model.outcomes.ProjectOutcomes");
    map.put(Void.class, Void.class.getName());
}
 
Example #22
Source File: ModelMapping.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static void addModelToProtocolMappings(Map<Class<?>, Class<?>> map) {
    map.put(HierarchicalEclipseProject.class, HierarchicalEclipseProjectVersion1.class);
    map.put(EclipseProject.class, EclipseProjectVersion3.class);
    map.put(IdeaProject.class, InternalIdeaProject.class);
    map.put(GradleProject.class, InternalGradleProject.class);
    map.put(BasicIdeaProject.class, InternalBasicIdeaProject.class);
    map.put(BuildEnvironment.class, InternalBuildEnvironment.class);
    map.put(ProjectOutcomes.class, InternalProjectOutcomes.class);
    map.put(Void.class, Void.class);
}
 
Example #23
Source File: ConnectionVersion4BackedConsumerConnection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public <T> T run(Class<T> type, ConsumerOperationParameters operationParameters) throws UnsupportedOperationException, IllegalStateException {
    if (type.equals(BuildEnvironment.class)) {
        return adapter.adapt(type, doGetBuildEnvironment());
    }
    throw fail();
}
 
Example #24
Source File: ConnectionVersion4BackedConsumerConnection.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public <T> T run(Class<T> type, ConsumerOperationParameters operationParameters) throws UnsupportedOperationException, IllegalStateException {
    if (type.equals(BuildEnvironment.class)) {
        return adapter.adapt(type, doGetBuildEnvironment());
    }
    throw fail();
}