"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readMavenCache = readMavenCache;
exports.writeMavenCache = writeMavenCache;
exports.getCachePath = getCachePath;
exports.setCurrentMavenData = setCurrentMavenData;
exports.getCurrentMavenData = getCurrentMavenData;
const path_1 = require("path");
const plugin_cache_utils_1 = require("nx/src/utils/plugin-cache-utils");
/**
 * Read the Maven targets cache from disk
 */
function readMavenCache(cachePath) {
    return new plugin_cache_utils_1.PluginCache(cachePath);
}
/**
 * Write the Maven targets cache to disk
 */
function writeMavenCache(cachePath, cache) {
    cache.writeToDisk(cachePath);
}
/**
 * Get the cache path for a given options hash
 */
function getCachePath(workspaceRoot, optionsHash) {
    return (0, path_1.join)(workspaceRoot, '.nx', 'workspace-data', `maven-${optionsHash}.hash`);
}
/**
 * Module-level variable to pass Maven analysis data from createNodes to createDependencies
 * without relying on hash matching (which can differ when projects use <includes>/<excludes>).
 */
let currentMavenData = null;
function setCurrentMavenData(data) {
    currentMavenData = data;
}
function getCurrentMavenData() {
    return currentMavenData;
}
