summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Groeger <groeger@itestra.de>2013-09-03 14:45:16 +0200
committerJohannes Schanda <schanda@itestra.de>2013-09-05 13:26:32 +0200
commit18d263417c592e59574b787518e9ec86ffa66c7e (patch)
tree0fc4363d1f7a6f7ad5981eb17cbfc9b80c6e3ea6
parent026c401e9202ee7baf7491e060ce79df247c1987 (diff)
downloadgenivi-common-api-runtime-18d263417c592e59574b787518e9ec86ffa66c7e.tar.gz
Adapted generated licenseHeader
-Added version of franca.core and commonapi.core/commonapi.dbus -Added commonApiDBusLicenseHeader Change-Id: Ic1924d3cc8e0dd5de6ce00f57685dc307a5ee3c4
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGeneratorExtensions.xtend46
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyFrancaPersistenceManager.java2
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyModelPersistenceHandler.java2
3 files changed, 45 insertions, 5 deletions
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGeneratorExtensions.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGeneratorExtensions.xtend
index 4b8d14d..3d6e5a8 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGeneratorExtensions.xtend
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGeneratorExtensions.xtend
@@ -43,6 +43,7 @@ import static com.google.common.base.Preconditions.*
import org.franca.core.franca.FTypedElement
import java.util.Collection
import org.genivi.commonapi.core.preferences.FPreferences
+import org.osgi.framework.FrameworkUtil
class FrancaGeneratorExtensions {
def String getFullyQualifiedName(FModelElement fModelElement) {
@@ -946,12 +947,51 @@ class FrancaGeneratorExtensions {
InstanceScope::INSTANCE.getNode(PreferenceConstants::SCOPE).get(PreferenceConstants::P_LICENSE, deflt), model);
}
+ def getFrancaVersion() {
+ val bundleContext = FrameworkUtil::getBundle(this.getClass()).getBundleContext();
+ for (b : bundleContext.bundles) {
+ if (b.symbolicName.equals("org.franca.core")) {
+ return b.version
+ }
+ }
+ }
+
+ def getCoreVersion() {
+ val bundleContext = FrameworkUtil::getBundle(this.getClass()).getBundleContext();
+ for (b : bundleContext.bundles) {
+ if (b.symbolicName.equals("org.genivi.commonapi.core")) {
+ return b.version
+ }
+ }
+ }
+
+ def getDBusVersion() {
+ val bundleContext = FrameworkUtil::getBundle(this.getClass()).getBundleContext();
+ for (b : bundleContext.bundles) {
+ if (b.symbolicName.equals("org.genivi.commonapi.dbus")) {
+ return b.version
+ }
+ }
+ }
+
+ def generateCommonApiDBusLicenseHeader(FModelElement model) '''
+ /*
+ * This file was generated by the CommonAPI Generators.
+ * Used org.genivi.commonapi.dbus «getDBusVersion()».
+ * Used org.franca.core «getFrancaVersion()».
+ *
+ «getCommentedString(getHeader(model.model))»
+ */
+ '''
+
def generateCommonApiLicenseHeader(FModelElement model) '''
/*
- * This file was generated by the CommonAPI Generators.
- *
+ * This file was generated by the CommonAPI Generators.
+ * Used org.genivi.commonapi.core «getCoreVersion()».
+ * Used org.franca.core «getFrancaVersion()».
+ *
«getCommentedString(getHeader(model.model))»
- */
+ */
'''
def getCommentedString(String string) {
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyFrancaPersistenceManager.java b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyFrancaPersistenceManager.java
index 989d860..d13d3a6 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyFrancaPersistenceManager.java
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyFrancaPersistenceManager.java
@@ -18,7 +18,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
public class MyFrancaPersistenceManager extends FrancaPersistenceManager {
-
+
private final String fileExtension = "fidl";
@Inject
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyModelPersistenceHandler.java b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyModelPersistenceHandler.java
index 70ce391..3ead770 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyModelPersistenceHandler.java
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/MyModelPersistenceHandler.java
@@ -22,7 +22,7 @@ import org.franca.core.utils.ImportsProvider;
import org.franca.core.utils.ModelPersistenceHandler;
public class MyModelPersistenceHandler extends ModelPersistenceHandler {
-
+
private ResourceSet resourceSet;
private static Map<String, ImportsProvider> fileHandlerRegistry = new HashMap<String, ImportsProvider>();