mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-05 16:49:04 +00:00
Remove plugins.gradle and factor into common extension
This commit is contained in:
@@ -1,5 +1,37 @@
|
||||
import java.nio.file.Paths
|
||||
import java.nio.file.Path
|
||||
|
||||
rootProject.name = 'org.apollo'
|
||||
include ':cache'
|
||||
include ':game'
|
||||
include ':game:plugin'
|
||||
include ':game:plugin-testing'
|
||||
include ':net'
|
||||
include ':util'
|
||||
|
||||
def pluginDirs = [
|
||||
rootProject.projectDir.toPath().resolve("game/plugin"),
|
||||
]
|
||||
|
||||
def processPluginDir(Path pluginDir) {
|
||||
if (pluginDir.toFile().exists()) {
|
||||
def pluginFileFinder = new FileNameFinder();
|
||||
def pluginFiles = pluginFileFinder.getFileNames(pluginDir.toString(), "**/*.gradle");
|
||||
|
||||
pluginFiles.each { filename ->
|
||||
def path = Paths.get(filename)
|
||||
def parentPath = path.parent
|
||||
|
||||
if (parentPath == pluginDir) {
|
||||
return
|
||||
}
|
||||
|
||||
def relativePath = pluginDir.relativize(parentPath)
|
||||
def pluginName = relativePath.toString().replaceAll("/", ":")
|
||||
|
||||
include ":game:plugin:$pluginName"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pluginDirs.each { processPluginDir(it) }
|
||||
Reference in New Issue
Block a user