Skip to content

Commit

Permalink
feat: Publish Gradle module metadata for Maven target
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn committed May 15, 2024
1 parent 3dff57a commit 3743479
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/targets/__tests__/maven.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,11 @@ describe('upload', () => {
expect(cmdArgs[1]).toMatch(new RegExp(`-Dfile=${tmpDirName}.+`));
expect(cmdArgs[2]).toMatch(
new RegExp(
`-Dfiles=${tmpDirName}.+-javadoc\\.jar,${tmpDirName}.+-sources\\.jar`
`-Dfiles=${tmpDirName}.+-javadoc\\.jar,${tmpDirName}.+-sources\\.jar,${tmpDirName}.+\\.module`
)
);
expect(cmdArgs[3]).toBe(`-Dclassifiers=javadoc,sources`);
expect(cmdArgs[4]).toBe(`-Dtypes=jar,jar`);
expect(cmdArgs[3]).toBe(`-Dclassifiers=javadoc,sources,`);
expect(cmdArgs[4]).toBe(`-Dtypes=jar,jar,module`);
expect(cmdArgs[5]).toMatch(
new RegExp(`-DpomFile=${tmpDirName}.+pom-default\\.xml`)
);
Expand Down
9 changes: 5 additions & 4 deletions src/targets/maven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,16 +484,17 @@ export class MavenTarget extends BaseTarget {
javadocFile,
sourcesFile,
pomFile,
moduleFile,
} = this.getFilesForMavenPomDist(distDir);

// Maven central is very flaky, so retrying with an exponential delay in
// in case it fails.
await retrySpawnProcess(this.mavenConfig.mavenCliPath, [
'gpg:sign-and-deploy-file',
`-Dfile=${targetFile}`,
`-Dfiles=${javadocFile},${sourcesFile}`,
`-Dclassifiers=javadoc,sources`,
`-Dtypes=jar,jar`,
`-Dfiles=${javadocFile},${sourcesFile},${moduleFile}`,
`-Dclassifiers=javadoc,sources,`,
`-Dtypes=jar,jar,module`,
`-DpomFile=${pomFile}`,
`-DrepositoryId=${this.mavenConfig.mavenRepoId}`,
`-Durl=${this.mavenConfig.mavenRepoUrl}`,
Expand All @@ -518,6 +519,7 @@ export class MavenTarget extends BaseTarget {
javadocFile: join(distDir, `${moduleName}-javadoc.jar`),
sourcesFile: join(distDir, `${moduleName}-sources.jar`),
pomFile: join(distDir, 'pom-default.xml'),
moduleFile: join(distDir, `${moduleName}.module`)
};
}

Expand Down Expand Up @@ -557,7 +559,6 @@ export class MavenTarget extends BaseTarget {

files['klibFiles'] = cinteropFiles;
}
files['moduleFile'] = join(distDir, `${moduleName}.module`);
}
return files;
}
Expand Down

0 comments on commit 3743479

Please sign in to comment.