ScalaCompileOptionsImpl (@Nullable ScalaCompileOptions options) { if (options == null) return null; ScalaCompileOptionsImpl result = new ScalaCompileOptionsImpl(); result.setAdditionalParameters(wrapStringList(options.getAdditionalParameters())); MetaProperty daemonServerProperty = DefaultGroovyMethods.hasProperty(options, "daemonServer"); Object daemonServer = daemonServerProperty != null ? daemonServerProperty.getProperty(options) : null; if (daemonServer instanceof String) { result.setDaemonServer((String)daemonServer); } result.setDebugLevel(options.getDebugLevel()); result.setDeprecation(options.isDeprecation()); result.setEncoding(options.getEncoding()); result.setFailOnError(options.isFailOnError()); result.setForce(String.valueOf(options.isForce())); MetaProperty forkProperty = DefaultGroovyMethods.hasProperty(options, "fork"); Object fork = forkProperty != null ? forkProperty.getProperty(options) : null; if (fork instanceof Boolean) { result.setFork((Boolean)fork); } result.setForkOptions(create(options.getForkOptions())); result.setListFiles(options.isListFiles()); result.setLoggingLevel(options.getLoggingLevel()); result.setDebugLevel(options.getDebugLevel()); result.setLoggingPhases(wrapStringList(options.getLoggingPhases())); result.setOptimize(options.isOptimize()); result.setUnchecked(options.isUnchecked()); MetaProperty useAntProperty = DefaultGroovyMethods.hasProperty(options, "useAnt"); Object useAnt = useAntProperty != null ? useAntProperty.getProperty(options) : null; if (useAnt instanceof Boolean) { result.setUseAnt((Boolean)useAnt); } MetaProperty useCompileDaemonProperty = DefaultGroovyMethods.hasProperty(options, "useCompileDaemon"); Object useCompileDaemon = useCompileDaemonProperty != null ? useCompileDaemonProperty.getProperty(options) : null; if (useCompileDaemon instanceof Boolean) { result.setUseCompileDaemon((Boolean)useCompileDaemon); } return result; }