Polish
This commit is contained in:
@@ -40,7 +40,8 @@ import org.gradle.process.JavaExecSpec;
|
||||
*/
|
||||
public class BootRun extends DefaultTask {
|
||||
|
||||
private final PropertyState<String> mainClassName = getProject().property(String.class);
|
||||
private final PropertyState<String> mainClassName = getProject()
|
||||
.property(String.class);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private final PropertyState<List<String>> jvmArgs = (PropertyState<List<String>>) (Object) getProject()
|
||||
@@ -90,7 +91,8 @@ public class BootRun extends DefaultTask {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the main class to be executed using the given {@code mainClassNameProvider}.
|
||||
* Sets the name of the main class to be executed using the given
|
||||
* {@code mainClassNameProvider}.
|
||||
*
|
||||
* @param mainClassNameProvider provider of the main class name
|
||||
*/
|
||||
|
||||
@@ -92,14 +92,14 @@ public class PackagingDocumentationTests {
|
||||
@Test
|
||||
public void springBootDslMainClass() throws IOException {
|
||||
this.gradleBuild
|
||||
.script("src/main/gradle/packaging/spring-boot-dsl-main-class.gradle")
|
||||
.build("bootJar");
|
||||
.script("src/main/gradle/packaging/spring-boot-dsl-main-class.gradle")
|
||||
.build("bootJar");
|
||||
File file = new File(this.gradleBuild.getProjectDir(),
|
||||
"build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar");
|
||||
assertThat(file).isFile();
|
||||
try (JarFile jar = new JarFile(file)) {
|
||||
assertThat(jar.getManifest().getMainAttributes().getValue("Start-Class"))
|
||||
.isEqualTo("com.example.ExampleApplication");
|
||||
.isEqualTo("com.example.ExampleApplication");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RunningDocumentationTests {
|
||||
assertThat(this.gradleBuild
|
||||
.script("src/main/gradle/running/spring-boot-dsl-main-class-name.gradle")
|
||||
.build("configuredMainClass").getOutput())
|
||||
.contains("com.example.ExampleApplication");
|
||||
.contains("com.example.ExampleApplication");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -120,9 +120,9 @@ public abstract class AbstractBootArchiveIntegrationTests {
|
||||
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
try (JarFile jarFile = new JarFile(
|
||||
new File(this.gradleBuild.getProjectDir(), "build/libs")
|
||||
.listFiles()[0])) {
|
||||
.listFiles()[0])) {
|
||||
assertThat(jarFile.getManifest().getMainAttributes().getValue("Start-Class"))
|
||||
.isEqualTo("com.example.CustomMain");
|
||||
.isEqualTo("com.example.CustomMain");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,8 @@ public class GradleBuild implements TestRule {
|
||||
XPathFactory xPathFactory = XPathFactory.newInstance();
|
||||
XPath xpath = xPathFactory.newXPath();
|
||||
XPathExpression expr = xpath.compile(expression);
|
||||
String version = expr.evaluate(new InputSource(new FileReader(".flattened-pom.xml")));
|
||||
String version = expr
|
||||
.evaluate(new InputSource(new FileReader(".flattened-pom.xml")));
|
||||
return version;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
||||
Reference in New Issue
Block a user