chore (build): remove RemoteModuleGatherer
gradle is smart enough to put runtime dependencies on the classpath
@@ -226,71 +226,6 @@ project(":modules").subprojects.forEach { proj ->
}
}
-/**
- * Gathering remote modules files from remoteRepo to 'modules' for autoloading in game-time (tasks server, game etc)
- */
-class RemoteModuleGatherer implements DependencyResolutionListener {
-
- private final Path modulesDir
- private final Logger logger
-
- RemoteModuleGatherer(Path modulesDir) {
- this.modulesDir = modulesDir
- this.logger = Logging.getLogger(this.class)
- }
-
- @Override
- void beforeResolve(ResolvableDependencies dependencies) {
- // nothing to do
- }
-
- @Override
- void afterResolve(ResolvableDependencies dependencies) {
- // We process only module dependencies
- if (dependencies.path.startsWith(":modules:") &&
- dependencies.name == "compileClasspath") {
- def projectName = dependencies.path.split(":")[2]
-
- if (!dependencies.artifacts.artifacts.empty) {
- logger.debug("\nProcessing module '{}' in a multi-project workspace", projectName)
- }
-
- dependencies.artifacts.artifacts.each {
- if (isRemoteTerasologyModule(it)) {
- println "$projectName resolved binary $it"
- def binaryModulePath = modulesDir.resolve(it.file.name)
- Files.copy(it.file.toPath(), binaryModulePath, StandardCopyOption.REPLACE_EXISTING)
- } else if (isLocalTerasologyModule(it)) {
- logger.info("*** Found module dependency {} in source form, not copying a runtime jar from Gradle", it)
- } else {
- //ignore non terasology module
- }
- }
- }
- }
-
- private static boolean isRemoteTerasologyModule(ResolvedArtifactResult artifact) {
- def componentIdentifier = artifact.id.componentIdentifier
- if (componentIdentifier instanceof ModuleComponentIdentifier) {
- def module = componentIdentifier as ModuleComponentIdentifier
- return module.group == 'org.terasology.modules'
- }
- return false
- }
-
- private static boolean isLocalTerasologyModule(ResolvedArtifactResult artifact) {
- def componentIdentifier = artifact.id.componentIdentifier
- if (componentIdentifier instanceof ProjectComponentIdentifier) {
- def module = componentIdentifier as ProjectComponentIdentifier
- return !(module.projectName in ['engine', 'engine-tests'])
- }
- return false
- }
-}
-
-gradle.addListener(new RemoteModuleGatherer(rootDir.toPath().resolve("modules")))
-
-
tasks.named('wrapper') {
// ALL distributionType because IntelliJ prefers having its sources for analysis and reference.
distributionType = Wrapper.DistributionType.ALL
