-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composite builds support for nested jars #992
base: exp/1.5
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,9 +80,13 @@ | |
import net.fabricmc.tinyremapper.TinyRemapper; | ||
|
||
public abstract class RemapJarTask extends AbstractRemapJarTask { | ||
@Deprecated | ||
@InputFiles | ||
public abstract ConfigurableFileCollection getNestedJars(); | ||
|
||
@Internal | ||
public abstract ListProperty<Configuration> getNestedConfigurations(); | ||
|
||
@Input | ||
public abstract Property<Boolean> getAddNestedDependencies(); | ||
|
||
|
@@ -106,7 +110,7 @@ public RemapJarTask() { | |
getAddNestedDependencies().convention(true).finalizeValueOnRead(); | ||
|
||
Configuration includeConfiguration = getProject().getConfigurations().getByName(Constants.Configurations.INCLUDE); | ||
getNestedJars().from(new IncludedJarFactory(getProject()).getNestedJars(includeConfiguration)); | ||
getNestedConfigurations().add(includeConfiguration); | ||
|
||
getUseMixinAP().set(LoomGradleExtension.get(getProject()).getMixin().getUseLegacyMixinAp()); | ||
|
||
|
@@ -121,6 +125,18 @@ public RemapJarTask() { | |
getJarType().set("classes"); | ||
} | ||
|
||
@InputFiles | ||
public FileCollection getNestedDependenciesResolved() { // for task up-to-date checking | ||
final ConfigurableFileCollection files = getProject().files(); | ||
|
||
if (getAddNestedDependencies().get()) { | ||
getNestedConfigurations().get().forEach(files::from); | ||
files.from(getNestedJars()); | ||
} | ||
|
||
return files; | ||
} | ||
Comment on lines
+128
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this any different from putting the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding configuration directly to the existing |
||
|
||
private void setupPreparationTask() { | ||
PrepareJarRemapTask prepareJarTask = getProject().getTasks().create("prepare" + getName().substring(0, 1).toUpperCase() + getName().substring(1), PrepareJarRemapTask.class, this); | ||
|
||
|
@@ -141,6 +157,9 @@ private void setupPreparationTask() { | |
public void run() { | ||
submitWork(RemapAction.class, params -> { | ||
if (getAddNestedDependencies().get()) { | ||
getNestedConfigurations().get().forEach(configuration -> { | ||
params.getNestedJars().from(new IncludedJarFactory(getProject()).getNestedJars(configuration)); | ||
}); | ||
params.getNestedJars().from(getNestedJars()); | ||
} | ||
|
||
|
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.
We cannot deprecate this, as its used for adding files that arent part of a
Configuration
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.
Adding to this collection directly doesn't add any metadata even if the file isn't actually a mod jar. Files can also be added directly to
Configuration
s. So it doesn't really make sense to me to actually keep this.