failure.assertHasCause("broken");
}
@Test
public void canDeclareClasspathInBuildScript() {
ArtifactBuilder builder = artifactBuilder();
builder.sourceFile("org/gradle/test/ImportedClass.java").writelns(
"package org.gradle.test;",
"public class ImportedClass { }"
);
builder.sourceFile("org/gradle/test/StaticImportedClass.java").writelns(
"package org.gradle.test;",
"public class StaticImportedClass { public static int someValue = 12; }"
);
builder.sourceFile("org/gradle/test/StaticImportedFieldClass.java").writelns(
"package org.gradle.test;",
"public class StaticImportedFieldClass { public static int anotherValue = 4; }"
);
builder.sourceFile("org/gradle/test2/OnDemandImportedClass.java").writelns(
"package org.gradle.test2;",
"public class OnDemandImportedClass { }"
);
builder.buildJar(testFile("repo/test-1.3.jar"));
testFile("build.gradle").writelns(
"import org.gradle.test.ImportedClass",
"import static org.gradle.test.StaticImportedClass.*",
"import static org.gradle.test.StaticImportedFieldClass.anotherValue",