@muverse/core 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradle-project-information.d.ts","sourceRoot":"","sources":["../../../src/adapters/gradle/gradle-project-information.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AA4H1G;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"gradle-project-information.d.ts","sourceRoot":"","sources":["../../../src/adapters/gradle/gradle-project-information.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AA4H1G;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAqEtH;AA2CD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,qBAAqB,GAAG,kBAAkB,CA6CnG"}
|
|
@@ -22,7 +22,7 @@ const GRADLE_INIT_SCRIPT = './init-project-information.gradle.kts';
|
|
|
22
22
|
* Finds all Gradle build files recursively under the project root.
|
|
23
23
|
* Searches for settings.gradle, settings.gradle.kts, build.gradle, and build.gradle.kts files.
|
|
24
24
|
* @param projectRoot - Absolute path to the Gradle project root directory
|
|
25
|
-
* @returns Promise resolving to array of
|
|
25
|
+
* @returns Promise resolving to array of relative paths to Gradle build files
|
|
26
26
|
*/
|
|
27
27
|
async function findGradleFiles(projectRoot) {
|
|
28
28
|
const patterns = [
|
|
@@ -33,7 +33,7 @@ async function findGradleFiles(projectRoot) {
|
|
|
33
33
|
];
|
|
34
34
|
const files = await fg(patterns, {
|
|
35
35
|
cwd: projectRoot,
|
|
36
|
-
absolute:
|
|
36
|
+
absolute: false,
|
|
37
37
|
ignore: ['**/node_modules/**', '**/build/**', '**/.gradle/**']
|
|
38
38
|
});
|
|
39
39
|
// Sort for consistent ordering
|
|
@@ -49,7 +49,7 @@ async function computeGradleFilesHash(projectRoot) {
|
|
|
49
49
|
const files = await findGradleFiles(projectRoot);
|
|
50
50
|
const hash = crypto.createHash('sha256');
|
|
51
51
|
for (const file of files) {
|
|
52
|
-
const content = await fs.readFile(file, 'utf-8');
|
|
52
|
+
const content = await fs.readFile(join(projectRoot, file), 'utf-8');
|
|
53
53
|
hash.update(file); // Include file path for uniqueness
|
|
54
54
|
hash.update(content);
|
|
55
55
|
}
|
|
@@ -108,6 +108,7 @@ export async function getRawProjectInformation(projectRoot, outputFile) {
|
|
|
108
108
|
let executeScript = true;
|
|
109
109
|
// Compute hash of all Gradle build files
|
|
110
110
|
const currentHash = await computeGradleFilesHash(projectRoot);
|
|
111
|
+
logger.info(`🔍 Computed Gradle files hash: ${currentHash}`);
|
|
111
112
|
if (fileExists) {
|
|
112
113
|
logger.info(`💾 Cached project information found at ${outputFile}. Validating cache...`);
|
|
113
114
|
// Step 2: File exists, check cache validity
|
|
@@ -116,10 +117,15 @@ export async function getRawProjectInformation(projectRoot, outputFile) {
|
|
|
116
117
|
const cachedData = JSON.parse(fileContent);
|
|
117
118
|
// Step 2.1: Compare hashes
|
|
118
119
|
if (cachedData.hash === currentHash) {
|
|
120
|
+
logger.info(`✅ Cache is valid. Using cached project information.`);
|
|
119
121
|
// Cache hit - use cached data
|
|
120
122
|
executeScript = false;
|
|
121
123
|
data = cachedData.data;
|
|
122
124
|
}
|
|
125
|
+
else {
|
|
126
|
+
logger.info(`❌ Cache is invalid. Cached hash: ${cachedData.hash}`);
|
|
127
|
+
logger.info(`🔄 Gradle files changed, regenerating project information...`);
|
|
128
|
+
}
|
|
123
129
|
// Cache miss - hash mismatch, need to regenerate
|
|
124
130
|
}
|
|
125
131
|
catch (error) {
|