Skip to content

Commit 70934cc

Browse files
Merge pull request #182 from martinweismann/rtti-native-3
Native Run-Time Type Information support @anpilog
2 parents 1c4a983 + b558b92 commit 70934cc

File tree

204 files changed

+17194
-483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+17194
-483
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# action.yml
2+
name: 'BuildWithDocker'
3+
description: 'Build ACT within a Docker container'
4+
inputs:
5+
command: # id of input
6+
description: 'What command to run'
7+
required: true
8+
default: 'act'
9+
runs:
10+
using: 'docker'
11+
image: '../../../Build/Dockerfile'
12+
args:
13+
- ${{ inputs.command }}

.github/workflows/build.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
- uses: actions/checkout@v2
88
with:
99
submodules: true
10-
- run: sh build.sh
10+
- run: ./build.sh
1111
working-directory: ./Build
1212
build-macos:
1313
runs-on: macos-10.15
1414
steps:
1515
- uses: actions/checkout@v2
1616
with:
1717
submodules: true
18-
- run: sh build.sh
18+
- run: ./build.sh
1919
working-directory: ./Build
2020
build-windows:
2121
runs-on: windows-2019
@@ -25,11 +25,16 @@ jobs:
2525
submodules: true
2626
- run: ./build.bat
2727
working-directory: ./Build
28-
- name: Upload Windows Binary
28+
- name: Upload Windows 64bit Binary
2929
uses: actions/upload-artifact@v2
3030
with:
31-
name: act.exe
32-
path: act.exe
31+
name: act.win64.exe
32+
path: act.win64.exe
33+
- name: Upload Windows 32bit Binary
34+
uses: actions/upload-artifact@v2
35+
with:
36+
name: act.win32.exe
37+
path: act.win32.exe
3338
- name: Upload MacOS Binary
3439
uses: actions/upload-artifact@v2
3540
with:
@@ -40,14 +45,24 @@ jobs:
4045
with:
4146
name: act.arm.darwin
4247
path: act.arm.darwin
43-
- name: Upload Linux Binary
48+
- name: Upload Linux 32bit Binary
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: act.linux32
52+
path: act.linux32
53+
- name: Upload Linux ARM 32bit Binary
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: act.arm.linux32
57+
path: act.arm.linux32
58+
- name: Upload Linux 64bit Binary
4459
uses: actions/upload-artifact@v2
4560
with:
46-
name: act.linux
47-
path: act.linux
48-
- name: Upload Linux ARM Binary
61+
name: act.linux64
62+
path: act.linux64
63+
- name: Upload Linux ARM 64bit Binary
4964
uses: actions/upload-artifact@v2
5065
with:
51-
name: act.arm.linux
52-
path: act.arm.linux
66+
name: act.arm.linux64
67+
path: act.arm.linux64
5368

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on: [push, pull_request]
2+
name: Build ACT examples
3+
jobs:
4+
build_with_docker:
5+
runs-on: ubuntu-latest
6+
name: Build ACT examples with docker
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v3
10+
- name: build act
11+
id: build_act
12+
uses: ./.github/actions/buildWithDocker
13+
with:
14+
command: 'act'
15+
- name: build examples
16+
id: build_examples
17+
uses: ./.github/actions/buildWithDocker
18+
with:
19+
command: 'examples'

.gitignore

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
*.cpp
2-
*.hpp
3-
*.h
41
*.exe
52
*.linux
63
*.linux32
74
*.linux64
85
*.darwin
96
*.exe
7+
*.dylib
8+
*.so
9+
*.dll
1010
*.arm
11-
*.c
12-
*.go
1311
*.orig
12+
*.class
13+
*.jar
14+
*.log
15+
*.o
16+
*.ppu
17+
__pycache__
18+
19+
Examples/**/build
20+
Examples/**/build-*
21+
Examples/**/bin
22+
Examples/**/obj
1423

1524
# Visual Studio Code
1625
debug
1726
.vscode
1827

19-
*_headers
20-
*_component
21-
22-
Examples/*.xml
28+
.DS_Store

Build/Dockerfile

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM centos:centos8
2+
3+
ARG USER_ID
4+
ARG GROUP_ID
5+
6+
LABEL maintainer="Andrii Anpilogov (andrii.anpilogov@autodesk.com)"
7+
8+
RUN [ -e /etc/yum.conf ] && sed -i '/tsflags=nodocs/d' /etc/yum.conf || true
9+
10+
# RUN yum install -y icu
11+
12+
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
13+
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
14+
RUN yum update -y
15+
16+
RUN dnf -y install dnf-plugins-core
17+
RUN dnf -y install dnf-plugin-config-manager
18+
RUN dnf -y update
19+
20+
RUN dnf -y install epel-release
21+
RUN dnf -y config-manager --set-enabled powertools
22+
23+
# GCC
24+
RUN dnf -y install gcc-toolset-9-gcc
25+
RUN dnf -y install gcc-toolset-9-gcc-c++
26+
27+
# CMake & Ninja
28+
RUN dnf -y install cmake
29+
RUN dnf -y install ninja-build
30+
31+
# Free Pascal
32+
# 3.0.4 should be used for validating compiler base compatibility.
33+
RUN (cd /opt && curl -O -L 'http://downloads.sourceforge.net/project/freepascal/Linux/3.0.4/fpc-3.0.4-1.x86_64.rpm' \
34+
&& rpm -i fpc-3.0.4-1.x86_64.rpm)
35+
36+
# Using 3.2.2 until PolymorphicFactory is reworked to not using generics that are not full functional in 3.0.4.
37+
# RUN (cd /opt && curl -O -L 'http://downloads.sourceforge.net/project/freepascal/Linux/3.2.2/fpc-3.2.2-1.x86_64.rpm' \
38+
# && rpm -i fpc-3.2.2-1.x86_64.rpm)
39+
40+
# Golang
41+
RUN (cd /opt && curl -O -L https://golang.org/dl/go1.17.2.linux-amd64.tar.gz \
42+
&& tar zxvf go1.17.2.linux-amd64.tar.gz)
43+
44+
# Java
45+
RUN dnf -y install \
46+
java-11-openjdk-devel
47+
48+
# Mono
49+
RUN rpm --import https://download.mono-project.com/repo/xamarin.gpg \
50+
&& dnf config-manager --add-repo https://download.mono-project.com/repo/centos8-stable.repo \
51+
&& dnf -y install mono-complete
52+
53+
# General purpose tools
54+
RUN dnf -y install \
55+
glibc-common \
56+
glibc-utils \
57+
less \
58+
passwd \
59+
tar \
60+
vim-minimal \
61+
vim-enhanced \
62+
which \
63+
sudo \
64+
bash-completion \
65+
mc \
66+
yum-utils \
67+
&& yum clean all
68+
69+
# # Initialize Toolkit
70+
RUN echo "source /opt/rh/gcc-toolset-9/enable" >> /etc/bashrc
71+
ENV PATH="${PATH}:/opt/go/bin"
72+
73+
# Initialize Toolkit
74+
# RUN : "${USER_ID:?Build argument needs to be set and non-empty.}" \
75+
# : "${GROUP_ID:?Build argument needs to be set and non-empty.}"
76+
77+
# Create user
78+
RUN if [ $USER_ID != "" ] ; then groupadd docker \
79+
&& useradd -ms /bin/bash --uid $USER_ID -g docker -G wheel user \
80+
&& printf "user:user" | chpasswd \
81+
&& printf "user ALL= NOPASSWD: ALL\\n" >> /etc/sudoers ; fi
82+
83+
# Initialize Toolkit
84+
RUN if [ $USER_ID != "" ] ; then echo "source /opt/rh/gcc-toolset-9/enable" >> /home/user/.bash_profile ; fi
85+
RUN if [ $USER_ID != "" ] ; then echo "export PATH=\$PATH:/opt/go/bin" >> /home/user/.bash_profile ; fi
86+
87+
ENTRYPOINT ["./entrypoint.sh"]

Build/Readme.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,44 @@ https://github.com/pavel-a/ddverpatch/releases
3737
Call like this
3838
```
3939
verpatch.exe ..\act.exe /high /va 1.5.0 /pv "1.5.0-RC1+buildnumber-5" /s copyright "(c) 2018-2019 ACT Developers" /s desc "ACT is a code generator for software components" /s productName "Automatic Component Toolkit"
40-
```
40+
```
41+
42+
## Docker
43+
44+
Docker image can be used to build ACT and all its example.
45+
46+
**Build Docker image:**
47+
```
48+
./Build/build.sh
49+
```
50+
51+
**Build ACT and all examples**
52+
```
53+
# go into root folder of this repo
54+
docker run -it --rm -v $PWD:/data act-build
55+
```
56+
57+
**Run Docker image interactively:**
58+
```
59+
# go into root folder of this repo
60+
docker run -it --rm -v $PWD:/data --entrypoint bash act-build -l
61+
```
62+
Source code is available in `/data` directory.
63+
64+
**Useful scripts**
65+
| Script | Description|
66+
|--------|------------|
67+
| `./Build/docker.sh build` | build docker image |
68+
| `./Build/docker.sh act` | build ACT binaries |
69+
| `./Build/docker.sh examples` | build and run projects in Examples folder |
70+
| `./Build/docker.sh all` | build ACT binaries and then build and run projects in Examples folder" |
71+
| `./Build/docker.sh cli` | open bash session inside Docker with source code mapped to '/data' directory" |
72+
| Command to run in Docker cli mode (sources are mapped to `/data` directory): |
73+
| `./Build/build.sh` | build ACT binaries |
74+
| `./Examples/build.sh` | build and run projects in Examples folder (including updating Bindings and Interfaces) |
75+
| `./Examples/RTTI/build.sh` | build and run projects in Examples/RTTI folder (including updating Bindings and Interfaces) |
76+
| `./Examples/Injection/build.sh` | build and run projects in Examples/RTTI folder (including updating Bindings and Interfaces) |
77+
| `./Examples/RTTI/RTTI_component/Implementations/Cpp/build.sh` | build RTTI C++ library implementation |
78+
| `./Examples/RTTI/RTTI_component/Implementations/Pascal/build.sh` | build RTTI Pascal library implementation |
79+
| `./Examples/RTTI/RTTI_component/Examples/CppDynamic/build.sh` | build and run RTTI C++ Example (requres C++ and Pascal libraries) |
80+
| `./Examples/RTTI/RTTI_component/Examples/Python/build.sh` | build and run RTTI Python Example (requres C++ and Pascal libraries) |

Build/build.bat

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ set Sources=actutils.go automaticcomponenttoolkit.go buildbindingccpp.go buildbi
77

88
set GOOS=windows
99
set GOARCH=amd64
10-
echo "Build act.exe"
10+
echo "Build act.win64.exe"
1111
go build -o ..\act.win64.exe %Sources%
1212

1313
echo "Patching properties of act.win64.exe"
14-
..\build\verpatch ..\act.win64.exe /high /va 1.7.0 /pv "1.7.0-develop" /s copyright "(c) 2018-2019 ACT Developers" /s desc "ACT is a code generator for software components" /s productName "Automatic Component Toolkit"
14+
..\build\verpatch ..\act.win64.exe /high /va 1.8.0 /pv "1.8.0-develop" /s copyright "(c) 2018-2019 ACT Developers" /s desc "ACT is a code generator for software components" /s productName "Automatic Component Toolkit"
1515

1616
set GOOS=windows
1717
set GOARCH=386
1818
echo "Build act.win32.exe"
1919
go build -o ..\act.win32.exe %Sources%
2020

21-
echo "Patching properties of act_win32.exe"
22-
..\build\verpatch ..\act.win32.exe /high /va 1.7.0 /pv "1.7.0-develop" /s copyright "(c) 2018-2019 ACT Developers" /s desc "ACT is a code generator for software components" /s productName "Automatic Component Toolkit"
21+
echo "Patching properties of act.win32.exe"
22+
..\build\verpatch ..\act.win32.exe /high /va 1.8.0 /pv "1.8.0-develop" /s copyright "(c) 2018-2019 ACT Developers" /s desc "ACT is a code generator for software components" /s productName "Automatic Component Toolkit"
2323

2424
set GOOS=linux
2525
set GOARCH=amd64
@@ -38,21 +38,23 @@ go build -o ..\act.darwin %Sources%
3838

3939
set GOOS=darwin
4040
set GOARCH=arm
41+
set GOARM=5
4142
echo "Build act.arm.darwin"
4243
go build -o ..\act.arm.darwin %Sources%
4344

4445
set GOOS=linux
4546
set GOARCH=arm
4647
set GOARM=5
47-
echo "Build act.linux32.arm"
48-
go build -o ..\act.linux32.arm %Sources%
48+
go build -o ..\act.arm.linux32 %Sources%
4949

5050
set GOOS=linux
5151
set GOARCH=arm64
5252
set GOARM=5
53-
echo "Build act.linux64.arm"
54-
go build -o ..\act.linux64.arm %Sources%
53+
echo "Build act.arm.linux64"
54+
go build -o ..\act.arm.linux64 %Sources%
5555

5656
copy ..\act.win64.exe ..\act.exe /Y
57+
copy ..\act.linux64 ..\act.linux /Y
58+
5759

5860
cd %startingDir%

Build/build.inc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
RUN () {
6+
CMD=$1
7+
OS="`uname`"
8+
case $OS in
9+
Linux*)
10+
OSLD_LIBRARY_PATH="LD_LIBRARY_PATH=$2"
11+
for i in "${@:3}"
12+
do
13+
OSLD_LIBRARY_PATH=$OSLD_LIBRARY_PATH:$i
14+
done
15+
eval $OSLD_LIBRARY_PATH $CMD
16+
;;
17+
Darwin*)
18+
OSLD_LIBRARY_PATH="DYLD_LIBRARY_PATH=$2"
19+
for i in "${@:3}"
20+
do
21+
OSLD_LIBRARY_PATH=$OSLD_LIBRARY_PATH:$i
22+
done
23+
eval $OSLD_LIBRARY_PATH $CMD
24+
;;
25+
Windows*) OSLD_LIBRARY_PATH='PATH=%PATH%;' ;;
26+
*) ;;
27+
esac
28+
}
29+
30+
# Common initialization
31+
OS="`uname`"
32+
case $OS in
33+
Linux*)
34+
OSEXT='.linux'
35+
OSLIBEXT='.so'
36+
OSEXEEXT=
37+
FPC_TARGET='linux'
38+
;;
39+
Windows*)
40+
OSEXT='.exe'
41+
OSLIBEXT='.dll'
42+
OSEXEEXT='.exe'
43+
FPC_TARGET='win64'
44+
;;
45+
Darwin*)
46+
OSEXT='.darwin'
47+
OSLIBEXT='.dylib'
48+
OSEXEEXT=
49+
FPC_TARGET='darwin'
50+
;;
51+
*) echo "[Failed] Can't detect OS. Only Windows, Linux and MacOS are supported."; exit 1; ;;
52+
esac
53+
54+
export ACT=act$OSEXT

0 commit comments

Comments
 (0)