protected boolean compileGeneratedClasses(ErrorReceiver receiver, WsimportListener listener){ List<String> sourceFiles = new ArrayList<String>(); for (File f : options.getGeneratedFiles()) { if (f.exists() && f.getName().endsWith(".java")) { sourceFiles.add(f.getAbsolutePath()); } } if (sourceFiles.size() > 0) { String classDir = options.destDir.getAbsolutePath(); String classpathString = createClasspathString(); boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class); List<String> args = new ArrayList<String>(); args.add("-d"); args.add(classDir); args.add("-classpath"); args.add(classpathString); //javac is not working in osgi as the url starts with a bundle if (bootCP) { args.add("-Xbootclasspath/p:" + JavaCompilerHelper.getJarFile(EndpointContext.class) + File.pathSeparator + JavaCompilerHelper.getJarFile(JAXBPermission.class)); } if (options.debug) { args.add("-g"); } if (options.encoding != null) { args.add("-encoding"); args.add(options.encoding); } if (options.javacOptions != null) { args.addAll(options.getJavacOptions(args, listener)); } for (int i = 0; i < sourceFiles.size(); ++i) { args.add(sourceFiles.get(i)); } listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE()); if(options.verbose){ StringBuilder argstr = new StringBuilder(); for(String arg:args){ argstr.append(arg).append(" "); } listener.message("javac "+ argstr.toString()); } return JavaCompilerHelper.compile(args.toArray(new String[args.size()]), out, receiver); } //there are no files to compile, so return true? return true; }
protected boolean compileGeneratedClasses(ErrorReceiver receiver, WsimportListener listener){ List<String> sourceFiles = new ArrayList<String>(); for (File f : options.getGeneratedFiles()) { if (f.exists() && f.getName().endsWith(".java")) { sourceFiles.add(f.getAbsolutePath()); } } if (sourceFiles.size() > 0) { String classDir = options.destDir.getAbsolutePath(); String classpathString = createClasspathString(); boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class); List<String> args = new ArrayList<String>(); args.add("-addmods"); args.add("java.xml.ws"); args.add("-d"); args.add(classDir); args.add("-classpath"); args.add(classpathString); //javac is not working in osgi as the url starts with a bundle if (bootCP) { args.add("-Xbootclasspath/p:" + JavaCompilerHelper.getJarFile(EndpointContext.class) + File.pathSeparator + JavaCompilerHelper.getJarFile(JAXBPermission.class)); } if (options.debug) { args.add("-g"); } if (options.encoding != null) { args.add("-encoding"); args.add(options.encoding); } if (options.javacOptions != null) { args.addAll(options.getJavacOptions(args, listener)); } for (int i = 0; i < sourceFiles.size(); ++i) { args.add(sourceFiles.get(i)); } if (!options.quiet) listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE()); if(options.verbose){ StringBuilder argstr = new StringBuilder(); for(String arg:args){ argstr.append(arg).append(" "); } listener.message("javac "+ argstr.toString()); } return JavaCompilerHelper.compile(args.toArray(new String[args.size()]), out, receiver); } //there are no files to compile, so return true? return true; }
protected boolean compileGeneratedClasses(ErrorReceiver receiver, WsimportListener listener){ List<String> sourceFiles = new ArrayList<String>(); for (File f : options.getGeneratedFiles()) { if (f.exists() && f.getName().endsWith(".java")) { sourceFiles.add(f.getAbsolutePath()); } } if (sourceFiles.size() > 0) { String classDir = options.destDir.getAbsolutePath(); String classpathString = createClasspathString(); boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class); String[] args = new String[4 + (bootCP ? 1 : 0) + (options.debug ? 1 : 0) + sourceFiles.size()]; args[0] = "-d"; args[1] = classDir; args[2] = "-classpath"; args[3] = classpathString; int baseIndex = 4; //javac is not working in osgi as the url starts with a bundle if (bootCP) { args[baseIndex++] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointContext.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(JAXBPermission.class); } if (options.debug) { args[baseIndex++] = "-g"; } for (int i = 0; i < sourceFiles.size(); ++i) { args[baseIndex + i] = sourceFiles.get(i); } listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE()); if(options.verbose){ StringBuffer argstr = new StringBuffer(); for(String arg:args){ argstr.append(arg).append(" "); } listener.message("javac "+ argstr.toString()); } return JavaCompilerHelper.compile(args, out, receiver); } //there are no files to compile, so return true? return true; }