Make it easier to build the development environment. (#133)

* 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.
This commit is contained in:
ZekerZhayard authored and GitHub committed 2021-01-03 02:53:57 +08:00
1 parent 855131d1aa
commit 1b2a4dc260
28 files changed
+746 -532

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
// 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