-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
11 changed files
with
498 additions
and
15 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
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,7 +1,20 @@ | ||
#The version of the WilderWorkspace gradle plugin | ||
workspaceVersion = 4.0.0.0 | ||
|
||
#dependencies that projects using WilderWorkspace will need in order to mod Wildermyth | ||
accessWidenerVersion = 2.1.0 | ||
tinyMappingsVersion = 0.3.0+ | ||
mixinVersion = 0.8.5 | ||
guavaVersion = 33.2.1-jre | ||
gsonVersion = 2.11.0 | ||
providerVersion = 1.2.0.1 | ||
asmVersion = 9.7 | ||
fabricLoaderVersion = 0.16.0 | ||
wilderLoaderVersion = 1.1.0.0 | ||
|
||
#dependencies for building and running WilderWorkspace gradle plugin itself | ||
commonsIOVersion = 2.16.1 | ||
commonsLangVersion = 3.14.0 | ||
commonsTextVersion = 1.12.0 | ||
commonsIOVersion = 2.16.1 | ||
fernFlowerVersion = 2.0.0 | ||
vineFlowerVersion = 1.10.1 | ||
loomVersion = 1.7.2 |
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/wildermods/workspace/ProjectDependencyType.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,27 @@ | ||
package com.wildermods.workspace; | ||
|
||
public enum ProjectDependencyType { | ||
|
||
/** | ||
* normal gradle compile time only dependencies | ||
*/ | ||
compileOnly, | ||
|
||
/** | ||
* normal gradle implementation dependencies | ||
*/ | ||
implementation, | ||
|
||
/** | ||
* dependencies that fabric requires to be in the "fabricDependencyPath" at runtime. {@code ./bin/fabric/} is | ||
* the default location of where these dependencies are located. | ||
*/ | ||
fabricDep, | ||
|
||
/** | ||
* dependencies that are required to be in the "fabricPath" at runtime. Usually {@code ./bin/} is the default | ||
* location of where these dependencies are located | ||
*/ | ||
fabricImpl; | ||
|
||
} |
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
170 changes: 170 additions & 0 deletions
170
src/main/java/com/wildermods/workspace/WWProjectDependency.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,170 @@ | ||
package com.wildermods.workspace; | ||
|
||
import org.gradle.api.artifacts.Dependency; | ||
import static com.wildermods.workspace.ProjectDependencyType.*; | ||
|
||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
|
||
/** | ||
* A WWProject dependency represents a dependency common to all projects made | ||
* using WilderWorkspace. | ||
* <p> | ||
* Each constant in this enum corresponds to a specific dependency required for projects | ||
* using WilderWorkspace. These dependencies are essential for consistent compilation | ||
* and execution of projects that share the same version of the WilderWorkspace plugin. | ||
* <p> | ||
* Dependencies are categorized into two types: | ||
* <ul> | ||
* <li>{@code fabricDep}: Dependencies that Fabric requires to be in the "fabricDependencyPath" at runtime. | ||
* {@code ./bin/fabric/} is the default location where these dependencies are located.</li> | ||
* <li>{@code fabricImpl}: Dependencies that are required to be in the "fabricPath" at runtime. | ||
* {@code ./bin/} is the default location where these dependencies are located.</li> | ||
* </ul> | ||
* <p> | ||
* The {@code gitRepo} field, if specified, indicates a Git repository URL from which | ||
* the dependency can be obtained. This is used to set up source control repositories | ||
* for project dependencies during plugin application. See the {@link WilderWorkspacePlugin#apply(Settings)} | ||
* method for details on how these repositories are configured. | ||
* <p> | ||
* For additional information about the dependencies needed by the WilderWorkspace | ||
* gradle plugin itself, see {@link PluginDependency}. | ||
* </p> | ||
*/ | ||
public enum WWProjectDependency implements Dependency { | ||
|
||
commonsText(fabricDep, "org.apache.commons", "commons-text", "@commonsTextVersion@"), | ||
accessWidener(fabricDep, "net.fabricmc", "access-widener", "@accessWidenerVersion@"), | ||
tinyMappingsParser(fabricDep, "net.fabricmc", "tiny-mappings-parser", "@tinyMappingsVersion@"), | ||
mixin(fabricDep, "org.spongepowered", "mixin", "@mixinVersion@"), | ||
guava(fabricDep, "com.google.guava", "guava", "@guavaVersion@"), | ||
gson(fabricDep, "com.google.code.gson", "gson", "@gsonVersion@"), | ||
gameProvider(fabricDep, "com.wildermods", "provider", "@providerVersion@", "https://wildermods.com/WildermythGameProvider.git"), | ||
|
||
asm(fabricDep, "org.ow2.asm", "asm", "@asmVersion@"), | ||
asmAnalysis(fabricDep, "org.ow2.asm", "asm-analysis", "@asmVersion@"), | ||
asmCommons(fabricDep, "org.ow2.asm", "asm-commons", "@asmVersion@"), | ||
asmTree(fabricDep, "org.ow2.asm", "asm-tree", "@asmVersion@"), | ||
asmUtil(fabricDep, "org.ow2.asm", "asm-util", "@asmVersion@"), | ||
|
||
|
||
fabricLoader(fabricImpl, "net.fabricmc", "fabric-loader", "@fabricLoaderVersion@"), | ||
wilderLoader(fabricImpl, "com.wildermods", "wilderloader", "@wilderLoaderVersion@", "https://wildermods.com/WilderLoader.git") | ||
|
||
; | ||
|
||
private final ProjectDependencyType type; | ||
private final String groupID; | ||
private final String artifact; | ||
private final String version; | ||
private final String dependencyString; | ||
private final URI gitRepo; | ||
private String reason; | ||
|
||
/** | ||
* Constructs a new {@code WWProjectDependency} with the specified parameters. | ||
* | ||
* @param type the type of the project dependency | ||
* @param groupID the group ID of the dependency | ||
* @param artifact the artifact ID of the dependency | ||
* @param version the version of the dependency | ||
*/ | ||
private WWProjectDependency(ProjectDependencyType type, String groupID, String artifact, String version) { | ||
this(type, groupID, artifact, version, null); | ||
} | ||
|
||
/** | ||
* Constructs a new {@code WWProjectDependency} with the specified parameters and optional Git repository. | ||
* | ||
* @param type the type of the project dependency | ||
* @param groupID the group ID of the dependency | ||
* @param artifact the artifact ID of the dependency | ||
* @param version the version of the dependency | ||
* @param gitRepo the URL of the Git repository associated with the dependency, or {@code null} if not applicable | ||
*/ | ||
private WWProjectDependency(ProjectDependencyType type, String groupID, String artifact, String version, String gitRepo) { | ||
this.type = type; | ||
this.groupID = groupID; | ||
this.artifact = artifact; | ||
this.version = version; | ||
this.dependencyString = String.join(":", groupID, artifact, version); | ||
try { | ||
if(gitRepo != null) { | ||
this.gitRepo = new URI(gitRepo); | ||
} | ||
else { | ||
this.gitRepo = null; | ||
} | ||
} catch (URISyntaxException e) { | ||
throw new AssertionError(e); | ||
} | ||
} | ||
|
||
public String toString() { | ||
return dependencyString; | ||
} | ||
|
||
@Override | ||
public void because(String reason) { | ||
this.reason = reason; | ||
} | ||
|
||
@Override | ||
public boolean contentEquals(Dependency dependency) { | ||
return dependency == this; | ||
} | ||
|
||
@Override | ||
public Dependency copy() { | ||
throw new AssertionError(); | ||
} | ||
|
||
/** | ||
* Returns the type of the project dependency. | ||
* | ||
* The type indicates the category of the dependency is used to determine where it should be placed | ||
* within the workspace. | ||
* | ||
* @see ProjectDependencyType | ||
* | ||
* @return the type of the dependency | ||
*/ | ||
public ProjectDependencyType getType() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public String getGroup() { | ||
return groupID; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return artifact; | ||
} | ||
|
||
@Override | ||
public String getReason() { | ||
return reason; | ||
} | ||
|
||
/** | ||
* Returns the module string representation of the dependency in the format | ||
* {@code group:artifact}. | ||
* | ||
* @return the module string representation | ||
*/ | ||
public String getModule() { | ||
return String.join(":", getGroup(), getName()); | ||
} | ||
|
||
public URI getRepo() { | ||
return gitRepo; | ||
} | ||
|
||
@Override | ||
public String getVersion() { | ||
return version; | ||
} | ||
|
||
} |
Oops, something went wrong.