-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e19861
commit 9a00d9b
Showing
3 changed files
with
374 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 68 additions & 3 deletions
71
src/main/java/org/terracotta/build/plugins/packaging/Package.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,107 @@ | ||
package org.terracotta.build.plugins.packaging; | ||
|
||
import org.gradle.api.Action; | ||
import org.gradle.api.DomainObjectSet; | ||
import org.gradle.api.Named; | ||
import org.gradle.api.NamedDomainObjectContainer; | ||
import org.gradle.api.artifacts.Dependency; | ||
import org.gradle.api.artifacts.DependencySet; | ||
import org.gradle.api.plugins.JavaPluginExtension; | ||
import org.gradle.api.provider.Property; | ||
import org.gradle.api.provider.SetProperty; | ||
|
||
import javax.inject.Inject; | ||
|
||
public interface Package { | ||
|
||
/** | ||
* Package the contributing source and register the produced JAR as a variant, à la {@link JavaPluginExtension#withSourcesJar()}. | ||
*/ | ||
void withSourcesJar(); | ||
|
||
/** | ||
* Generate then package Javadoc and register the produced JAR as a variant, à la {@link JavaPluginExtension#withJavadocJar()}. | ||
* <p> | ||
* The javadoc is by default generated by executing the Javadoc tool over the merged source code of the contributing | ||
* dependencies. | ||
*/ | ||
default void withJavadocJar() { | ||
withJavadocJar(javadoc -> {}); | ||
} | ||
|
||
/** | ||
* Generate then package Javadoc and register the produced JAR as a variant, à la {@link JavaPluginExtension#withJavadocJar()}. | ||
* <p> | ||
* Javdoc generation is customized using the provided action. | ||
*/ | ||
void withJavadocJar(Action<Javadoc> action); | ||
|
||
/** | ||
* The set of additional optional feature variants. | ||
* <p> | ||
* Optional feature variants share the same primary artifact but provide additional dependencies mapped to additional | ||
* outgoing variants, or to optional in Maven. | ||
* | ||
* @return the additional optional feature variants | ||
*/ | ||
NamedDomainObjectContainer<? extends OptionalFeature> getOptionalFeatures(); | ||
|
||
interface OptionalFeature extends Named, CustomCapabilities {} | ||
|
||
interface Javadoc { | ||
|
||
SetProperty<Dependency> getClasspath(); | ||
/** | ||
* The additional dependencies required for Javadoc generation. | ||
* | ||
* @return the additional javadoc classpath dependencies | ||
*/ | ||
DomainObjectSet<Dependency> getClasspath(); | ||
|
||
/** | ||
* The dependency that defines the public Javadoc for this package, or an absent value if Javadoc should be generated from merged sources. | ||
* | ||
* @return the optional javadoc dependency | ||
*/ | ||
Property<Dependency> getArtifact(); | ||
|
||
default void classpath(Object dependency) { | ||
classpath(dependency, d -> {}); | ||
/** | ||
* Add a dependency to the Javadoc classpath by parsing the given notation | ||
* | ||
* @param notation dependency notation | ||
* @see org.gradle.api.artifacts.dsl.DependencyHandler | ||
*/ | ||
default void classpath(Object notation) { | ||
classpath(notation, d -> {}); | ||
} | ||
|
||
/** | ||
* Add a dependency to the Javadoc classpath by parsing the given notation | ||
* and configuring it using the provided action. | ||
* | ||
* @param notation dependency notation | ||
* @param action configuring action | ||
* @see org.gradle.api.artifacts.dsl.DependencyHandler | ||
*/ | ||
void classpath(Object notation, Action<? super Dependency> action); | ||
|
||
/** | ||
* Assign a dependency to provide the Javadoc of this package by parsing the given notation. | ||
* | ||
* @param notation dependency notation | ||
* @see org.gradle.api.artifacts.dsl.DependencyHandler | ||
*/ | ||
default void from(Object notation) { | ||
from(notation, d -> {}); | ||
} | ||
|
||
/** | ||
* Assign a dependency to provide the Javadoc of this package by parsing the given notation | ||
* and configuring it using the provided action. | ||
* | ||
* @param notation dependency notation | ||
* @param action configuring action | ||
* @see org.gradle.api.artifacts.dsl.DependencyHandler | ||
*/ | ||
void from(Object notation, Action<? super Dependency> action); | ||
} | ||
} |
Oops, something went wrong.