Package net.sf.launch4j.config

Examples of net.sf.launch4j.config.Config


    _libsCheck.addActionListener(new LibsActionListener());
  }

  private class HeaderTypeChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent e) {
      Config c = ConfigPersister.getInstance().getConfig();
      c.setHeaderType(_guiHeaderRadio.isSelected() ? Config.GUI_HEADER
                            : Config.CONSOLE_HEADER);
      if (!_headerObjectsCheck.isSelected()) {
        Binding b = _bindings.getBinding("headerObjects");
        b.put(c);
      }
View Full Code Here


  }

  public void execute() throws MojoExecutionException {
    if (getLog().isDebugEnabled()) printState();

    Config c = new Config();

    c.setHeaderType(headerType);
    c.setOutfile(outfile);
    c.setJar(getJar());
    c.setDontWrapJar(dontWrapJar);
    c.setErrTitle(errTitle);
    c.setDownloadUrl(downloadUrl);
    c.setSupportUrl(supportUrl);
    c.setCmdLine(cmdLine);
    c.setChdir(chdir);
    c.setPriority(priority);
    c.setCustomProcName(customProcName);
    c.setStayAlive(stayAlive);
        c.setManifest(manifest);
    c.setIcon(icon);
    c.setHeaderObjects(objs);
    c.setLibs(libs);
    c.setVariables(vars);

    if (classPath != null) {
      c.setClassPath(classPath.toL4j(dependencies));
    }
    if (jre != null) {
      c.setJre(jre.toL4j());
    }
    if (singleInstance != null) {
      c.setSingleInstance(singleInstance.toL4j());
    }
    if (splash != null) {
      c.setSplash(splash.toL4j());
    }
    if (versionInfo != null) {
      c.setVersionInfo(versionInfo.toL4j());
    }
    if (messages != null) {
      c.setMessages(messages.toL4j());
    }

    ConfigPersister.getInstance().setAntConfig(c, getBaseDir());
    File workdir = setupBuildEnvironment();
    Builder b = new Builder(new MavenLog(getLog()), workdir);
View Full Code Here

  /**
   * @return Output file path.
   */
  public File build() throws BuilderException {
    final Config c = ConfigPersister.getInstance().getConfig();
    try {
      c.validate();
    } catch (InvariantViolationException e) {
      throw new BuilderException(e.getMessage());
    }
    File rc = null;
    File ro = null;
    File outfile = null;
    FileInputStream is = null;
    FileOutputStream os = null;
    final RcBuilder rcb = new RcBuilder();
    try {
      rc = rcb.build(c);
      ro = Util.createTempFile("o");
      outfile = ConfigPersister.getInstance().getOutputFile();

      Cmd resCmd = new Cmd(_basedir);
      resCmd.addExe("windres")
          .add(Util.WINDOWS_OS ? "--preprocessor=type" : "--preprocessor=cat")
          .add("-J rc -O coff -F pe-i386")
          .addAbsFile(rc)
          .addAbsFile(ro);
      _log.append(Messages.getString("Builder.compiling.resources"));
      resCmd.exec(_log);

      Cmd ldCmd = new Cmd(_basedir);
      ldCmd.addExe("ld")
          .add("-mi386pe")
          .add("--oformat pei-i386")
          .add((c.getHeaderType().equals(Config.GUI_HEADER))
              ? "--subsystem windows" : "--subsystem console")
          .add("-s")    // strip symbols
          .addFiles(c.getHeaderObjects())
          .addAbsFile(ro)
          .addFiles(c.getLibs())
          .add("-o")
          .addAbsFile(outfile);
      _log.append(Messages.getString("Builder.linking"));
      ldCmd.exec(_log);

      if (!c.isDontWrapJar()) {
        _log.append(Messages.getString("Builder.wrapping"));
        int len;
        byte[] buffer = new byte[1024];
        is = new FileInputStream(Util.getAbsoluteFile(
            ConfigPersister.getInstance().getConfigPath(),  c.getJar()));
        os = new FileOutputStream(outfile, true);
        while ((len = is.read(buffer)) > 0) {
          os.write(buffer, 0, len);
        }
      }
View Full Code Here

      if (_configFile != null && _config != null) {
        throw new BuildException(
            Messages.getString("Launch4jTask.specify.config"));
      } else if (_configFile != null) {
        ConfigPersister.getInstance().load(_configFile);
        Config c = ConfigPersister.getInstance().getConfig();
        if (jar != null) {
          c.setJar(jar);
        }
        if (outfile != null) {
          c.setOutfile(outfile);
        }
        if (fileVersion != null) {
          c.getVersionInfo().setFileVersion(fileVersion);
        }
        if (txtFileVersion != null) {
          c.getVersionInfo().setTxtFileVersion(txtFileVersion);
        }
        if (productVersion != null) {
          c.getVersionInfo().setProductVersion(productVersion);
        }
        if (txtProductVersion != null) {
          c.getVersionInfo().setTxtProductVersion(txtProductVersion);
        }
      } else if (_config != null) {
        _config.unwrap();
        ConfigPersister.getInstance().setAntConfig(_config,
            getProject().getBaseDir());
View Full Code Here

  }

  public void execute() throws MojoExecutionException {
    if (getLog().isDebugEnabled()) printState();

    Config c = new Config();

    c.setHeaderType(headerType);
    c.setOutfile(outfile);
    c.setJar(getJar());
    c.setDontWrapJar(dontWrapJar);
    c.setErrTitle(errTitle);
    c.setDownloadUrl(downloadUrl);
    c.setSupportUrl(supportUrl);
    c.setCmdLine(cmdLine);
    c.setChdir(chdir);
    c.setPriority(priority);   
    c.setStayAlive(stayAlive);
        c.setManifest(manifest);
    c.setIcon(icon);
    c.setHeaderObjects(objs);
    c.setLibs(libs);
    c.setVariables(vars);

    if (classPath != null) {
      c.setClassPath(classPath.toL4j(dependencies));
    }
    if (jre != null) {
      c.setJre(jre.toL4j());
    }
    if (singleInstance != null) {
      c.setSingleInstance(singleInstance.toL4j());
    }
    if (splash != null) {
      c.setSplash(splash.toL4j());
    }
    if (versionInfo != null) {
      c.setVersionInfo(versionInfo.toL4j());
    }
    if (messages != null) {
      c.setMessages(messages.toL4j());
    }

    ConfigPersister.getInstance().setAntConfig(c, getBaseDir());
    File workdir = setupBuildEnvironment();
    Builder b = new Builder(new MavenLog(getLog()), workdir);
View Full Code Here

  }

  public void execute() throws MojoExecutionException {
    if (getLog().isDebugEnabled()) printState();

    Config c = new Config();

    c.setHeaderType(headerType);
    c.setOutfile(outfile);
    c.setJar(getJar());
    c.setDontWrapJar(dontWrapJar);
    c.setErrTitle(errTitle);
    c.setDownloadUrl(downloadUrl);
    c.setSupportUrl(supportUrl);
    c.setCmdLine(cmdLine);
    c.setChdir(chdir);
    c.setPriority(priority);
    c.setCustomProcName(customProcName);
    c.setStayAlive(stayAlive);
        c.setManifest(manifest);
    c.setIcon(icon);
    c.setHeaderObjects(objs);
    c.setLibs(libs);
    c.setVariables(vars);

    if (classPath != null) {
      c.setClassPath(classPath.toL4j(dependencies));
    }
    if (jre != null) {
      c.setJre(jre.toL4j());
    }
    if (splash != null) {
      c.setSplash(splash.toL4j());
    }
    if (versionInfo != null) {
      c.setVersionInfo(versionInfo.toL4j());
    }
    if (messages != null) {
      c.setMessages(messages.toL4j());
    }

    ConfigPersister.getInstance().setAntConfig(c, getBaseDir());
    File workdir = setupBuildEnvironment();
    Builder b = new Builder(new MavenLog(getLog()), workdir);
View Full Code Here

TOP

Related Classes of net.sf.launch4j.config.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.