Skip to content

Commit

Permalink
fix generated module name.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Aug 10, 2024
1 parent a526783 commit 78e18d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ext {
jsoniter = '2.11.+'
sava = '1.0.+'
sava_solana_programs = '1.0.2'
sava_anchor_src_gen = '1.0.2'
sava_anchor_src_gen = '1.0.3'
bouncycastleMinor = 'jdk18on'
bouncycastlePatch = '1.78.1' // https://www.bouncycastle.org/latest_releases.html#LATEST
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private String formatPackage(final String moduleName) {
private AnchorSourceGenerator createGenerator(final String moduleName, final AnchorIDL idl) {
return new AnchorSourceGenerator(
sourceDirectory,
outputModuleName,
formatPackage(moduleName),
tabLength,
idl
Expand Down Expand Up @@ -155,7 +154,7 @@ public static void main(final String[] args) throws InterruptedException {
"2"
));
final var sourceDirectory = Path.of(propertyOrElse(moduleName + ".sourceDirectory", "anchor-programs/src/main/java")).toAbsolutePath();
final var outputModuleName = propertyOrElse(moduleName + ".moduleName", moduleName.substring(moduleName.lastIndexOf('.')) + ".anchor_programs");
final var outputModuleName = propertyOrElse(moduleName + ".moduleName", moduleName.substring(0, moduleName.lastIndexOf('.')) + ".anchor_programs");
final var basePackageName = propertyOrElse(moduleName + ".basePackageName", clas.getPackageName());
final var rpcEndpoint = System.getProperty(moduleName + ".rpc");
final var programsCSV = mandatoryProperty(moduleName + ".programsCSV");
Expand Down Expand Up @@ -215,7 +214,7 @@ public static void main(final String[] args) throws InterruptedException {
}
}
final var builder = new StringBuilder(2_048);
builder.append(String.format("module %s {%n", moduleName));
builder.append(String.format("module %s {%n", outputModuleName));

for (final var thread : threads) {
thread.join();
Expand Down
2 changes: 1 addition & 1 deletion programs/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module software.sava.anchor_generator {
module software.sava.anchor_programs {
exports software.sava.anchor.programs.drift.anchor.types;
exports software.sava.anchor.programs.drift.anchor;
exports software.sava.anchor.programs.glam.anchor.types;
Expand Down

0 comments on commit 78e18d9

Please sign in to comment.