Final polish before 1.0.0.RC1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,11 +19,12 @@ package org.springframework.boot.gradle
|
||||
import org.springframework.boot.loader.tools.Layout
|
||||
import org.springframework.boot.loader.tools.Layouts
|
||||
|
||||
|
||||
/**
|
||||
* Gradle DSL Extension for 'Spring Boot'. Most of the time Spring Boot can guess the
|
||||
* settings in this extension, but occasionally you might need to explicitly set one
|
||||
* or two of them. E.g.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* apply plugin: "spring-boot"
|
||||
* springBoot {
|
||||
@@ -53,7 +54,7 @@ public class SpringBootPluginExtension {
|
||||
String mainClass
|
||||
|
||||
/**
|
||||
* The name of the ivy configuration name to treat as 'provided' (when packaging
|
||||
* The name of the ivy configuration name to treat as 'provided' (when packaging
|
||||
* those dependencies in a separate path). If not specified 'providedRuntime' will
|
||||
* be used.
|
||||
*/
|
||||
@@ -73,15 +74,14 @@ public class SpringBootPluginExtension {
|
||||
* The layout of the archive if it can't be derived from the file extension.
|
||||
* Valid values are JAR, WAR, ZIP, DIR (for exploded zip file). ZIP and DIR
|
||||
* are actually synonymous, and should be used if there is no MANIFEST.MF
|
||||
* available, or if you want the MANIFEST.MF 'Main-Class' to be
|
||||
* PropertiesLauncher. Gradle will coerce literal String values to the
|
||||
* available, or if you want the MANIFEST.MF 'Main-Class' to be
|
||||
* PropertiesLauncher. Gradle will coerce literal String values to the
|
||||
* correct type.
|
||||
*/
|
||||
LayoutType layout;
|
||||
|
||||
/**
|
||||
* Convenience method for use in a custom task.
|
||||
*
|
||||
* @return the Layout to use or null if not explicitly set
|
||||
*/
|
||||
Layout convertLayout() {
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.gradle.task;
|
||||
|
||||
@@ -13,7 +28,7 @@ import org.springframework.boot.loader.tools.LibraryScope;
|
||||
|
||||
/**
|
||||
* Expose Gradle {@link Configuration}s as {@link Libraries}.
|
||||
*
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
class ProjectLibraries implements Libraries {
|
||||
@@ -26,7 +41,6 @@ class ProjectLibraries implements Libraries {
|
||||
|
||||
/**
|
||||
* Create a new {@link ProjectLibraries} instance of the specified {@link Project}.
|
||||
*
|
||||
* @param project the gradle project
|
||||
*/
|
||||
public ProjectLibraries(Project project) {
|
||||
@@ -35,7 +49,6 @@ class ProjectLibraries implements Libraries {
|
||||
|
||||
/**
|
||||
* Set the name of the provided configuration. Defaults to 'providedRuntime'.
|
||||
*
|
||||
* @param providedConfigurationName the providedConfigurationName to set
|
||||
*/
|
||||
public void setProvidedConfigurationName(String providedConfigurationName) {
|
||||
|
||||
@@ -95,8 +95,8 @@ public class RunApp extends DefaultTask {
|
||||
getLogger().info("Looking for main in: " + main.getOutput().getClassesDir());
|
||||
try {
|
||||
return MainClassFinder.findMainClass(main.getOutput().getClassesDir());
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Cannot find main class", e);
|
||||
} catch (IOException ex) {
|
||||
throw new IllegalStateException("Cannot find main class", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ import org.springframework.boot.loader.util.SystemPropertyUtils;
|
||||
* {@link Launcher} for archives with user-configured classpath and main class via a
|
||||
* properties file. This model is often more flexible and more amenable to creating
|
||||
* well-behaved OS-level services than a model based on executable jars.
|
||||
*
|
||||
* <p>
|
||||
* Looks in various places for a properties file to extract loader settings, defaulting to
|
||||
* <code>application.properties</code> either on the current classpath or in the current
|
||||
@@ -62,7 +61,6 @@ import org.springframework.boot.loader.util.SystemPropertyUtils;
|
||||
* <code>file:</code> or any valid URL). Once that file is located turns it into
|
||||
* Properties and extracts optional values (which can also be provided overridden as
|
||||
* System properties in case the file doesn't exist):
|
||||
*
|
||||
* <ul>
|
||||
* <li><code>loader.path</code>: a comma-separated list of directories to append to the
|
||||
* classpath (containing file resources and/or nested archives in *.jar or *.zip).
|
||||
@@ -345,7 +343,7 @@ public class PropertiesLauncher extends Launcher {
|
||||
try {
|
||||
return loaderClass.getConstructor(ClassLoader.class).newInstance(parent);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
catch (NoSuchMethodException ex) {
|
||||
// Ignore and try with URLs
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,11 +28,14 @@ import java.util.jar.Manifest;
|
||||
import org.springframework.boot.loader.AsciiBytes;
|
||||
|
||||
/**
|
||||
* Decorator to apply an {@link Archive.EntryFilter} to an existing {@link Archive}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class FilteredArchive extends Archive {
|
||||
|
||||
private Archive parent;
|
||||
|
||||
private EntryFilter filter;
|
||||
|
||||
public FilteredArchive(Archive parent, EntryFilter filter) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,14 +22,11 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* Helper class for resolving placeholders in texts. Usually applied to file paths.
|
||||
*
|
||||
* <p>
|
||||
* A text may contain {@code $ ...} placeholders, to be resolved as system properties:
|
||||
* e.g. {@code $ user.dir} . Default values can be supplied using the ":" separator
|
||||
* between key and value.
|
||||
*
|
||||
* <p>
|
||||
*
|
||||
* Adapted from Spring.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
@@ -40,13 +37,19 @@ import java.util.Set;
|
||||
*/
|
||||
public abstract class SystemPropertyUtils {
|
||||
|
||||
/** Prefix for system property placeholders: "${" */
|
||||
/**
|
||||
* Prefix for system property placeholders: "${"
|
||||
*/
|
||||
public static final String PLACEHOLDER_PREFIX = "${";
|
||||
|
||||
/** Suffix for system property placeholders: "}" */
|
||||
/**
|
||||
* Suffix for system property placeholders: "}"
|
||||
*/
|
||||
public static final String PLACEHOLDER_SUFFIX = "}";
|
||||
|
||||
/** Value separator for system property placeholders: ":" */
|
||||
/**
|
||||
* Value separator for system property placeholders: ":"
|
||||
*/
|
||||
public static final String VALUE_SEPARATOR = ":";
|
||||
|
||||
private static final String SIMPLE_PREFIX = PLACEHOLDER_PREFIX.substring(1);
|
||||
@@ -166,7 +169,6 @@ public abstract class SystemPropertyUtils {
|
||||
* Search the System properties and environment variables for a value with the
|
||||
* provided key. Environment variables in <code>UPPER_CASE</code> style are allowed
|
||||
* where System properties would normally be <code>lower.case</code>.
|
||||
*
|
||||
* @param key the key to resolve
|
||||
* @param text optional extra context for an error message if the key resolution fails
|
||||
* (e.g. if System properties are not accessible)
|
||||
|
||||
Reference in New Issue
Block a user