Skip to content

Commit

Permalink
Move MutableBundleManifest into the tycho-model module for reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Aug 15, 2024
1 parent e6b7f55 commit 46d4640
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Sonatype Inc. - initial API and implementation
* Sebastien Arod - add setter with {@link MutableManifestElement}
*******************************************************************************/
package org.eclipse.tycho.versions.bundle;
package org.eclipse.tycho.model.manifest;

import java.io.IOException;
import java.io.Writer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Nepomuk Seiler - set export-package attribute implementation
* Sebastien Arod - RequireBundle/FragmentHost/ImportPackage versions set/get
*******************************************************************************/
package org.eclipse.tycho.versions.bundle;
package org.eclipse.tycho.model.manifest;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand All @@ -36,7 +36,6 @@
import java.util.function.Consumer;

import org.eclipse.osgi.util.ManifestElement;
import org.eclipse.tycho.versions.engine.Versions;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;

Expand Down Expand Up @@ -191,7 +190,6 @@ public String getFragmentHostVersion() {
}

public void setFragmentHostVersion(String newVersion) {
newVersion = Versions.toBaseVersion(newVersion);
List<MutableManifestElement> fragmentHostElements = parseHeaderForMutation(Constants.FRAGMENT_HOST);
if (fragmentHostElements == null || fragmentHostElements.isEmpty()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributors:
* Sebastien Arod - Initial implementation
*******************************************************************************/
package org.eclipse.tycho.versions.bundle;
package org.eclipse.tycho.model.manifest;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import java.util.List;
import java.util.Objects;

import org.eclipse.tycho.model.manifest.MutableBundleManifest;

public class MutableBndFile {

private final List<BndLine> bndLines = new ArrayList<BndLine>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import org.eclipse.tycho.model.Feature;
import org.eclipse.tycho.model.IU;
import org.eclipse.tycho.model.ProductConfiguration;
import org.eclipse.tycho.model.manifest.MutableBundleManifest;
import org.eclipse.tycho.versions.bundle.MutableBndFile;
import org.eclipse.tycho.versions.bundle.MutableBundleManifest;
import org.eclipse.tycho.versions.pom.PomFile;
import org.eclipse.tycho.versions.utils.ProductFileFilter;
import org.osgi.framework.Constants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

import org.codehaus.plexus.component.annotations.Component;
import org.eclipse.tycho.TychoConstants;
import org.eclipse.tycho.model.manifest.MutableBundleManifest;
import org.eclipse.tycho.versions.bundle.MutableBndFile;
import org.eclipse.tycho.versions.bundle.MutableBundleManifest;
import org.eclipse.tycho.versions.engine.MetadataManipulator;
import org.eclipse.tycho.versions.engine.PackageVersionChange;
import org.eclipse.tycho.versions.engine.PomVersionChange;
Expand Down Expand Up @@ -194,7 +194,7 @@ private void updateFragmentHostVersion(ProjectMetadata project, VersionChangesDe
logger.info(" META-INF/MANIFEST.MF//Fragment-Host//" + mf.getFragmentHostSymbolicName()
+ ";bundle-version: " + newVersionRange + " => " + newVersionRange);

mf.setFragmentHostVersion(newVersionRange);
mf.setFragmentHostVersion(Versions.toBaseVersion(newVersionRange));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.io.StringWriter;

import org.eclipse.tycho.versions.bundle.ManifestAttribute;
import org.eclipse.tycho.model.manifest.ManifestAttribute;
import org.junit.Test;

public class ManifestAttributeTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.HashMap;
import java.util.Map;

import org.eclipse.tycho.versions.bundle.ManifestAttribute;
import org.eclipse.tycho.versions.bundle.MutableBundleManifest;
import org.eclipse.tycho.model.manifest.ManifestAttribute;
import org.eclipse.tycho.model.manifest.MutableBundleManifest;
import org.eclipse.tycho.versions.pom.tests.MutablePomFileTest;
import org.junit.Assert;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.tycho.versions.bundle.MutableManifestElement;
import org.eclipse.tycho.model.manifest.MutableManifestElement;
import org.junit.Test;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
Expand Down

0 comments on commit 46d4640

Please sign in to comment.