blob: 65a8ae80f285e8279017356a6df031934509bb35 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. 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
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
package org.eclipse.osbp.preferences
import org.eclipse.core.runtime.IBundleGroupProvider
import org.eclipse.core.runtime.Platform
/**
* &lt;plugins&gt; dependencies for the OSBP product bundle <code>*.product</code> file.
*/
public class ProductFileFeatures extends ProductFileBase {
new(ProductConfigurationPrefs prefs) {
super(prefs)
}
new(ProductConfigurationPrefs prefs, String... jndiNames) {
super(prefs, jndiNames)
}
override getDeprecatedAsString() {
}
/**
* Creates the list of used plugins for the .product file in the product targetbundle.
*/
override getRequiredAsString() {
prepareSerialized(
'''
${{DATA_BASE_VENDOR_FEATURES}}
«runtimeSoftwareFeature»
''')
}
override getRecommendedAsString() {
}
override prepareSerialized(String asString) {
removeDuplicates(asString
.replace(
"${{DATA_BASE_VENDOR_FEATURES}}",
EnumDatabaseVendor.getDatabaseFeatures(dataBaseVendors)
)
)
}
def private String getRuntimeSoftwareFeature(){
var netOsbee = false
var orgOsbee = false
for (IBundleGroupProvider provider : Platform.getBundleGroupProviders()) {
for (feature : provider.getBundleGroups()) {
var featureId = feature.getIdentifier()
if (featureId !== null) {
if (featureId.startsWith("net.osbee")) {
netOsbee = true
} else if (featureId.startsWith("org.osbee")) {
orgOsbee = true
}
}
}
}
if (netOsbee){
return "\t<feature id=\"net.osbee.softwarefactory.runtime.feature\"/>"
} else if (orgOsbee){
return "\t<feature id=\"org.osbee.softwarefactory.runtime.feature\"/>"
}
return "\t<feature id=\"org.eclipse.osbp.softwarefactory.runtime.feature\"/>";
}
}