Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mfirry committed Oct 19, 2024
1 parent de5f55b commit 5f2e99d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,16 @@ private void writeCompiledClasses(CompilerResult result, Path finalFolder)
private void generateClass(Path finalSourceFolder, String packageName, String machineName) {
SourceRoot dest = new SourceRoot(finalSourceFolder);

CompilationUnit cu = new CompilationUnit(packageName);
var cu = new CompilationUnit(packageName);
cu.setPackageDeclaration(packageName);
cu.setStorage(finalSourceFolder.resolve(machineName + ".java"));

cu.addImport("com.dylibso.chicory.runtime.Instance");
cu.addImport("com.dylibso.chicory.runtime.Machine");

var clazz = cu.addClass(machineName, Modifier.Keyword.PUBLIC, Modifier.Keyword.FINAL);
clazz.addConstructor(Modifier.Keyword.PRIVATE).createBody();
var constr = clazz.addConstructor(Modifier.Keyword.PRIVATE);
constr.createBody();

var method = clazz.addMethod("create", Modifier.Keyword.PUBLIC, Modifier.Keyword.STATIC);
method.addParameter(parseType("Instance"), "instance");
Expand Down

0 comments on commit 5f2e99d

Please sign in to comment.