[jps] IDEA-381056 Remove unused build option inactive since 2021.1

The option was introduced as a Registry flag in `aba75dc4a9c7d6c33f8aa96a83d5505304e5e0b2` and later replaced with a system property in `63439ad1d476dda6f6d7640d3fb19f1dcc63917e` due to Fleet’s inability to access the Registry. The property is read but never set anywhere in the product or in `ultimate-teamcity-config`, so the behavior has effectively been disabled since 2021.1. This change removes the property handling and related code paths. No functional change is expected.


(cherry picked from commit a06a298f8776f3e2d648176198b30d56c1fd7021)

IJ-CR-179667

GitOrigin-RevId: 08e1f054ad61be423f98e0af9f97995ea5293858
This commit is contained in:
Alexander Koshevoy
2025-10-24 21:59:36 +00:00
committed by intellij-monorepo-bot
parent 45a9739557
commit c387d5039b
@@ -19,7 +19,6 @@ import com.intellij.execution.ExecutionManager;
import com.intellij.execution.process.*;
import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.wsl.WSLDistribution;
import com.intellij.execution.wsl.WslDistributionManager;
import com.intellij.execution.wsl.WslPath;
import com.intellij.execution.wsl.WslProxy;
import com.intellij.ide.IdleTracker;
@@ -207,43 +206,28 @@ public final class BuildManager implements Disposable {
return;
}
Collection<File> systemDirs = Collections.singleton(LocalBuildCommandLineBuilder.getLocalBuildSystemDirectory().toFile());
if (Boolean.parseBoolean(System.getProperty("compiler.build.data.clean.unused.wsl"))) {
final List<WSLDistribution> distributions = WslDistributionManager.getInstance().getInstalledDistributions();
if (!distributions.isEmpty()) {
systemDirs = new ArrayList<>(systemDirs);
for (WSLDistribution distribution : distributions) {
final Path wslSystemDir = WslBuildCommandLineBuilder.getWslBuildSystemDirectory(distribution);
if (wslSystemDir != null) {
systemDirs.add(wslSystemDir.toFile());
}
}
}
}
for (File buildSystemDir : systemDirs) {
File[] dirs = buildSystemDir.listFiles(pathname -> pathname.isDirectory() && !TEMP_DIR_NAME.equals(pathname.getName()));
if (dirs != null) {
Instant now = Instant.now();
for (File buildDataProjectDir : dirs) {
File usageFile = getUsageFile(buildDataProjectDir);
if (usageFile.exists()) {
final Pair<Date, File> usageData = readUsageFile(usageFile);
if (usageData != null) {
final File projectFile = usageData.second;
if (projectFile != null && !projectFile.exists() ||
Duration.between(usageData.first.toInstant(), now).toDays() > unusedThresholdDays) {
LOG.info("Clearing project build data because the project does not exist or was not opened for more than " +
unusedThresholdDays +
" days: " +
buildDataProjectDir);
FileUtil.delete(buildDataProjectDir);
}
File buildSystemDir = LocalBuildCommandLineBuilder.getLocalBuildSystemDirectory().toFile();
File[] dirs = buildSystemDir.listFiles(pathname -> pathname.isDirectory() && !TEMP_DIR_NAME.equals(pathname.getName()));
if (dirs != null) {
Instant now = Instant.now();
for (File buildDataProjectDir : dirs) {
File usageFile = getUsageFile(buildDataProjectDir);
if (usageFile.exists()) {
final Pair<Date, File> usageData = readUsageFile(usageFile);
if (usageData != null) {
final File projectFile = usageData.second;
if (projectFile != null && !projectFile.exists() ||
Duration.between(usageData.first.toInstant(), now).toDays() > unusedThresholdDays) {
LOG.info("Clearing project build data because the project does not exist or was not opened for more than " +
unusedThresholdDays +
" days: " +
buildDataProjectDir);
FileUtil.delete(buildDataProjectDir);
}
}
else {
updateUsageFile(null, buildDataProjectDir); // set usage stamp to start the countdown
}
}
else {
updateUsageFile(null, buildDataProjectDir); // set usage stamp to start the countdown
}
}
}