From 5f37ba48ffc7b5b4421a3a804a5f0e9b75f10fda Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Thu, 9 May 2019 18:41:08 +0200 Subject: [PATCH] Reduce amount of 'relocate' statements for far better build times --- versions/common.gradle | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/versions/common.gradle b/versions/common.gradle index 81ea3348..33326896 100644 --- a/versions/common.gradle +++ b/versions/common.gradle @@ -311,8 +311,16 @@ task configureRelocation() { tree.visit { file -> if (!file.directory && file.name.endsWith('.class') && file.path.contains('/')) { def pkg = file.path.substring(0, file.path.lastIndexOf('/')) - if (!pkg.startsWith('com/replaymod') && !pkg.startsWith('javax/')) { - pkgs << pkg + if (pkg.startsWith('com/')) { + if (!pkg.startsWith('com/replaymod')) { + pkgs << pkg.substring(0, pkg.indexOf('/', 4)) + } + } else if (pkg.startsWith('org/')) { + if (!pkg.startsWith('org/spongepowered')) { + pkgs << pkg.substring(0, pkg.indexOf('/', 4)) + } + } else if (!pkg.startsWith('javax/')) { + pkgs << pkg.substring(0, pkg.indexOf('/')) } } }