Skip to content

Commit

Permalink
Documentation for compile only dependencies
Browse files Browse the repository at this point in the history
+review REVIEW-5807
  • Loading branch information
Mark Vieira committed Feb 11, 2016
1 parent 652bf4c commit fb8dc31
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 38 deletions.
12 changes: 12 additions & 0 deletions subprojects/docs/src/docs/release/notes.md
Expand Up @@ -68,6 +68,18 @@ You can use [test filtering](userguide/java_plugin.html#test_filtering) in the J

These same patterns can also be used in the [filter section](userguide/java_plugin.html#testfiltering) of the test task directly in your `build.gradle` file.

### Support for declaring compile time only dependencies with Java plugin

You can now declare dependencies that are used only during source compilation in conjunction with the [Java plugin](userguide/java_plugin.html). Compile only dependencies are used
only during source compilation and are not included in the runtime classpath or exposed to dependent projects. Compile only dependencies are assigned to the relevant source set's
'compileOnly' configuration.

dependencies {
compileOnly 'javax.servlet:servlet-api:2.5'
}

More details about declaring compile only configurations can be found in the [Java plugin chapter](userguide/java_plugin.html#sec:java_plugin_and_dependency_management) of the user guide.

## Promoted features

Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backwards compatibility.
Expand Down
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<!--Created by yFiles for Java 2.8-->
<key for="graphml" id="d0" yfiles.type="resources"/>
<key for="port" id="d1" yfiles.type="portgraphics"/>
<key for="port" id="d2" yfiles.type="portgeometry"/>
<key for="port" id="d3" yfiles.type="portuserdata"/>
<key attr.name="url" attr.type="string" for="node" id="d4"/>
<key attr.name="description" attr.type="string" for="node" id="d5"/>
<key for="node" id="d6" yfiles.type="nodegraphics"/>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<!--Created by yEd 3.14.4-->
<key for="port" id="d0" yfiles.type="portgraphics"/>
<key for="port" id="d1" yfiles.type="portgeometry"/>
<key for="port" id="d2" yfiles.type="portuserdata"/>
<key attr.name="url" attr.type="string" for="node" id="d3"/>
<key attr.name="description" attr.type="string" for="node" id="d4"/>
<key for="node" id="d5" yfiles.type="nodegraphics"/>
<key for="graphml" id="d6" yfiles.type="resources"/>
<key attr.name="url" attr.type="string" for="edge" id="d7"/>
<key attr.name="description" attr.type="string" for="edge" id="d8"/>
<key for="edge" id="d9" yfiles.type="edgegraphics"/>
<graph edgedefault="directed" id="G">
<node id="n0">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="540.255859375" y="-145.0"/>
<y:Fill color="#96E880" transparent="false"/>
Expand All @@ -24,7 +24,7 @@
</data>
</node>
<node id="n1">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="270.833984375" y="-152.5"/>
<y:Fill color="#96E880" transparent="false"/>
Expand All @@ -35,7 +35,7 @@
</data>
</node>
<node id="n2">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="270.833984375" y="-52.5"/>
<y:Fill color="#96E880" transparent="false"/>
Expand All @@ -46,7 +46,7 @@
</data>
</node>
<node id="n3">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="0.0" y="-102.5"/>
<y:Fill color="#96E880" transparent="false"/>
Expand All @@ -57,7 +57,7 @@
</data>
</node>
<node id="n4">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="270.833984375" y="-245.0"/>
<y:Fill color="#96E880" transparent="false"/>
Expand All @@ -68,7 +68,7 @@
</data>
</node>
<node id="n5">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="0.0" y="-152.5"/>
<y:Fill color="#96E880" transparent="false"/>
Expand All @@ -79,9 +79,9 @@
</data>
</node>
<node id="n6">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="809.677734375" y="-145.0"/>
<y:Geometry height="30.0" width="140.0" x="809.677734375" y="-245.0"/>
<y:Fill color="#C3D9E6" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Arial" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" modelName="internal" modelPosition="c" textColor="#555555" visible="true" width="96.0390625" x="21.98046875" y="6.296875">compileJava task</y:NodeLabel>
Expand All @@ -90,7 +90,7 @@
</data>
</node>
<node id="n7">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="270.833984375" y="-102.5"/>
<y:Fill color="#C3D9E6" transparent="false"/>
Expand All @@ -101,7 +101,7 @@
</data>
</node>
<node id="n8">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="0.0" y="-202.5"/>
<y:Fill color="#C3D9E6" transparent="false"/>
Expand All @@ -112,9 +112,9 @@
</data>
</node>
<node id="n9">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="540.255859375" y="-45.0"/>
<y:Geometry height="30.0" width="140.0" x="809.677734375" y="-52.5"/>
<y:Fill color="#C3D9E6" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Arial" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" modelName="internal" modelPosition="c" textColor="#555555" visible="true" width="119.376953125" x="10.3115234375" y="6.296875">compileTestJava task</y:NodeLabel>
Expand All @@ -123,7 +123,7 @@
</data>
</node>
<node id="n10">
<data key="d6">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="0.0" y="-252.5"/>
<y:Fill color="#C3D9E6" transparent="false"/>
Expand All @@ -133,6 +133,28 @@
</y:ShapeNode>
</data>
</node>
<node id="n11">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="540.255859375" y="-245.0"/>
<y:Fill color="#96E880" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Arial" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" modelName="internal" modelPosition="c" textColor="#555555" visible="true" width="70.0234375" x="34.98828125" y="6.296875">compileOnly</y:NodeLabel>
<y:Shape type="roundrectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n12">
<data key="d5">
<y:ShapeNode>
<y:Geometry height="30.0" width="140.0" x="540.255859375" y="-52.5"/>
<y:Fill color="#96E880" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Arial" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" modelName="internal" modelPosition="c" textColor="#555555" visible="true" width="92.03125" x="23.984375" y="6.296875">testCompileOnly</y:NodeLabel>
<y:Shape type="roundrectangle"/>
</y:ShapeNode>
</data>
</node>
<edge id="e0" source="n2" target="n0">
<data key="d9">
<y:QuadCurveEdge straightness="0.1">
Expand Down Expand Up @@ -187,13 +209,14 @@
</y:QuadCurveEdge>
</data>
</edge>
<edge id="e5" source="n0" target="n6">
<edge id="e5" source="n11" target="n6">
<data key="d9">
<y:QuadCurveEdge straightness="0.1">
<y:Path sx="70.0" sy="-0.0" tx="-70.0" ty="-0.0"/>
<y:Path sx="69.9609375" sy="0.0" tx="-70.0" ty="-0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="delta"/>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="49.421875" x="40.0" y="-9.06640625">used by</y:EdgeLabel>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="49.421875" x="39.9683837890625" y="-9.06640625">used by<y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="on_edge" sideReference="relative_to_edge_flow"/>
</y:EdgeLabel>
</y:QuadCurveEdge>
</data>
</edge>
Expand All @@ -208,7 +231,8 @@
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="delta"/>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="50.833984375" x="40.0" y="-18.433469742063494">adds jar</y:EdgeLabel>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="50.833984375" x="40.0" y="-18.433469742063494">adds jar<y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="on_edge" sideReference="relative_to_edge_flow"/>
</y:EdgeLabel>
</y:QuadCurveEdge>
</data>
</edge>
Expand All @@ -218,17 +242,19 @@
<y:Path sx="70.0" sy="-0.0" tx="-70.0" ty="-0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="delta"/>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="49.421875" x="40.7060546875" y="-9.06640625">used by</y:EdgeLabel>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="49.421875" x="40.7060546875" y="-9.06640625">used by<y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="on_edge" sideReference="relative_to_edge_flow"/>
</y:EdgeLabel>
</y:QuadCurveEdge>
</data>
</edge>
<edge id="e8" source="n2" target="n9">
<edge id="e8" source="n12" target="n9">
<data key="d9">
<y:QuadCurveEdge straightness="0.1">
<y:Path sx="70.0" sy="7.5" tx="-70.0" ty="-0.0"/>
<y:Path sx="69.9609375" sy="0.0" tx="-70.0" ty="-0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="delta"/>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="49.421875" x="40.0" y="-9.06640625">used by</y:EdgeLabel>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="49.421875" x="39.9683837890625" y="-9.06640625">used by<y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="on_edge" sideReference="relative_to_edge_flow"/>
</y:EdgeLabel>
</y:QuadCurveEdge>
</data>
</edge>
Expand All @@ -238,7 +264,8 @@
<y:Path sx="70.0" sy="-0.0" tx="-70.0" ty="-7.5"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="delta"/>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="50.13671875" x="40.3486328125" y="-9.06640625">uploads</y:EdgeLabel>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="50.13671875" x="40.3486328125" y="-9.06640625">uploads<y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="on_edge" sideReference="relative_to_edge_flow"/>
</y:EdgeLabel>
</y:QuadCurveEdge>
</data>
</edge>
Expand All @@ -253,12 +280,31 @@
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="delta"/>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="50.833984375" x="40.0" y="-0.30053323412698774">adds jar</y:EdgeLabel>
<y:EdgeLabel alignment="center" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" modelName="free" modelPosition="anywhere" preferredPlacement="on_edge" ratio="0.5" textColor="#000000" visible="true" width="50.833984375" x="40.0" y="-0.30053323412698774">adds jar<y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="on_edge" sideReference="relative_to_edge_flow"/>
</y:EdgeLabel>
</y:QuadCurveEdge>
</data>
</edge>
<edge id="e11" source="n11" target="n0">
<data key="d9">
<y:QuadCurveEdge straightness="0.1">
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="white_delta"/>
</y:QuadCurveEdge>
</data>
</edge>
<edge id="e12" source="n12" target="n2">
<data key="d9">
<y:QuadCurveEdge straightness="0.1">
<y:Path sx="0.0" sy="0.0" tx="41.26182045898179" ty="0.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="white_delta"/>
</y:QuadCurveEdge>
</data>
</edge>
</graph>
<data key="d0">
<data key="d6">
<y:Resources/>
</data>
</graphml>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 23 additions & 5 deletions subprojects/docs/src/docs/userguide/javaPlugin.xml
Expand Up @@ -377,9 +377,15 @@
<tr>
<td>compile</td>
<td>-</td>
<td>compileJava</td>
<td>-</td>
<td>Compile time dependencies</td>
</tr>
<tr>
<td>compileOnly</td>
<td>compile</td>
<td>compileJava</td>
<td>Compile time only dependencies, not used at runtime</td>
</tr>
<tr>
<td>runtime</td>
<td>compile</td>
Expand All @@ -389,20 +395,26 @@
<tr>
<td>testCompile</td>
<td>compile</td>
<td>-</td>
<td>Additional dependencies for compiling tests</td>
</tr>
<tr>
<td>testCompileOnly</td>
<td>testCompile</td>
<td>compileTestJava</td>
<td>Additional dependencies for compiling tests.</td>
<td>Additional dependencies only for compiling tests, not used at runtime</td>
</tr>
<tr>
<td>testRuntime</td>
<td>runtime, testCompile</td>
<td>test</td>
<td>Additional dependencies for running tests only.</td>
<td>Additional dependencies for running tests only</td>
</tr>
<tr>
<td>archives</td>
<td>-</td>
<td>uploadArchives</td>
<td>Artifacts (e.g. jars) produced by this project.</td>
<td>Artifacts (e.g. jars) produced by this project</td>
</tr>
<tr>
<td>default</td>
Expand Down Expand Up @@ -433,9 +445,15 @@
<tr>
<td><literal><replaceable>sourceSet</replaceable>Compile</literal></td>
<td>-</td>
<td><literal>compile<replaceable>SourceSet</replaceable>Java</literal></td>
<td>-</td>
<td>Compile time dependencies for the given source set</td>
</tr>
<tr>
<td><literal><replaceable>sourceSet</replaceable>CompileOnly</literal></td>
<td><literal><replaceable>sourceSet</replaceable>Compile</literal></td>
<td><literal>compile<replaceable>SourceSet</replaceable>Java</literal></td>
<td>Compile time only dependencies for the given source set, not used at runtime</td>
</tr>
<tr>
<td><literal><replaceable>sourceSet</replaceable>Runtime</literal></td>
<td><literal><replaceable>sourceSet</replaceable>Compile</literal></td>
Expand Down

0 comments on commit fb8dc31

Please sign in to comment.