Search in sources :

Example 1 with Builder

use of net.sf.launch4j.Builder in project SIMRacingApps by SIMRacingApps.

the class Launch4jTask method execute.

public void execute() throws BuildException {
    try {
        if (tmpdir != null) {
            System.setProperty("launch4j.tmpdir", tmpdir.getPath());
        }
        if (bindir != null) {
            System.setProperty("launch4j.bindir", bindir.getPath());
        }
        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());
        } else {
            throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
        }
        final Builder b = new Builder(Log.getAntLog());
        b.build();
    } catch (ConfigPersisterException e) {
        throw new BuildException(e);
    } catch (BuilderException e) {
        throw new BuildException(e);
    }
}
Also used : BuilderException(net.sf.launch4j.BuilderException) ConfigPersisterException(net.sf.launch4j.config.ConfigPersisterException) Config(net.sf.launch4j.config.Config) Builder(net.sf.launch4j.Builder) BuildException(org.apache.tools.ant.BuildException)

Example 2 with Builder

use of net.sf.launch4j.Builder in project beast-mcmc by beast-dev.

the class Launch4jTask method execute.

public void execute() throws BuildException {
    try {
        if (tmpdir != null) {
            System.setProperty("launch4j.tmpdir", tmpdir.getPath());
        }
        if (bindir != null) {
            System.setProperty("launch4j.bindir", bindir.getPath());
        }
        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());
        } else {
            throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
        }
        final Builder b = new Builder(Log.getAntLog());
        b.build();
    } catch (ConfigPersisterException e) {
        throw new BuildException(e);
    } catch (BuilderException e) {
        throw new BuildException(e);
    }
}
Also used : BuilderException(net.sf.launch4j.BuilderException) ConfigPersisterException(net.sf.launch4j.config.ConfigPersisterException) Config(net.sf.launch4j.config.Config) Builder(net.sf.launch4j.Builder) BuildException(org.apache.tools.ant.BuildException)

Example 3 with Builder

use of net.sf.launch4j.Builder in project cogtool by cogtool.

the class Launch4jTask method execute.

public void execute() throws BuildException {
    try {
        if (tmpdir != null) {
            System.setProperty("launch4j.tmpdir", tmpdir.getPath());
        }
        if (bindir != null) {
            System.setProperty("launch4j.bindir", bindir.getPath());
        }
        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());
        } else {
            throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
        }
        final Builder b = new Builder(Log.getAntLog());
        b.build();
    } catch (ConfigPersisterException e) {
        throw new BuildException(e);
    } catch (BuilderException e) {
        throw new BuildException(e);
    }
}
Also used : BuilderException(net.sf.launch4j.BuilderException) ConfigPersisterException(net.sf.launch4j.config.ConfigPersisterException) Config(net.sf.launch4j.config.Config) Builder(net.sf.launch4j.Builder) BuildException(org.apache.tools.ant.BuildException)

Example 4 with Builder

use of net.sf.launch4j.Builder in project chipKIT32-MAX by chipKIT32.

the class Launch4jTask method execute.

public void execute() throws BuildException {
    try {
        if (tmpdir != null) {
            System.setProperty("launch4j.tmpdir", tmpdir.getPath());
        }
        if (bindir != null) {
            System.setProperty("launch4j.bindir", bindir.getPath());
        }
        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());
        } else {
            throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
        }
        final Builder b = new Builder(Log.getAntLog());
        b.build();
    } catch (ConfigPersisterException e) {
        throw new BuildException(e);
    } catch (BuilderException e) {
        throw new BuildException(e);
    }
}
Also used : BuilderException(net.sf.launch4j.BuilderException) ConfigPersisterException(net.sf.launch4j.config.ConfigPersisterException) Config(net.sf.launch4j.config.Config) Builder(net.sf.launch4j.Builder) BuildException(org.apache.tools.ant.BuildException)

Aggregations

Builder (net.sf.launch4j.Builder)4 BuilderException (net.sf.launch4j.BuilderException)4 Config (net.sf.launch4j.config.Config)4 ConfigPersisterException (net.sf.launch4j.config.ConfigPersisterException)4 BuildException (org.apache.tools.ant.BuildException)4