Skip to content

Commit

Permalink
bump to Veins 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sommer committed Dec 19, 2020
1 parent bdad2af commit 9715e66
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Cookiecutter checks successful.
Cookiecutter successful. Running git commands to set up repository.
[...]
From https://github.com/sommer/veins
* tag veins-5.0 -> FETCH_HEAD
* tag veins-5.1 -> FETCH_HEAD
Added dir 'veins'
Repository set up successful. Running git commands to clean up.
Cookiecutter successful.
Expand Down
10 changes: 5 additions & 5 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@

# INET
{%- if cookiecutter.use_inet == "yes" %}
subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 4.1.1', 'https://github.com/inet-framework/inet', 'v4.1.1'])
subprocess.check_call(['git', 'rm', 'inet/.gitmodules', 'inet/showcases', 'inet/tutorials'])
subprocess.check_call(['git', 'commit', '--message', 'inet: remove submodules (showcases and tutorials)'])
subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 4.2.1', 'https://github.com/inet-framework/inet', 'v4.2.1'])
#subprocess.check_call(['git', 'rm', 'inet/.gitmodules', 'inet/showcases', 'inet/tutorials'])
#subprocess.check_call(['git', 'commit', '--message', 'inet: remove submodules (showcases and tutorials)'])
#subprocess.check_call(['git', 'subtree', 'add', '--squash', '--prefix=inet/tutorials', '--message', 'Merge INET Tutorials 4.0.0', 'https://github.com/inet-framework/inet-tutorials', 'v4.0.0'])
#subprocess.check_call(['git', 'subtree', 'add', '--squash', '--prefix=inet/showcases', '--message', 'Merge INET Showcases 4.0.0', 'https://github.com/inet-framework/inet-showcases', 'v4.0.0'])
{%- endif %}

# INET (version 3)
{%- if cookiecutter.use_inet3 == "yes" %}
subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 3.6.7', 'https://github.com/inet-framework/inet', 'v3.6.7'])
subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 3.6.8', 'https://github.com/inet-framework/inet', 'v3.6.8'])
subprocess.check_call(['git', 'rm', 'inet/.gitmodules', 'inet/showcases', 'inet/tutorials'])
subprocess.check_call(['git', 'commit', '--message', 'inet: remove submodules (showcases and tutorials)'])
#subprocess.check_call(['git', 'subtree', 'add', '--squash', '--prefix=inet/tutorials', '--message', 'Merge INET Tutorials 3.6.4', 'https://github.com/inet-framework/inet-tutorials', 'v3.6.4'])
Expand All @@ -63,7 +63,7 @@
{%- endif %}

# Veins
subprocess.check_call(['git', 'subtree', 'add', '--prefix=veins', '--message', 'Merge Veins 5.0', 'https://github.com/sommer/veins', 'veins-5.0'])
subprocess.check_call(['git', 'subtree', 'add', '--prefix=veins', '--message', 'Merge Veins 5.1', 'https://github.com/sommer/veins', 'veins-5.1'])

# Cookiecutter project
subprocess.check_call(['git', 'add', '.'])
Expand Down
27 changes: 27 additions & 0 deletions {{cookiecutter.project_name_as_file_name}}/setenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/echo Error. Aborting. Instead of running this script, please use: source

#
# Copyright (C) 2020 Christoph Sommer <[email protected]>
#
# Documentation for these modules is at http://veins.car2x.org/
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

cd "veins" && . ./setenv; cd - > /dev/null
cd "{{ cookiecutter.project_name_as_file_name }}" && . ./setenv; cd - > /dev/null

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ src/**/*_m.cc
doc/doxy
doc/neddoc

/run
/bin/{{cookiecutter.project_name_as_file_name}}_run

/out

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
ADDL_TARGETS =
ifeq ($(wildcard out/config.py),)
else
ADDL_TARGETS += run
ADDL_TARGETS += bin/{{cookiecutter.project_name_as_file_name}}_run
endif

# default target
Expand All @@ -40,8 +40,8 @@ else
endif

# command line scripts
run: % : src/scripts/%.in.py out/config.py
@echo "Creating script \"./$@\""
bin/{{cookiecutter.project_name_as_file_name}}_run: src/scripts/{{cookiecutter.project_name_as_file_name}}_run.in.py out/config.py
@echo "Creating script \"$@\""
@sed '/# v-- contents of out\/config.py go here/r out/config.py' "$<" > "$@"
@chmod a+x "$@"

Expand Down Expand Up @@ -70,7 +70,7 @@ endif
cleanall: clean
rm -f src/Makefile
rm -f out/config.py
rm -f run
rm -f bin/{{cookiecutter.project_name_as_file_name}}_run

src/Makefile:
@echo
Expand Down Expand Up @@ -98,7 +98,7 @@ doxyshow: doxy
xdg-open doc/doxy/index.html

formatting:
./format-code.sh src
bin/veins_format_code src

formatting-strict:
./format-code.sh --strict src
bin/veins_format_code --strict src
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

## Supported program versions ##

- Veins 5.0 (see <http://veins.car2x.org/>)
- OMNeT++ 5.5.1 (see <https://omnetpp.org/>)
- Veins 5.1 (see <http://veins.car2x.org/>)
- OMNeT++ 5.6.2 (see <https://omnetpp.org/>)

## License ##

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ else
fi

# actually format the code
find "$@" \( -name "*.cc" -or -name "*.h" \) -exec uncrustify -q --replace --no-backup -c "$(dirname "$0")"/.uncrustify.cfg "{}" \;
find "$@" \( -name "*.cc" -or -name "*.h" \) -exec uncrustify -q --replace --no-backup -c "$(dirname "$0")"/../.uncrustify.cfg "{}" \;
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ run_imgs = [os.path.join('images')]
# Add flags for Veins
if options.veins:
fname = os.path.join(options.veins, 'print-veins-version')
expect_version = [b'5.0']
expect_version = [b'5.1']
try:
info('Running "%s" to determine Veins version.' % fname)
version = subprocess.check_output(['env', fname]).strip()
Expand Down Expand Up @@ -120,7 +120,7 @@ if options.veins:
# Add flags for INET
if options.inet:
fname = os.path.join(options.inet, '_scripts/get_version')
expect_version = [b'4.1.0', b'4.1.1']
expect_version = [b'4.2.0', b'4.2.1']
try:
info('Running "%s" to determine INET version.' % fname)
version = subprocess.check_output(['env', fname]).strip()
Expand Down Expand Up @@ -182,7 +182,7 @@ if options.veins_inet:
# Add flags for INET (version 3)
if options.inet3:
fname = os.path.join(options.inet3, '_scripts/get_version')
expect_version = [b'3.6.6', b'3.6.7']
expect_version = [b'3.6.5', b'3.6.6', b'3.6.7', b'3.6.8']
try:
info('Running "%s" to determine INET version.' % fname)
version = subprocess.check_output(['env', fname]).strip()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

exec ../../run "$@"
exec ../../bin/{{cookiecutter.project_name_as_file_name}}_run "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# ^-- contents of out/config.py go here

def relpath(s):
veins_root = os.path.dirname(os.path.realpath(__file__))
veins_root = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')
return os.path.relpath(os.path.join(veins_root, s), '.')

parser = argparse.ArgumentParser('Run a {{ cookiecutter.project_name }} simulation')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#define {{ cookiecutter.project_name_as_macro_name }}_VERSION_ALPHA 0

// Explicitly check Veins version number
#if !(VEINS_VERSION_MAJOR == 5 && VEINS_VERSION_MINOR >= 0)
#error Veins version 5.0 or compatible required
#if !(VEINS_VERSION_MAJOR == 5 && VEINS_VERSION_MINOR >= 1)
#error Veins version 5.1 or compatible required
#endif

// {{ cookiecutter.project_name_as_macro_name }}_API macro. Allows us to use the same .h files for both building a .dll and linking against it
Expand Down

0 comments on commit 9715e66

Please sign in to comment.