-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement dependency handling for runtime only dependencies.
- Loading branch information
1 parent
3a63bef
commit c35e045
Showing
10 changed files
with
117 additions
and
50 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...on/src/main/java/net/neoforged/gradle/common/runs/run/ConfigurationRunDependencyImpl.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,31 @@ | ||
package net.neoforged.gradle.common.runs.run; | ||
|
||
import net.neoforged.gradle.dsl.common.runs.run.RunDependency; | ||
import net.neoforged.gradle.dsl.common.util.ConfigurationUtils; | ||
import org.gradle.api.Project; | ||
import org.gradle.api.artifacts.Configuration; | ||
import org.gradle.api.artifacts.Dependency; | ||
import org.gradle.api.artifacts.ResolvedConfiguration; | ||
import org.gradle.api.file.ConfigurableFileCollection; | ||
import org.gradle.api.provider.Property; | ||
|
||
import javax.inject.Inject; | ||
|
||
public abstract class ConfigurationRunDependencyImpl implements RunDependency { | ||
|
||
@Inject | ||
public ConfigurationRunDependencyImpl(Project project, Configuration dependency) { | ||
getIdentity().convention(dependency.toString()); | ||
getDependency().from(project.provider(() -> { | ||
final ResolvedConfiguration resolvedConfiguration = dependency.getResolvedConfiguration(); | ||
final ConfigurableFileCollection files = project.files(); | ||
return files.from(resolvedConfiguration.getFiles()); | ||
})); | ||
} | ||
|
||
@Override | ||
public abstract ConfigurableFileCollection getDependency(); | ||
|
||
@Override | ||
public abstract Property<String> getIdentity(); | ||
} |
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
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
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