Skip to content

Commit

Permalink
Actually do caching
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <tsmock@meta.com>
  • Loading branch information
tsmock committed Oct 2, 2024
1 parent bfd04bd commit ffac67d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
11 changes: 11 additions & 0 deletions actions/josm_plugin_dependencies/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78365,6 +78365,17 @@ async function dependencies(pluginDir) {
await (0,cache.saveCache)(corePaths, coreKey);
}
});
if ((0,external_fs_.existsSync)((0,external_path_.join)(pluginDir, "pom.xml"))) {
const mavenPluginCache = await (0,cache.restoreCache)(["~/.ivy2/cache", "~/.ant/cache", "~/.m2/repository"], `${process.platform}-${process.arch}-mvn-plugin-${await (0,glob.hashFiles)("josm/plugins/**/pom.xml\n" + "josm/plugins/**/ivy.xml")}`);
if (mavenPluginCache == null) {
await (0,exec.exec)("ant", [
"-buildfile",
(0,external_path_.join)(pluginDir, "build.xml"),
"fetch_dependencies",
]);
await (0,cache.saveCache)(["~/.ivy2/cache/", "~/.ant/cache", "~/.m2/repository"], `${process.platform}-${process.arch}-mvn-plugin-${await (0,glob.hashFiles)("josm/plugins/**/pom.xml\n" + "josm/plugins/**/ivy.xml")}`);
}
}
if ((0,external_fs_.existsSync)((0,external_path_.join)(pluginDir, "ivy.xml"))) {
const ivyPluginCache = await (0,cache.restoreCache)(["~/.ivy2/cache", "~/.ant/cache"], `${process.platform}-${process.arch}-ivy-plugin-${await (0,glob.hashFiles)("josm/plugins/**/ivy.xml")}`);
if (ivyPluginCache == null) {
Expand Down
2 changes: 1 addition & 1 deletion actions/josm_plugin_dependencies/dist/index.js.map

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions actions/josm_plugin_dependencies/src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ async function dependencies(pluginDir: string): Promise<void> {
await saveCache(corePaths, coreKey);
}
});
if (existsSync(join(pluginDir, "pom.xml"))) {
const mavenPluginCache = await restoreCache(
["~/.ivy2/cache", "~/.ant/cache", "~/.m2/repository"],
`${process.platform}-${process.arch}-mvn-plugin-${await hashFiles(
"josm/plugins/**/pom.xml\n" + "josm/plugins/**/ivy.xml",
)}`,
);
if (mavenPluginCache == null) {
await exec("ant", [
"-buildfile",
join(pluginDir, "build.xml"),
"fetch_dependencies",
]);
await saveCache(
["~/.ivy2/cache/", "~/.ant/cache", "~/.m2/repository"],
`${process.platform}-${process.arch}-mvn-plugin-${await hashFiles(
"josm/plugins/**/pom.xml\n" + "josm/plugins/**/ivy.xml",
)}`,
);
}
}
if (existsSync(join(pluginDir, "ivy.xml"))) {
const ivyPluginCache = await restoreCache(
["~/.ivy2/cache", "~/.ant/cache"],
Expand Down

0 comments on commit ffac67d

Please sign in to comment.