Search in sources :

Example 1 with MacroInfo

use of bndtools.release.ReleaseHelper.MacroInfo in project bndtools by bndtools.

the class WorkspaceReleaseDialog method okPressed.

@Override
protected void okPressed() {
    if (bundleRelease.getReleaseOption() == null) {
        for (ProjectDiff diff : projectDiffs) {
            if (diff.isRelease()) {
                Activator.message(Messages.releaseOptionMustBeSpecified);
                return;
            }
        }
    }
    releaseOption = bundleRelease.getReleaseOption();
    if (releaseOption != ReleaseOption.RELEASE) {
        // Find bundles with macros as Bundle-Version:
        List<MacroInfo> bsns = ReleaseHelper.getBsnsWithBundleVersionMacro(projectDiffs);
        if (bsns.size() > 0) {
            StringBuilder sb = new StringBuilder();
            sb.append(Messages.macrosWillBeOverwritten1);
            sb.append("\n\n");
            for (MacroInfo info : bsns) {
                sb.append("\t");
                sb.append(info.projectDiff.getProject().getName());
                if (!info.projectDiff.getProject().getName().equals(info.bsn)) {
                    sb.append(" (");
                    sb.append(info.bsn);
                    sb.append(")");
                }
                sb.append("    ");
                sb.append(info.macro);
                sb.append("\n");
            }
            sb.append("\n");
            sb.append(Messages.macrosWillBeOverwritten2);
            if (!Activator.confirmationMessage(sb.toString())) {
                return;
            }
        }
    }
    super.okPressed();
}
Also used : ProjectDiff(bndtools.release.ProjectDiff) MacroInfo(bndtools.release.ReleaseHelper.MacroInfo)

Aggregations

ProjectDiff (bndtools.release.ProjectDiff)1 MacroInfo (bndtools.release.ReleaseHelper.MacroInfo)1