Package aQute.bnd.build
Class PackageInfo
java.lang.Object
aQute.bnd.build.PackageInfo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getContent
(boolean modern, String packageName, Version version) private File
getPackageInfo
(String packageName) Get the version for a package name.private Pattern
getPattern
(File target) private Version
getVersion
(File source, Pattern pattern) private String
Check what version annotation to use for new content: not set -> use packageinfo osgi -> use the OSGi Version ann.private boolean
private boolean
private boolean
boolean
setPackageInfo
(String packageName, Version version) Sets the package version on an exported package.
-
Field Details
-
PACKAGE_INFO_JAVA
- See Also:
-
PACKAGEINFO
- See Also:
-
MODERN_P
-
CLASSIC_P
-
MODERN_PACKAGE_P
-
project
-
-
Constructor Details
-
PackageInfo
PackageInfo(Project project)
-
-
Method Details
-
getPackageInfo
Get the version for a package name. This traverse the source paths and will stop at the first source directory that has a packageinfo or- Parameters:
packageName
-- Throws:
Exception
-
setPackageInfo
Sets the package version on an exported package. If package-info.java exists then we use that one, otherwise we try the packageinfo file. If neither exists, we create a package-info.java file. You can set the annotation to use. Default is bnd. setting it to 'osgi' sets it to the OSGi annotations.- Parameters:
packageName
- The package nameversion
- The new package version- Throws:
Exception
-
getVersionAnnotation
Check what version annotation to use for new content:- not set -> use packageinfo
- osgi -> use the OSGi Version ann.
- bnd -> use the bnd version ann.
- other -> use the content as the version annotation, must have the same prototype as the bnd/osgi ann.
-
getContent
-
getPattern
-
isModern
-
replace
- Throws:
IOException
-
replace
private boolean replace(Version newVersion, String content, Matcher m, File target) throws IOException - Throws:
IOException
-
getFile
- Throws:
Exception
-
getVersion
- Throws:
IOException
-