Package org.eclipse.tycho.core.ee
Class StandardExecutionEnvironment
- java.lang.Object
-
- org.eclipse.tycho.core.ee.StandardExecutionEnvironment
-
- All Implemented Interfaces:
java.lang.Comparable<StandardExecutionEnvironment>
,ExecutionEnvironment
public class StandardExecutionEnvironment extends java.lang.Object implements java.lang.Comparable<StandardExecutionEnvironment>, ExecutionEnvironment
Represents a standard OSGi execution environment profile. See the list of known OSGi profiles in bundle org.eclipse.osgi, file profile.list. Standard execution environment capabilities can be referenced in MANIFEST.MF using the header "Bundle-RequiredExecutionEnvironment". In order to pick the minimal, required profile from the alternatives listed in a BREE header, instances of this class have a total ordering. TODO This class both represents an EE profile (i.e. the concrete EE implementation used by the compiler) and an EE capability (i.e. the capability required via the BREE). This should be separate classes. (An EE profile typically provides multiple EE capabilities.)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.tycho.core.ee.shared.ExecutionEnvironment
ExecutionEnvironment.SystemPackageEntry
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
compilerSourceLevel
private java.lang.String
compilerTargetLevel
private EEVersion
eeVersion
private org.codehaus.plexus.logging.Logger
logger
private java.lang.String
profileName
private java.util.Properties
profileProperties
private java.util.List<ExecutionEnvironment.SystemPackageEntry>
systemPackages
private static java.util.Map<java.lang.String,java.lang.String>
TARGET_ALIASES
private org.apache.maven.toolchain.Toolchain
toolchain
-
Constructor Summary
Constructors Constructor Description StandardExecutionEnvironment(java.util.Properties profileProperties)
Deprecated.StandardExecutionEnvironment(java.util.Properties profileProperties, org.apache.maven.toolchain.Toolchain toolchain, org.codehaus.plexus.logging.Logger logger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(StandardExecutionEnvironment otherEnv)
boolean
equals(java.lang.Object obj)
java.lang.String
getCompilerSourceLevelDefault()
Returns a reasonable compiler source level default for this execution environment.java.lang.String
getCompilerTargetLevelDefault()
Returns a reasonable compiler target level default for this execution environment.java.lang.String
getProfileName()
java.util.Properties
getProfileProperties()
java.util.Collection<ExecutionEnvironment.SystemPackageEntry>
getSystemPackages()
Returns the list of packages (without versions) provided by the execution environment.(package private) static java.io.File
getSystemPackagesCompanionJar()
int
hashCode()
boolean
isCompatibleCompilerTargetLevel(java.lang.String target)
Returnsfalse
if classes compiled with the given compiler target level can certainly not be executed on this execution environment.private static EEVersion
parseEEVersion(java.lang.String systemCaps)
private java.util.Set<java.lang.String>
readFromToolchains(org.apache.maven.toolchain.Toolchain toolchain)
java.lang.String
toString()
private static org.osgi.framework.Version
toTargetVersion(java.lang.String target)
-
-
-
Field Detail
-
TARGET_ALIASES
private static final java.util.Map<java.lang.String,java.lang.String> TARGET_ALIASES
-
profileName
private final java.lang.String profileName
-
compilerSourceLevel
private final java.lang.String compilerSourceLevel
-
compilerTargetLevel
private final java.lang.String compilerTargetLevel
-
systemPackages
private java.util.List<ExecutionEnvironment.SystemPackageEntry> systemPackages
-
eeVersion
private final EEVersion eeVersion
-
profileProperties
private final java.util.Properties profileProperties
-
toolchain
private final org.apache.maven.toolchain.Toolchain toolchain
-
logger
private org.codehaus.plexus.logging.Logger logger
-
-
Constructor Detail
-
StandardExecutionEnvironment
@Deprecated StandardExecutionEnvironment(@Nonnull java.util.Properties profileProperties)
Deprecated.Do no instantiate. Use factory method insteadExecutionEnvironmentUtils#getExecutionEnvironment(String)
.
-
StandardExecutionEnvironment
StandardExecutionEnvironment(@Nonnull java.util.Properties profileProperties, @Nullable org.apache.maven.toolchain.Toolchain toolchain, @Nullable org.codehaus.plexus.logging.Logger logger)
-
-
Method Detail
-
readFromToolchains
private java.util.Set<java.lang.String> readFromToolchains(org.apache.maven.toolchain.Toolchain toolchain)
-
getSystemPackagesCompanionJar
static java.io.File getSystemPackagesCompanionJar() throws java.io.IOException
- Throws:
java.io.IOException
-
parseEEVersion
private static EEVersion parseEEVersion(java.lang.String systemCaps)
-
getProfileName
public java.lang.String getProfileName()
- Specified by:
getProfileName
in interfaceExecutionEnvironment
-
getCompilerSourceLevelDefault
public java.lang.String getCompilerSourceLevelDefault()
Description copied from interface:ExecutionEnvironment
Returns a reasonable compiler source level default for this execution environment.- Specified by:
getCompilerSourceLevelDefault
in interfaceExecutionEnvironment
- Returns:
- a compiler source level matching the execution environment, or
null
if unknown.
-
getCompilerTargetLevelDefault
public java.lang.String getCompilerTargetLevelDefault()
Description copied from interface:ExecutionEnvironment
Returns a reasonable compiler target level default for this execution environment.- Specified by:
getCompilerTargetLevelDefault
in interfaceExecutionEnvironment
- Returns:
- a compiler target level matching the execution environment, or
null
if unknown.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSystemPackages
public java.util.Collection<ExecutionEnvironment.SystemPackageEntry> getSystemPackages()
Description copied from interface:ExecutionEnvironment
Returns the list of packages (without versions) provided by the execution environment.- Specified by:
getSystemPackages
in interfaceExecutionEnvironment
-
compareTo
public int compareTo(StandardExecutionEnvironment otherEnv)
- Specified by:
compareTo
in interfacejava.lang.Comparable<StandardExecutionEnvironment>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getProfileProperties
public java.util.Properties getProfileProperties()
- Specified by:
getProfileProperties
in interfaceExecutionEnvironment
-
isCompatibleCompilerTargetLevel
public boolean isCompatibleCompilerTargetLevel(java.lang.String target)
Description copied from interface:ExecutionEnvironment
Returnsfalse
if classes compiled with the given compiler target level can certainly not be executed on this execution environment. Used to detect inconsistent configuration.- Specified by:
isCompatibleCompilerTargetLevel
in interfaceExecutionEnvironment
-
toTargetVersion
private static org.osgi.framework.Version toTargetVersion(java.lang.String target)
-
-