Skip to content

Commit

Permalink
feat: simplify addProjects function (#1444)
Browse files Browse the repository at this point in the history
* feat: update graph calculation to fit complex cases

* build: work in progress
  • Loading branch information
khalilou88 authored Dec 11, 2024
1 parent f7a0d5b commit 51e0665
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/nx-maven/src/graph/graph-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ export function getWorkspaceData(opts: NxMavenPluginOptions | undefined) {
: false;

const projects: MavenProjectType[] = [];
addProjects(
skipProjectWithoutProjectJson,
mavenRootDirAbsolutePath,
projects,
'',
);
addProjects(skipProjectWithoutProjectJson, projects, mavenRootDirectory);

//TODO calculate versions here

Expand Down Expand Up @@ -110,16 +105,12 @@ export function removeWorkspaceDataCache() {

export function addProjects(
skipProjectWithoutProjectJson: boolean,
mavenRootDirAbsolutePath: string,
projects: MavenProjectType[],
projectRelativePath: string,
aggregatorProjectArtifactId?: string,
) {
//projectAbsolutePath
const projectAbsolutePath = path.join(
mavenRootDirAbsolutePath,
projectRelativePath,
);
const projectAbsolutePath = path.join(workspaceRoot, projectRelativePath);
const pomXmlPath = path.join(projectAbsolutePath, 'pom.xml');
const pomXmlContent = readXml(pomXmlPath);

Expand Down Expand Up @@ -183,7 +174,6 @@ export function addProjects(
);
addProjects(
skipProjectWithoutProjectJson,
mavenRootDirAbsolutePath,
projects,
moduleRelativePath,
artifactId,
Expand Down

0 comments on commit 51e0665

Please sign in to comment.