Skip to content

Commit

Permalink
CommonAPI-SomeIP-Tools 3.1.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
juergengehring committed Apr 7, 2017
1 parent c58fc26 commit 824f008
Show file tree
Hide file tree
Showing 12 changed files with 252 additions and 82 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changes
=======
v3.1.11.1
- Support deployment for anonymous arrays

v3.1.11
- Fixed segfault when unsubscribing inside subscription handler

v3.1.10
- Upgrade to JDK-1.8.
Expand Down
2 changes: 1 addition & 1 deletion CommonAPI-Examples/src/C/MergedInterfaceClientC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main() {
std::shared_ptr < CommonAPI::Runtime > runtime = CommonAPI::Runtime::get();

std::string domain = "local";
std::string instance = "commonapi.examples.C.AttributesC";
std::string instance = "commonapi.examples.C.MergedInterfaceC";
std::string connection = "client-sample";

auto myProxy = runtime->buildProxyWithDefaultAttributeExtension<MergedInterfaceCProxy, CommonAPI::Extensions::AttributeCacheExtension>(domain, instance, connection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2;
import org.franca.deploymodel.dsl.fDeploy.FDModel;
import org.genivi.commonapi.core.preferences.PreferenceConstants;
import org.genivi.commonapi.core.ui.handler.GenerationCommand;
import org.genivi.commonapi.someip.deployment.validator.SomeIPDeploymentValidator;
import org.genivi.commonapi.someip.preferences.FPreferencesSomeIP;
Expand Down Expand Up @@ -53,8 +52,8 @@ protected EclipseResourceFileSystemAccess2 createFileSystemAccess() {
@Override
protected void setupOutputDirectories(EclipseResourceFileSystemAccess2 fileSystemAccess) {
fileSystemAccess.setOutputConfigurations(FPreferencesSomeIP.getInstance().getOutputpathConfiguration());
}
}

/**
* Set the properties for the code generation from the resource properties (set with the property page, via the context menu).
* Take default values from the eclipse preference page.
Expand Down Expand Up @@ -112,7 +111,7 @@ public void initSomeIpPreferences(IFile file, IPreferenceStore store)
licenseHeader = store.getString(PreferenceConstantsSomeIP.P_LICENSE_SOMEIP);
}
if(generateCommon == null) {
generateCommon = store.getString(PreferenceConstantsSomeIP.P_GENERATE_COMMON_SOMEIP);
generateCommon = store.getString(PreferenceConstantsSomeIP.P_GENERATE_COMMON_SOMEIP);
}
if(generateProxy == null) {
generateProxy = store.getString(PreferenceConstantsSomeIP.P_GENERATEPROXY_SOMEIP);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='&quot;GENIVI CommonAPI 3.1 releases&quot;'
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='1426002734609'/>
</properties>
<children size='3'>
<child location='content'/>
<child location='http://genivi.github.io/capicxx-core-tools/updatesite/'/>
<child location='http://franca.github.io/franca/update_site/releases/0.9.1'/>
</children>
</repository>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='&quot;GENIVI CommonAPI 3.1 releases&quot;'
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='1426002734609'/>
</properties>
<children size='3'>
<child location='content'/>
<child location='http://genivi.github.io/capicxx-core-tools/updatesite/'/>
<child location='http://franca.github.io/franca/update_site/releases/0.9.1'/>
</children>
</repository>
2 changes: 1 addition & 1 deletion org.genivi.commonapi.someip.validator/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<page
class="org.genivi.commonapi.someip.validator.preference.ValidatorSomeIPPreferencesPage"
id="org.genivi.commonapi.someip.validator.preference"
name="Validator Some/IP">
name="CommonAPI-Some/IP Validator">
</page>
</extension>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
Expand Down Expand Up @@ -141,10 +140,9 @@ public void validateModel(FModel model, ValidationMessageAcceptor messageAccepto
}


HashMap<FInterface, EList<FInterface>> managedInterfaces = new HashMap<FInterface, EList<FInterface>>();
cwd = filePath.removeLastSegments(1).toString();
for (FInterface fInterface : model.getInterfaces())
{
managedInterfaces.put(fInterface, fInterface.getManagedInterfaces());
validateImportedTypeCollections(model, messageAcceptor, filePath.lastSegment(), cwd, fInterface);
}
}
Expand All @@ -169,6 +167,7 @@ public void validateModel(FModel model, ValidationMessageAcceptor messageAccepto
}
}

// put all imports (with absolute path) of this model to a map
private void initImportList(FModel model, String cwd, String filePath)
{
HashSet<String> importedFiles = new HashSet<String>();
Expand Down Expand Up @@ -276,32 +275,33 @@ private HashMap<String, HashSet<String>> buildImportList(HashMap<String, HashSet
private void validateTypeCollectionName(FModel model, ValidationMessageAcceptor messageAcceptor, IPath filePath,
FTypeCollection fTypeCollection)
{
if (fTypeCollection.getName() == null)
return;

if (fTypeCollection.getName().contains("."))
String typeCollectionName = fTypeCollection.getName();
if (typeCollectionName != null)
{
acceptError("Name may not contain '.'", fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
}
if (typeCollectionName.contains("."))
{
acceptError("Name may not contain '.'", fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
}

// since Franca 0.8.10 is released, this check is unnecessary
if (!isFrancaVersionGreaterThan(0, 8, 9))
{
if (fastAllInfo.get(fTypeCollection.getName()).get(model.getName()).size() > 1)
// since Franca 0.8.10 is released, this check is unnecessary
if (!isFrancaVersionGreaterThan(0, 8, 9))
{
for (String s : fastAllInfo.get(fTypeCollection.getName()).get(model.getName()))
if (fastAllInfo.get(typeCollectionName).get(model.getName()).size() > 1)
{
if (!s.equals(filePath.toString()))
for (String s : fastAllInfo.get(typeCollectionName).get(model.getName()))
{
if (importList.containsKey(s))
{
acceptError("Imported file " + s + " has interface or typeCollection with the same name and same package!",
fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
}
else
if (!s.equals(filePath.toString()))
{
acceptWarning("Interface or typeCollection in file " + s + " has the same name and same package!",
fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
if (importList.containsKey(s))
{
acceptError("Imported file " + s + " has interface or typeCollection with the same name and same package!",
fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
}
else
{
acceptWarning("Interface or typeCollection in file " + s + " has the same name and same package!",
fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
}
}
}
}
Expand Down Expand Up @@ -347,19 +347,23 @@ private void validateImportedTypeCollections(FModel model, ValidationMessageAcce
{
if (entryValue.packageName.startsWith(model.getName() + "." + fTypeCollection.getName()))
{
if (importList.get(cwd + "/" + fileName).contains(entry.getKey()))
{
acceptError(
"Imported file's package " + entryValue.packageName + " may not start with package "
+ model.getName() + " + " + type + fTypeCollection.getName(), fTypeCollection,
FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
}
else
HashSet<String> importPaths = importList.get(cwd + "/" + fileName);
if (importPaths != null)
{
acceptWarning(
entry.getKey() + ". File's package " + entryValue.packageName + " starts with package "
+ model.getName() + " + " + type + fTypeCollection.getName(), fTypeCollection, null, -1,
messageAcceptor);
if (importPaths.contains(entry.getKey()))
{
acceptError(
"Imported file's package " + entryValue.packageName + " may not start with package "
+ model.getName() + " + " + type + " " + fTypeCollection.getName(), fTypeCollection,
FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor);
}
else
{
acceptWarning(
"File's package " + entryValue.packageName + " starts with package "
+ model.getName() + " + " + type + " " + fTypeCollection.getName(), fTypeCollection, null, -1,
messageAcceptor);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ public void checkState()
@Override
public void createFieldEditors()
{
addField(new BooleanFieldEditor(PreferenceConstantsSomeIP.P_ENABLE_SOMEIP_VALIDATOR, "validator enabled", getFieldEditorParent()));
addField(new BooleanFieldEditor(PreferenceConstantsSomeIP.P_ENABLE_SOMEIP_VALIDATOR, "Enable CommonAPI-Some/IP specific validation of Franca IDL files", getFieldEditorParent()));
addField(new BooleanFieldEditor(ENABLED_WORKSPACE_CHECK,
"enable the whole workspace check (Note: Validations takes up to two minutes if enabled)", getFieldEditorParent()));
"Enable whole workspace check", getFieldEditorParent()));
}

@Override
public void init(IWorkbench workbench)
{
IPreferenceStore prefStore = CommonApiSomeIPUiPlugin.getValidatorPreferences();
setPreferenceStore(prefStore);
setDescription("Disable or enable the Some/IP validator!");
}

}
43 changes: 23 additions & 20 deletions org.genivi.commonapi.someip.verification/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SET(COMMONAPI_CMAKE_INSTALL_PATH "na" CACHE STRING "CommonAPI install path of th
SET(COMMONAPI_SOMEIP_CMAKE_INSTALL_PATH "na" CACHE STRING "CommonAPI-SomeIP install path of the cmake files")
SET(COMMONAPI_SOMEIP_TOOL_GENERATOR "na" CACHE STRING "CommonAPI-SomeIP-Tools generator install path")
SET(COMMONAPI_TEST_FIDL_PATH "na" CACHE STRING "Path to directory with test fidl/fdepl files for code generation")
SET(COMMONAPI_SRC_GEN_DEST "src-gen" CACHE STRING "Path to the destination directory of the generated sources")

if("${COMMONAPI_TOOL_GENERATOR}" STREQUAL "")
message(FATAL_ERROR "The file path for the commonapi_generator needs to be specified! Use '-DCOMMONAPI_TOOL_GENERATOR' to do so.")
Expand All @@ -52,6 +53,8 @@ endif()

message("Build type: ${CMAKE_BUILD_TYPE}")

message("The path to the destination directory of the generated sources is set to: ${COMMONAPI_SRC_GEN_DEST}")

##############################################################################
# add COMMONAPI install path to cmake find root path

Expand Down Expand Up @@ -86,7 +89,7 @@ message("COMMONAPI_SOMEIP_INCLUDE_DIRS: ${COMMONAPI_SOMEIP_INCLUDE_DIRS}")
file(GLOB FIDL_FILES "${COMMONAPI_TEST_FIDL_PATH}/*.fidl")
message("FIDL_FILES: ${FIDL_FILES}")
execute_process(
COMMAND ${COMMONAPI_TOOL_GENERATOR} --dest src-gen --skel ${FIDL_FILES}
COMMAND ${COMMONAPI_TOOL_GENERATOR} --dest ${COMMONAPI_SRC_GEN_DEST} --skel ${FIDL_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

Expand Down Expand Up @@ -144,7 +147,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fidl/conf/ti_threading.fdepl.in
file(GLOB FDEPL_FILES "fidl/*.fdepl")
message("FDEPL_FILES: ${FDEPL_FILES}")
execute_process(
COMMAND ${COMMONAPI_SOMEIP_TOOL_GENERATOR} --dest src-gen ${FDEPL_FILES}
COMMAND ${COMMONAPI_SOMEIP_TOOL_GENERATOR} --dest ${COMMONAPI_SRC_GEN_DEST} ${FDEPL_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

Expand Down Expand Up @@ -174,34 +177,34 @@ message("Compiler options: ${CMAKE_CXX_FLAGS}")

include_directories(
src
src-gen
${COMMONAPI_SRC_GEN_DEST}
${COMMONAPI_INCLUDE_DIRS}
${VSOMEIP_INCLUDE_DIRS}
${COMMONAPI_SOMEIP_INCLUDE_DIRS}
)

if (MSVC)
set (DERIVED_TYPE_SRC "src-gen/v1/commonapi/datatypes/derived/TestInterface.cpp")
set (POLYMORPHIC_TYPE_SRC "src-gen/v1/commonapi/advanced/polymorph/TestInterface.cpp")
set (DERIVED_TYPE_SRC "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/derived/TestInterface.cpp")
set (POLYMORPHIC_TYPE_SRC "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/polymorph/TestInterface.cpp")
endif ()

# source files
file(GLOB GLUE_SRCS
"src-gen/v1/commonapi/communication/*SomeIP*.cpp"
"src-gen/v1/commonapi/advanced/bselective/*SomeIP*.cpp"
"src-gen/v1/commonapi/advanced/managed/*SomeIP*.cpp"
"src-gen/v1/commonapi/advanced/extended/*SomeIP*.cpp"
"src-gen/v1/commonapi/advanced/polymorph/*SomeIP*.cpp"
"src-gen/v1/commonapi/datatypes/primitive/*SomeIP*.cpp"
"src-gen/v1/commonapi/datatypes/advanced/*SomeIP*.cpp"
"src-gen/v1/commonapi/datatypes/combined/*SomeIP*.cpp"
"src-gen/v1/commonapi/datatypes/deployment/*SomeIP*.cpp"
"src-gen/v1/commonapi/datatypes/derived/*SomeIP*.cpp"
"src-gen/v1/commonapi/performance/primitive/*SomeIP*.cpp"
"src-gen/v1/commonapi/performance/complex/*SomeIP*.cpp"
"src-gen/v1/commonapi/runtime/*SomeIP*.cpp"
"src-gen/v1/commonapi/threading/*SomeIP*.cpp"
"src-gen/v1/commonapi/stability/sp/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/communication/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/bselective/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/managed/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/extended/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/polymorph/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/primitive/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/advanced/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/combined/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/deployment/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/derived/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/performance/primitive/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/performance/complex/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/runtime/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/threading/*SomeIP*.cpp"
"${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/stability/sp/*SomeIP*.cpp"
${DERIVED_TYPE_SRC}
${POLYMORPHIC_TYPE_SRC}
)
Expand Down
Loading

0 comments on commit 824f008

Please sign in to comment.