Package org.gradle.api

Examples of org.gradle.api.JavaVersion


        testngOptionsMock = context.mock(TestNGOptions.class);
        idGeneratorMock = context.mock(IdGenerator.class);
        serviceRegistry = context.mock(ServiceRegistry.class);

        final JavaVersion sourceCompatibility = JavaVersion.VERSION_1_5;
        context.checking(new Expectations() {{
            allowing(projectMock).getProjectDir(); will(returnValue(new File("projectDir")));
            allowing(projectMock).property("sourceCompatibility"); will(returnValue(sourceCompatibility));
            allowing(testMock).getTestClassesDir();will(returnValue(testClassesDir));
            allowing(testMock).getClasspath();will(returnValue(classpathMock));
View Full Code Here


        singletonRegistry.close();
        singletonRegistry = new ConnectorServiceRegistry();
    }

    private static void assertJava6() {
        JavaVersion javaVersion = JavaVersion.current();
        if (!javaVersion.isJava6Compatible()) {
            throw UnsupportedJavaRuntimeException.usingUnsupportedVersion("Gradle Tooling API", JavaVersion.VERSION_1_6);
        }
    }
View Full Code Here

        builder.setCommandLine(parameters.getEffectiveJavaExecutable(), "-version");
        builder.setStandardOutput(new ByteArrayOutputStream());
        builder.setErrorOutput(outputStream);
        builder.build().start().waitForFinish().assertNormalExitValue();

        JavaVersion javaVersion = parseJavaVersionCommandOutput(new BufferedReader(new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray()))));
        if (!javaVersion.isJava6Compatible()) {
            throw UnsupportedJavaRuntimeException.configuredWithUnsupportedVersion("Gradle", JavaVersion.VERSION_1_6, javaVersion);
        }
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.JavaVersion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.