forked from QuiltMC/quilt-mappings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace Default/TaskedMappingsProjectPlugin/DefaultTaskedMappingsProj…
…ectPlugin with DefaultExtensionedMappingsProjectPlugin + Default/TaskedExtension access Tasks objects and MapIntermediaryPlugin's intermediaryFile via extension instances obtained via plugin instances instead of directly via plugin instances
- Loading branch information
1 parent
cda4060
commit 5f1af63
Showing
21 changed files
with
264 additions
and
152 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
18 changes: 18 additions & 0 deletions
18
buildSrc/src/main/java/quilt/internal/extension/MapIntermediaryExtension.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package quilt.internal.extension; | ||
|
||
import org.gradle.api.file.RegularFile; | ||
import org.gradle.api.provider.Provider; | ||
|
||
public abstract class MapIntermediaryExtension { | ||
public static final String NAME = "mapIntermediary"; | ||
|
||
private final Provider<RegularFile> intermediaryFile; | ||
|
||
public Provider<RegularFile> getIntermediaryFile() { | ||
return this.intermediaryFile; | ||
} | ||
|
||
public MapIntermediaryExtension(Provider<RegularFile> intermediaryFile) { | ||
this.intermediaryFile = intermediaryFile; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
buildSrc/src/main/java/quilt/internal/extension/MapMinecraftJarsExtension.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package quilt.internal.extension; | ||
|
||
import quilt.internal.extension.abstraction.DefaultTaskedExtension; | ||
import quilt.internal.plugin.MapMinecraftJarsPlugin; | ||
|
||
public abstract class MapMinecraftJarsExtension extends DefaultTaskedExtension<MapMinecraftJarsPlugin.Tasks> { | ||
public static final String NAME = "mapMinecraftJars"; | ||
|
||
public MapMinecraftJarsExtension(MapMinecraftJarsPlugin.Tasks tasks) { | ||
super(tasks); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
buildSrc/src/main/java/quilt/internal/extension/MapV2Extension.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package quilt.internal.extension; | ||
|
||
import quilt.internal.extension.abstraction.DefaultTaskedExtension; | ||
import quilt.internal.plugin.MapV2Plugin; | ||
|
||
public abstract class MapV2Extension extends DefaultTaskedExtension<MapV2Plugin.Tasks> { | ||
public static final String NAME = "mapV2"; | ||
|
||
public MapV2Extension(MapV2Plugin.Tasks tasks) { | ||
super(tasks); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
buildSrc/src/main/java/quilt/internal/extension/MinecraftJarsExtension.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package quilt.internal.extension; | ||
|
||
import quilt.internal.extension.abstraction.DefaultTaskedExtension; | ||
import quilt.internal.plugin.MinecraftJarsPlugin; | ||
|
||
public abstract class MinecraftJarsExtension extends DefaultTaskedExtension<MinecraftJarsPlugin.Tasks> { | ||
public static final String NAME = "minecraftJars"; | ||
|
||
public MinecraftJarsExtension(MinecraftJarsPlugin.Tasks tasks) { | ||
super(tasks); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
buildSrc/src/main/java/quilt/internal/extension/ProcessMappingsExtension.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package quilt.internal.extension; | ||
|
||
import quilt.internal.extension.abstraction.DefaultTaskedExtension; | ||
import quilt.internal.plugin.ProcessMappingsPlugin; | ||
|
||
public abstract class ProcessMappingsExtension extends DefaultTaskedExtension<ProcessMappingsPlugin.Tasks> { | ||
public static final String NAME = "processMappings"; | ||
|
||
public ProcessMappingsExtension(ProcessMappingsPlugin.Tasks tasks) { | ||
super(tasks); | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
buildSrc/src/main/java/quilt/internal/extension/abstraction/DefaultTaskedExtension.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package quilt.internal.extension.abstraction; | ||
|
||
import org.gradle.api.plugins.ExtensionContainer; | ||
|
||
/** | ||
* Aids in a common pattern for implementing {@link TaskedExtension}. | ||
* <p> | ||
* Plugins that create {@code DefaultTaskedExtension}s must pass their {@code tasks} instance as a | ||
* {@link ExtensionContainer#create(String, Class, Object...) construction argument} when creating their extension. | ||
* | ||
* @param <T> a type that provides access to some of the tasks registered by the plugin that creates this extension | ||
*/ | ||
public abstract class DefaultTaskedExtension<T> implements TaskedExtension<T> { | ||
private final T tasks; | ||
|
||
@Override | ||
public final T getTasks() { | ||
return this.tasks; | ||
} | ||
|
||
public DefaultTaskedExtension(T tasks) { | ||
this.tasks = tasks; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
buildSrc/src/main/java/quilt/internal/extension/abstraction/TaskedExtension.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package quilt.internal.extension.abstraction; | ||
|
||
import org.gradle.api.Plugin; | ||
import org.gradle.api.Task; | ||
import org.gradle.api.plugins.ExtensionContainer; | ||
import org.gradle.api.tasks.TaskContainer; | ||
import quilt.internal.plugin.abstraction.ExtensionedMappingsProjectPlugin; | ||
|
||
/** | ||
* An extension that provides access to some of the {@link Task}s {@linkplain TaskContainer#register registered} | ||
* by the {@link Plugin plugin} that {@linkplain ExtensionContainer#create creates} it. | ||
* <p> | ||
* Prefer retrieving {@link Task}s via {@link #getTasks()} to {@link TaskContainer#named} methods. | ||
* | ||
* @param <T> a type that provides access to some of the tasks registered by the plugin that creates this extension | ||
* | ||
* @see DefaultTaskedExtension | ||
* @see ExtensionedMappingsProjectPlugin | ||
*/ | ||
public interface TaskedExtension<T> { | ||
T getTasks(); | ||
} |
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
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
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
Oops, something went wrong.
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With commit 5f1af63, 2 file(s) were updated with 3 line(s) added and 3 removed compared to the latest Quilt Mappings version.
View the diff here:
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With commit 5f1af63, 3 file(s) were updated with 4 line(s) added and 4 removed compared to the latest Quilt Mappings version.
View the diff here:
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With commit 5f1af63, 4 file(s) were updated with 7 line(s) added and 7 removed compared to the latest Quilt Mappings version.
View the diff here:
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With commit 5f1af63, 3 file(s) were updated with 4 line(s) added and 4 removed compared to the latest Quilt Mappings version.
View the diff here:
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With commit 5f1af63, 2 file(s) were updated with 3 line(s) added and 3 removed compared to the latest Quilt Mappings version.
View the diff here:
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With commit 5f1af63, 2 file(s) were updated with 3 line(s) added and 3 removed compared to the latest Quilt Mappings version.
View the diff here:
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No difference between head and target.
5f1af63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No difference between head and target.