Skip to content

Commit

Permalink
Remove -cdr argument and support of Fast CDR v1 (#265)
Browse files Browse the repository at this point in the history
* Refs #19971. Remove -cdr argument

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

* Refs #19971. Update submodule

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

---------

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
  • Loading branch information
richiware committed Dec 11, 2023
1 parent e751e00 commit 10bce98
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 3,437 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
description: 'foonathan_memory_vendor branch to be used'
required: false
default: 'master'
fastcdr_versions:
description: 'Fast-CDR branches to be used'
fastcdr_branch:
description: 'Fast-CDR branch to be used'
required: false
default: '["1.1.x", "master"]'
default: 'master'
fastdds_branch:
description: 'Fast-DDS branch to be used'
required: false
Expand All @@ -31,7 +31,6 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }}
java_version: ['openjdk-11-jdk', 'openjdk-17-jdk', 'openjdk-18-jdk', 'openjdk-19-jdk']

steps:
Expand All @@ -56,7 +55,7 @@ jobs:
- uses: ./src/fastddsgen/.github/actions/fetch-fastddsgen-repos
with:
foonathan-memory-vendor-branch: ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }}
fastcdr-branch: ${{ matrix.fastcdr_version }}
fastcdr-branch: ${{ github.event.inputs.fastcdr_branch || 'master' }}
fastdds-branch: ${{ github.event.inputs.fastdds_branch || 'master' }}
fastdds-python-branch: ${{ github.event.inputs.fastdds_python_branch || 'main' }}

Expand All @@ -83,22 +82,14 @@ jobs:
./generate.sh
cd -
cd src/Fast-DDS-python/fastdds_python_examples/HelloWorldExample
fastddsgen -cdr both -python -replace HelloWorld.idl
fastddsgen -python -replace HelloWorld.idl
- name: Build workspace
run: |
cmake --version
colcon build --event-handlers=console_direct+ --mixin rel-with-deb-info ccache --metas src/fastddsgen/.github/fastddsgen.meta
- name: Test fastddsgen with fastcdr v1
if: startsWith(matrix.fastcdr_version, '1')
run: |
source install/local_setup.bash
cd src/fastddsgen
./gradlew test -Dcdr_version=v1 -Dblacklist_tests=external,optional
- name: Test fastddsgen with fastcdr v2
if: ${{ ! startsWith(matrix.fastcdr_version, '1') }}
- name: Test fastddsgen
run: |
source install/local_setup.bash
cd src/fastddsgen
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/com/eprosima/fastcdr/idl/context/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,5 @@ public interface Context

public boolean isFastcdr();

public boolean isCdr_v1();

public boolean isCdr_v2();

public boolean isCdr_both();

public void isSetCdrv1Templates();

public void isUnsetCdrv1Templates();

public boolean isCdrv1TemplatesEnabled();

/*** End ***/
}
10 changes: 0 additions & 10 deletions src/main/java/com/eprosima/fastcdr/idl/templates/TypesHeader.stg
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ import "FastCdrCommon.stg"
main(ctx, definitions) ::= <<
$fileHeader(ctx=ctx, file=[ctx.filename, ".h"], description=["This header file contains the declaration of the described types in the IDL file."])$

$if(ctx.cdr_both)$
#include <fastcdr/config.h>
#include "$ctx.filename$v1.h"

#if FASTCDR_VERSION_MAJOR > 1
$endif$

#ifndef _FAST_DDS_GENERATED_$ctx.headerGuardName$_H_
#define _FAST_DDS_GENERATED_$ctx.headerGuardName$_H_

Expand Down Expand Up @@ -105,9 +98,6 @@ $definitions; separator="\n"$
#endif // _FAST_DDS_GENERATED_$ctx.headerGuardName$_H_
$"\n"$

$if(ctx.cdr_both)$
#endif // FASTCDR_VERSION_MAJOR > 1
$endif$
>>

module(ctx, parent, module, definition_list) ::= <<
Expand Down
Loading

0 comments on commit 10bce98

Please sign in to comment.