Skip to content

Commit

Permalink
Document RunnableSourceSet
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaswimmer committed Jan 11, 2024
1 parent ad9e77e commit 1223d65
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ interface Minecraft extends BaseDSLElement<Minecraft> {

/**
* The mod identifier of the current project.
* <p>
* Defaults to a sanitized version of the project's {@linkplain org.gradle.api.Project#getName name}.
*
* @return The mod identifier of the current project.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package net.neoforged.gradle.dsl.common.extensions
import groovy.transform.CompileStatic
import net.minecraftforge.gdi.BaseDSLElement
import net.minecraftforge.gdi.annotations.DSLProperty
import net.minecraftforge.gdi.annotations.ProjectGetter
import org.gradle.api.Project
import org.gradle.api.provider.Property

import javax.inject.Inject

/**
* A {@link org.gradle.api.tasks.SourceSet SourceSet} extension used for associating each source set with a mod identifier.
*/
@CompileStatic
abstract class RunnableSourceSet implements BaseDSLElement<RunnableSourceSet> {

Expand All @@ -33,6 +35,13 @@ abstract class RunnableSourceSet implements BaseDSLElement<RunnableSourceSet> {
return project;
}

/**
* Defines the mod identifier this source set belongs to.
* <p>
* Defaults to {@link Minecraft#getModIdentifier}.
*
* @return The property which holds the mod identifier this source set belongs to.
*/
@DSLProperty
Property<String> getModIdentifier() {
return modIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ interface Run extends BaseDSLElement<Run>, NamedDSLElement {

/**
* Defines the source sets that are used as a mod.
* <p>
* For changing the mod identifier a source set belongs to see
* {@link net.neoforged.gradle.dsl.common.extensions.RunnableSourceSet#getModIdentifier RunnableSourceSet#getModIdentifier}.
*
* @return The source sets that are used as a mod.
*/
Expand Down

0 comments on commit 1223d65

Please sign in to comment.