mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-12 11:10:29 +00:00
Use exclusiveContent for our maven
This is a little nasty as we need to include ForgeGradle's repo too, but should still help a bit!
This commit is contained in:
parent
8708048b6e
commit
0b2bb5e7b5
@ -10,8 +10,9 @@ import cc.tweaked.gradle.IdeaRunConfigurations
|
||||
import cc.tweaked.gradle.MinecraftConfigurations
|
||||
|
||||
plugins {
|
||||
id("cc-tweaked.java-convention")
|
||||
id("net.minecraftforge.gradle")
|
||||
// We must apply java-convention after Forge, as we need the fg extension to be present.
|
||||
id("cc-tweaked.java-convention")
|
||||
id("org.parchmentmc.librarian.forgegradle")
|
||||
}
|
||||
|
||||
|
@ -37,9 +37,25 @@ java {
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://squiddev.cc/maven") {
|
||||
|
||||
val mainMaven = maven("https://squiddev.cc/maven") {
|
||||
name = "SquidDev"
|
||||
content {
|
||||
// Until https://github.com/SpongePowered/Mixin/pull/593 is merged
|
||||
includeModule("org.spongepowered", "mixin")
|
||||
}
|
||||
}
|
||||
|
||||
exclusiveContent {
|
||||
forRepositories(mainMaven)
|
||||
|
||||
// Include the ForgeGradle repository if present. This requires that ForgeGradle is already present, which we
|
||||
// enforce in our Forge overlay.
|
||||
val fg =
|
||||
project.extensions.findByType(net.minecraftforge.gradle.userdev.DependencyManagementExtension::class.java)
|
||||
if (fg != null) forRepositories(fg.repository)
|
||||
|
||||
filter {
|
||||
includeGroup("org.squiddev")
|
||||
includeGroup("cc.tweaked")
|
||||
// Things we mirror
|
||||
@ -49,8 +65,6 @@ repositories {
|
||||
includeGroup("me.shedaniel.cloth")
|
||||
includeGroup("mezz.jei")
|
||||
includeModule("com.terraformersmc", "modmenu")
|
||||
// Until https://github.com/SpongePowered/Mixin/pull/593 is merged
|
||||
includeModule("org.spongepowered", "mixin")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,12 +56,13 @@ internal fun setRunConfigInternal(project: Project, spec: JavaExecSpec, config:
|
||||
for ((k, v) in config.lazyTokens) lazyTokens[k] = v
|
||||
lazyTokens.compute(
|
||||
"source_roots",
|
||||
{ key: String, sourceRoots: Supplier<String>? ->
|
||||
{ _, sourceRoots ->
|
||||
Supplier<String> {
|
||||
val modClasses = RunConfigGenerator.mapModClassesToGradle(project, config)
|
||||
(if (sourceRoots != null) Stream.concat<String>(
|
||||
sourceRoots.get().split(File.pathSeparator).stream(), modClasses,
|
||||
) else modClasses).distinct().collect(Collectors.joining(File.pathSeparator))
|
||||
(when (sourceRoots) {
|
||||
null -> modClasses
|
||||
else -> Stream.concat<String>(sourceRoots.get().split(File.pathSeparator).stream(), modClasses)
|
||||
}).distinct().collect(Collectors.joining(File.pathSeparator))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user