Interface MultireleaseSourceSet


  • public interface MultireleaseSourceSet
    Information about multirelease variants of a source set.
    Since:
    2.0.0
    • Method Detail

      • from

        @NotNull
        static @NotNull MultireleaseSourceSet from​(@NotNull
                                                   @NotNull org.gradle.api.tasks.SourceSet set)
        Given an existing source set, get the multirelease extension.

        This will fail when the provided source set is already a multirelease variant of a base source set.

        Parameters:
        set - the source set
        Returns:
        the multirelease extension
      • alternateVersions

        @NotNull
        @NotNull org.gradle.api.DomainObjectSet<Integer> alternateVersions()
        Get the property listing alternate versions for this source set.
        Returns:
        the alternate versions property
      • alternateVersions

        void alternateVersions​(int... alternates)
        Add alternate versions to this source set.
        Parameters:
        alternates - the alternate versions
        Since:
        2.0.0
      • moduleName

        @NotNull
        @NotNull org.gradle.api.provider.Property<String> moduleName()
        The module name needs to be explicitly passed if a modular multirelease jar is desired.

        This is optional in non-modular environments.

        Returns:
        the module name property
        Since:
        2.0.0
      • moduleName

        default void moduleName​(@NotNull
                                @NotNull String moduleName)
        The module name to explicitly pass if a modular multirelease jar is desired.

        This is optional in non-modular environments.

        Parameters:
        moduleName - the name of the module that the different version variants should contribute to
        Since:
        2.0.0
      • configureVariants

        void configureVariants​(@NotNull
                               @NotNull org.gradle.api.Action<MultireleaseVariantDetails> action)
        Configure derived source sets.
        Parameters:
        action - an action that receives each source set
        Since:
        2.0.0
      • requireAllPackagesExported

        void requireAllPackagesExported()
        Register a task to validate that all packages in the module this source set defines are exported.
        Since:
        2.1.0
      • requireAllPackagesExported

        void requireAllPackagesExported​(@NotNull
                                        @NotNull org.gradle.api.Action<? super CheckModuleExports> action)
        Register a task to validate that packages in the module this source set defines are exported.

        The task is provided to allow for additional configuration, such as exclusions to required exported packages.

        Parameters:
        action - an action to configure the created task
        Since:
        2.1.0
      • applyToJavadoc

        org.gradle.api.provider.Property<Boolean> applyToJavadoc()
        Configure whether multi-release contents are exposed to Javadoc generation.

        This includes adding a module descriptor to Javadoc that may otherwise only be present in multi-release variants.

        Returns:
        a property controlling whether Javadoc generation should be multi-release aware
        Since:
        2.1.0
      • applyToJavadoc

        default void applyToJavadoc​(boolean applyToJavadoc)
        Configure whether multi-release contents are exposed to Javadoc generation.

        This includes adding a module descriptor to Javadoc that may otherwise only be present in multi-release variants.

        Parameters:
        applyToJavadoc - whether Javadoc generation should be multi-release aware
        Since:
        2.1.0