-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
376 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...-dependency-tools-plugin/src/main/java/org/eclipse/tycho/extras/pde/ExportedPackages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Christoph Läubrich and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.extras.pde; | ||
|
||
public class ExportedPackages { | ||
|
||
public ExportedPackages(String manifestValue) { | ||
// TODO Auto-generated constructor stub | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...o-dependency-tools-plugin/src/main/java/org/eclipse/tycho/extras/pde/ImportedPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Christoph Läubrich and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.extras.pde; | ||
|
||
import org.osgi.framework.Constants; | ||
|
||
import aQute.bnd.header.Attrs; | ||
|
||
public class ImportedPackage { | ||
|
||
private ImportedPackages packages; | ||
private String packageName; | ||
private Attrs attrs; | ||
|
||
public ImportedPackage(ImportedPackages packages, String packageName, Attrs attrs) { | ||
this.packages = packages; | ||
this.packageName = packageName; | ||
this.attrs = attrs; | ||
} | ||
|
||
public String getPackageName() { | ||
return packageName; | ||
} | ||
|
||
public String getVersion() { | ||
return attrs.get(Constants.VERSION_ATTRIBUTE); | ||
} | ||
|
||
public boolean isJava() { | ||
return packageName.startsWith("java."); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
String version = getVersion(); | ||
if (version != null) { | ||
return getPackageName() + " " + version; | ||
} | ||
return getPackageName(); | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
...-dependency-tools-plugin/src/main/java/org/eclipse/tycho/extras/pde/ImportedPackages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Christoph Läubrich and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.extras.pde; | ||
|
||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
import java.util.TreeMap; | ||
import java.util.stream.Stream; | ||
|
||
import aQute.bnd.header.Attrs; | ||
import aQute.bnd.header.OSGiHeader; | ||
import aQute.bnd.header.Parameters; | ||
|
||
public class ImportedPackages { | ||
|
||
//import package order is not important so we can sort here by name | ||
private Map<String, ImportedPackage> packages = new TreeMap<>(); | ||
|
||
public ImportedPackages(String manifestValue) { | ||
if (manifestValue != null) { | ||
Parameters header = OSGiHeader.parseHeader(manifestValue); | ||
for (Entry<String, Attrs> entry : header.entrySet()) { | ||
packages.put(entry.getKey(), new ImportedPackage(this, entry.getKey(), entry.getValue())); | ||
} | ||
} | ||
} | ||
|
||
public Stream<ImportedPackage> packages() { | ||
return packages.values().stream(); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.