Skip to content

Commit

Permalink
Move jarjar itself to common project
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Nov 28, 2023
1 parent 4236d08 commit 73a88b4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 2 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ dependencies {
api "codechicken:DiffPatch:${project.diffpatch_version}"
api "commons-codec:commons-codec:${project.commons_codec_version}"
api "net.neoforged:EclipseLaunchConfigs:${project.eclipse_launch_configs_version}"
api "net.neoforged:JarJarMetadata:${project.jarjar_version}"
api "net.neoforged:JarJarSelector:${project.jarjar_version}"

// IDE support
api "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:${project.gradle_idea_extension_version}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package net.neoforged.gradle.userdev.jarjar;
package net.neoforged.gradle.common.extensions;

import net.neoforged.gradle.dsl.common.dependency.DependencyFilter;
import net.neoforged.gradle.dsl.common.dependency.DependencyVersionInformationHandler;
import net.neoforged.gradle.userdev.tasks.JarJar;
import net.neoforged.gradle.common.tasks.JarJar;
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.Task;
Expand All @@ -14,7 +14,7 @@
import javax.inject.Inject;
import java.util.Optional;

public class JarJarExtension implements net.neoforged.gradle.dsl.userdev.extension.JarJar {
public class JarJarExtension implements net.neoforged.gradle.dsl.common.extensions.JarJar {

private final Attribute<String> fixedJarJarVersionAttribute = Attribute.of("fixedJarJarVersion", String.class);
private final Attribute<String> jarJarRangeAttribute = Attribute.of("jarJarRange", String.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.neoforged.gradle.userdev.tasks;
package net.neoforged.gradle.common.tasks;

import net.minecraftforge.jarjar.metadata.*;
import net.neoforged.jarjar.metadata.*;
import net.neoforged.gradle.dsl.common.dependency.DependencyFilter;
import net.neoforged.gradle.dsl.common.dependency.DependencyVersionInformationHandler;
import net.neoforged.gradle.common.dependency.DefaultDependencyFilter;
Expand Down Expand Up @@ -221,7 +221,7 @@ private String getVersionRangeFrom(final ModuleDependency dependency) {
if (versionRange.isPresent()) {
return versionRange.get();
}
final Optional<String> attributeVersion = getProject().getExtensions().getByType(net.neoforged.gradle.dsl.userdev.extension.JarJar.class).getRange(dependency);
final Optional<String> attributeVersion = getProject().getExtensions().getByType(net.neoforged.gradle.dsl.common.extensions.JarJar.class).getRange(dependency);

return attributeVersion.orElseGet(() -> Objects.requireNonNull(dependency.getVersion()));
}
Expand All @@ -231,7 +231,7 @@ private String getVersionFrom(final ModuleDependency dependency) {
if (version.isPresent()) {
return version.get();
}
final Optional<String> attributeVersion = getProject().getExtensions().getByType(net.neoforged.gradle.dsl.userdev.extension.JarJar.class).getPin(dependency);
final Optional<String> attributeVersion = getProject().getExtensions().getByType(net.neoforged.gradle.dsl.common.extensions.JarJar.class).getPin(dependency);

return attributeVersion.orElseGet(() -> Objects.requireNonNull(dependency.getVersion()));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.neoforged.gradle.dsl.userdev.extension
package net.neoforged.gradle.dsl.common.extensions

import net.neoforged.gradle.dsl.common.dependency.DependencyFilter
import net.neoforged.gradle.dsl.common.dependency.DependencyVersionInformationHandler
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ivy_artifact_version=2.5.1
httpclient_version=4.5.13
srgutils_version=0.4.13
diffpatch_version=1.5.0.29
jarjar_version=0.3.19
jarjar_version=0.4.1
jetbrains_annotations_version=23.0.0
gradle_idea_extension_version=1.1.6
groovy_dsl_improver_version=1.0.10
Expand Down
3 changes: 0 additions & 3 deletions userdev/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ dependencies {
api project(':common')
api project(':neoform')
api project(':dsl-userdev')

api "net.minecraftforge:JarJarMetadata:${project.jarjar_version}"
api "net.minecraftforge:JarJarSelector:${project.jarjar_version}"
}


Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package net.neoforged.gradle.userdev;

import net.neoforged.gradle.dsl.userdev.extension.JarJar;
import net.neoforged.gradle.dsl.common.extensions.JarJar;
import net.neoforged.gradle.dsl.userdev.extension.UserDev;
import net.neoforged.gradle.neoform.NeoFormPlugin;
import net.neoforged.gradle.userdev.dependency.UserDevDependencyManager;
import net.neoforged.gradle.userdev.extension.UserDevExtension;
import net.neoforged.gradle.userdev.jarjar.JarJarExtension;
import net.neoforged.gradle.common.extensions.JarJarExtension;
import net.neoforged.gradle.userdev.runtime.extension.UserDevRuntimeExtension;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
Expand Down Expand Up @@ -39,7 +39,7 @@ protected void configureJarJarTask(Project project, JarJar jarJarExtension) {

JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class);

project.getTasks().register(JAR_JAR_TASK_NAME, net.neoforged.gradle.userdev.tasks.JarJar.class, jarJar -> {
project.getTasks().register(JAR_JAR_TASK_NAME, net.neoforged.gradle.common.tasks.JarJar.class, jarJar -> {
jarJar.setGroup(JAR_JAR_GROUP);
jarJar.setDescription("Create a combined JAR of project and selected dependencies");
jarJar.getArchiveClassifier().convention("all");
Expand Down

0 comments on commit 73a88b4

Please sign in to comment.