mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-12 06:07:33 +00:00
* Fix the warning about removing duplicate source roots when open the project with Intellij IDEA. * Add Gradle wrapper. * CustomSkinLoader can be loaded in Forge development environment now. * CustomSkinLoader can be loaded in Fabric development environment now.
46 lines
1.5 KiB
Groovy
46 lines
1.5 KiB
Groovy
|
|
// If you want to add dependent project sources for annotation processors in current project,
|
|
// use `projectImplementation project(":xxx")` instead of `dependencies { implementation project(":xxx") }`
|
|
|
|
class ProjectContainer {
|
|
static def implementationProjects = [:]
|
|
}
|
|
|
|
void projectImplementation(Project otherProject) {
|
|
dependencies {
|
|
implementation otherProject, {
|
|
transitive = false
|
|
}
|
|
}
|
|
|
|
ProjectContainer.implementationProjects.putIfAbsent project, []
|
|
ProjectContainer.implementationProjects.get project add otherProject
|
|
}
|
|
|
|
ext {
|
|
projectImplementation = this.&projectImplementation
|
|
}
|
|
|
|
// We need to add sourceSets at compile time to avoid IntelliJ IDEA from removing duplicated source roots and to avoid Eclipse add source dirs twice.
|
|
// The reason of that we don't just dependent other subprojects is to let Mixin AP work correctly.
|
|
task setupSourceSets {
|
|
doLast {
|
|
sourceSets.main {
|
|
java {
|
|
ProjectContainer.implementationProjects.get(project).forEach({
|
|
it.sourceSets.main.java.srcDirs.forEach({ targetDir ->
|
|
srcDir targetDir
|
|
})
|
|
})
|
|
}
|
|
resources {
|
|
ProjectContainer.implementationProjects.get(project).forEach({
|
|
it.sourceSets.main.resources.srcDirs.forEach({ targetDir ->
|
|
srcDir targetDir
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
deobfCompileDummyTask.dependsOn setupSourceSets |