< prev index next >

src/jdk.jextract/share/classes/com/sun/tools/jextract/Main.java

Print this page

        

@@ -91,11 +91,11 @@
         if (!Files.isReadable(p)) {
             throw new IllegalArgumentException(format("cannot.read.header.file", header));
         }
         p = p.toAbsolutePath();
         ctx.usePackageForFolder(p.getParent(), targetPackage);
-        ctx.sources.add(p);
+        ctx.addSource(p);
     }
 
     private void setupLogging(Level level) {
         Logger logger = ctx.logger;
         logger.setUseParentHandlers(false);

@@ -158,25 +158,25 @@
         } else {
             setupLogging(Level.WARNING);
         }
 
         if (options.has("I")) {
-            options.valuesOf("I").forEach(p -> ctx.clangArgs.add("-I" + p));
+            options.valuesOf("I").forEach(p -> ctx.addClangArg("-I" + p));
         }
 
         if (options.has("C")) {
-            options.valuesOf("C").forEach(p -> ctx.clangArgs.add((String) p));
+            options.valuesOf("C").forEach(p -> ctx.addClangArg((String) p));
         }
 
         if (options.has("l")) {
             try {
                 options.valuesOf("l").forEach(p -> {
                     String lib = (String)p;
                     if (lib.indexOf(File.separatorChar) != -1) {
                         throw new IllegalArgumentException(format("l.name.should.not.be.path", lib));
                     }
-                    ctx.libraryNames.add(lib);
+                    ctx.addLibraryName(lib);
                 });
             } catch (IllegalArgumentException iae) {
                 ctx.err.println(iae.getMessage());
                 if (Main.DEBUG) {
                     iae.printStackTrace(ctx.err);

@@ -186,20 +186,20 @@
         }
 
         if (options.has("rpath")) {
             // "rpath" with no "l" option!
             if (options.has("l")) {
-                options.valuesOf("rpath").forEach(p -> ctx.libraryPaths.add((String) p));
+                options.valuesOf("rpath").forEach(p -> ctx.addLibraryPath((String) p));
             } else {
                 ctx.err.println(format("warn.rpath.without.l"));
             }
         }
 
         if (options.has("L")) {
             // "L" with no "l" option!
             if (options.has("l")) {
-                options.valuesOf("L").forEach(p -> ctx.linkCheckPaths.add((String) p));
+                options.valuesOf("L").forEach(p -> ctx.addLinkCheckPath((String) p));
             } else {
                 ctx.err.println(format("warn.L.without.l"));
             }
         }
 

@@ -212,11 +212,11 @@
             options.valuesOf("m").forEach(this::processPackageMapping);
         }
 
         try {
             options.nonOptionArguments().stream().forEach(this::processHeader);
-            ctx.parse(AsmCodeFactory::new);
+            ctx.parse();
         } catch (RuntimeException re) {
             ctx.err.println(re.getMessage());
             if (Main.DEBUG) {
                 re.printStackTrace(ctx.err);
             }

@@ -242,11 +242,11 @@
 
         return 0;
     }
 
     public static void main(String... args) {
-        Main instance = new Main(Context.newInstance());
+        Main instance = new Main(new Context());
 
         System.exit(instance.run(args));
     }
 
     public static class JextractToolProvider implements ToolProvider {

@@ -264,10 +264,10 @@
             if (System.getSecurityManager() != null) {
                 System.getSecurityManager().
                     checkPermission(new RuntimePermission("jextract"));
             }
 
-            Main instance = new Main(Context.newInstance(out, err));
+            Main instance = new Main(new Context(out, err));
             return instance.run(args);
         }
     }
 }
< prev index next >