Skip to content

Commit

Permalink
Remove deprecated JVM platform classes and methods
Browse files Browse the repository at this point in the history
- setDependencyCacheDir in java plugin and CompileOptions
- Use of Ant <depend> task and Depend options
- Javadoc setOptions
- Manifest.writeTo(Writer)
- JavaPluginConvention.setProject

Issue: #1722
  • Loading branch information
eriwen committed Apr 7, 2017
1 parent 0e2ec7e commit edadbed
Show file tree
Hide file tree
Showing 22 changed files with 6 additions and 602 deletions.
Expand Up @@ -48,14 +48,6 @@
<td>forkOptions</td>
<td></td>
</tr>
<tr>
<td>useDepend</td>
<td><literal>false</literal></td>
</tr>
<tr>
<td>dependOptions</td>
<td></td>
</tr>
<tr>
<td>bootClasspath</td>
<td><literal>null</literal></td>
Expand Down Expand Up @@ -96,9 +88,6 @@
<tr>
<td>fork</td>
</tr>
<tr>
<td>depend</td>
</tr>
</table>
</section>
</section>
4 changes: 4 additions & 0 deletions subprojects/docs/src/docs/release/notes.md
Expand Up @@ -173,6 +173,10 @@ The following are the newly deprecated items in this Gradle release. If you have
- Removed class `ActionBroadcast`.
- Removed the [Gradle GUI](https://docs.gradle.org/3.5/userguide/tutorial_gradle_gui.html). All classes for this feature have been removed as well as all leftovers supporting class from the Open API partly removed due to deprecation in Gradle 2.0.
- Removed the annotation `@OrderSensitive` and the method `TaskInputFilePropertyBuilder.orderSensitive`.
- Removed `dependencyCacheDir` getter and setters in java plugin, `JavaCompileSpec`, and `CompileOptions`
- Removed Ant <depend> related classes `AntDepend`, `AntDependsStaleClassCleaner`, and `DependOptions`
- Removed `Javadoc#setOptions`
- Removed `Manifest.writeTo(Writer)`. Please use `Manifest.writeTo(Object)`

The deprecated `jetty` plugin has been removed. We recommend using the [Gretty plugin](https://github.com/akhikhl/gretty) for developing Java web applications.
The deprecated `pluginRepositories` block for declaring custom plugin repositories has been removed in favor of `pluginManagement.repositories`.
Expand Down
14 changes: 0 additions & 14 deletions subprojects/docs/src/docs/userguide/javaPlugin.xml
Expand Up @@ -653,20 +653,6 @@
The name of the directory to use to cache source dependency information, relative to the build directory.
</td>
</tr>
<tr>
<td>
<literal>dependencyCacheDir</literal>
</td>
<td>
<classname>File</classname> (read-only)
</td>
<td>
<literal><replaceable>buildDir</replaceable>/<replaceable>dependencyCacheDirName</replaceable></literal>
</td>
<td>
The directory to use to cache source dependency information.
</td>
</tr>
</table>

<table id='javaconventionNonDir'>
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -21,7 +21,6 @@
import org.gradle.language.base.internal.compile.Compiler;
import org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner;
import org.gradle.language.base.internal.tasks.StaleClassCleaner;
import org.gradle.util.DeprecationLogger;

public class CleaningJavaCompiler extends CleaningJavaCompilerSupport<JavaCompileSpec> implements org.gradle.language.base.internal.compile.Compiler<JavaCompileSpec> {
private final Compiler<JavaCompileSpec> compiler;
Expand All @@ -41,20 +40,7 @@ public Compiler<JavaCompileSpec> getCompiler() {
}

@Override
@SuppressWarnings("deprecation")
protected StaleClassCleaner createCleaner(final JavaCompileSpec spec) {
boolean useDepend = DeprecationLogger.whileDisabled(new Factory<Boolean>() {
@Override
public Boolean create() {
return spec.getCompileOptions().isUseDepend();
}
});
if (useDepend) {
AntDependsStaleClassCleaner cleaner = new AntDependsStaleClassCleaner(antBuilderFactory, spec.getCompileOptions());
cleaner.setDependencyCacheDir(spec.getDependencyCacheDir());
return cleaner;
} else {
return new SimpleStaleClassCleaner(taskOutputs);
}
return new SimpleStaleClassCleaner(taskOutputs);
}
}
Expand Up @@ -23,7 +23,6 @@

public class DefaultJavaCompileSpec extends DefaultJvmLanguageCompileSpec implements JavaCompileSpec {
private CompileOptions compileOptions;
private File dependencyCacheDir;
private List<File> annotationProcessorPath;

@Override
Expand All @@ -35,18 +34,6 @@ public void setCompileOptions(CompileOptions compileOptions) {
this.compileOptions = compileOptions;
}

@Deprecated
@Override
public File getDependencyCacheDir() {
return dependencyCacheDir;
}

@Deprecated
@Override
public void setDependencyCacheDir(File dependencyCacheDir) {
this.dependencyCacheDir = dependencyCacheDir;
}

@Override
public List<File> getAnnotationProcessorPath() {
return annotationProcessorPath;
Expand Down
Expand Up @@ -24,12 +24,6 @@
public interface JavaCompileSpec extends JvmLanguageCompileSpec {
CompileOptions getCompileOptions();

@Deprecated
File getDependencyCacheDir();

@Deprecated
void setDependencyCacheDir(File dependencyCacheDir);

@Override
File getDestinationDir();

Expand Down
Expand Up @@ -26,7 +26,6 @@
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Nested;
import org.gradle.api.tasks.Optional;
import org.gradle.util.DeprecationLogger;

import java.util.List;
import java.util.Map;
Expand All @@ -38,7 +37,7 @@ public class CompileOptions extends AbstractOptions {
private static final long serialVersionUID = 0;

private static final ImmutableSet<String> EXCLUDE_FROM_ANT_PROPERTIES =
ImmutableSet.of("debugOptions", "forkOptions", "compilerArgs", "dependOptions", "useDepend", "incremental");
ImmutableSet.of("debugOptions", "forkOptions", "compilerArgs", "incremental");

private boolean failOnError = true;

Expand All @@ -60,11 +59,6 @@ public class CompileOptions extends AbstractOptions {

private ForkOptions forkOptions = new ForkOptions();

private boolean useDepend;

@SuppressWarnings("deprecation")
private DependOptions dependOptions = new DependOptions();

private String bootClasspath;

private String extensionDirs;
Expand Down Expand Up @@ -236,48 +230,6 @@ public void setForkOptions(ForkOptions forkOptions) {
this.forkOptions = forkOptions;
}

/**
* Tells whether to use the Ant {@code <depend>} task.
* Only takes effect if {@code useAnt} is {@code true}. Defaults to
* {@code false}.
*/
@Input
@Deprecated
public boolean isUseDepend() {
DeprecationLogger.nagUserOfDiscontinuedMethod("CompileOptions.isUseDepend()");
return useDepend;
}

/**
* Sets whether to use the Ant {@code <depend>} task.
* Only takes effect if {@code useAnt} is {@code true}. Defaults to
* {@code false}.
*/
@Deprecated
public void setUseDepend(boolean useDepend) {
DeprecationLogger.nagUserOfDiscontinuedMethod("CompileOptions.setUseDepend()");
this.useDepend = useDepend;
}

/**
* Returns options for using the Ant {@code <depend>} task.
*/
@Nested
@Deprecated
public DependOptions getDependOptions() {
DeprecationLogger.nagUserOfDiscontinuedMethod("CompileOptions.getDependOptions()");
return dependOptions;
}

/**
* Sets options for using the Ant {@code <depend>} task.
*/
@Deprecated
public void setDependOptions(DependOptions dependOptions) {
DeprecationLogger.nagUserOfDiscontinuedMethod("CompileOptions.setDependOptions()");
this.dependOptions = dependOptions;
}

/**
* Returns the bootstrap classpath to be used for the compiler process. Defaults to {@code null}.
*/
Expand Down Expand Up @@ -354,18 +306,6 @@ public CompileOptions debug(Map<String, Object> debugArgs) {
return this;
}

/**
* Convenience method to set {@link DependOptions} with named parameter syntax.
* Calling this method will set {@code useDepend} to {@code true}.
*/
@Deprecated
public CompileOptions depend(Map<String, Object> dependArgs) {
DeprecationLogger.nagUserOfDiscontinuedMethod("CompileOptions.depend()");
useDepend = true;
dependOptions.define(dependArgs);
return this;
}

/**
* Configure the java compilation to be incremental (e.g. compiles only those java classes that were changed or that are dependencies to the changed classes).
*/
Expand Down

0 comments on commit edadbed

Please sign in to comment.