mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-12 19:20: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
|
import cc.tweaked.gradle.MinecraftConfigurations
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("cc-tweaked.java-convention")
|
|
||||||
id("net.minecraftforge.gradle")
|
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")
|
id("org.parchmentmc.librarian.forgegradle")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,9 +37,25 @@ java {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://squiddev.cc/maven") {
|
|
||||||
|
val mainMaven = maven("https://squiddev.cc/maven") {
|
||||||
name = "SquidDev"
|
name = "SquidDev"
|
||||||
content {
|
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("org.squiddev")
|
||||||
includeGroup("cc.tweaked")
|
includeGroup("cc.tweaked")
|
||||||
// Things we mirror
|
// Things we mirror
|
||||||
@ -49,8 +65,6 @@ repositories {
|
|||||||
includeGroup("me.shedaniel.cloth")
|
includeGroup("me.shedaniel.cloth")
|
||||||
includeGroup("mezz.jei")
|
includeGroup("mezz.jei")
|
||||||
includeModule("com.terraformersmc", "modmenu")
|
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
|
for ((k, v) in config.lazyTokens) lazyTokens[k] = v
|
||||||
lazyTokens.compute(
|
lazyTokens.compute(
|
||||||
"source_roots",
|
"source_roots",
|
||||||
{ key: String, sourceRoots: Supplier<String>? ->
|
{ _, sourceRoots ->
|
||||||
Supplier<String> {
|
Supplier<String> {
|
||||||
val modClasses = RunConfigGenerator.mapModClassesToGradle(project, config)
|
val modClasses = RunConfigGenerator.mapModClassesToGradle(project, config)
|
||||||
(if (sourceRoots != null) Stream.concat<String>(
|
(when (sourceRoots) {
|
||||||
sourceRoots.get().split(File.pathSeparator).stream(), modClasses,
|
null -> modClasses
|
||||||
) else modClasses).distinct().collect(Collectors.joining(File.pathSeparator))
|
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