Skip to content

Commit

Permalink
Added Ci/CD target and removed CycloneDDS dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsSassen committed Nov 25, 2019
1 parent 569a56c commit 807e0fc
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 42 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
cmake_minimum_required(VERSION 3.7)

# Set module path before defining project so platform files will work.
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/idlpp/cmake/modules)
set(CMAKE_PROJECT_NAME_FULL "CXX Idl compiler for Eclipse CycloneDDS")
set(PROJECT_NAME "Idlpp-cxx")
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This project provides an idl compiler to compile datatypes that can be used in t
In order to build the Idl compiler you need a Linux, Mac or Windows 10 machine with the following
installed on your host:

* [CycloneDDS](https://github.com/eclipse-cyclonedds/cyclonedds/)
* Git
* [CMake](https://cmake.org/download/), version 3.7 or later. (Version 3.6 should work but you
will have to edit the ``cmake_minimum_required`` version.)
* Java JDK, version 8 or later, e.g., [OpenJDK 11](http://jdk.java.net/11/).
Expand All @@ -22,15 +22,15 @@ between Linux and macOS on the one hand, and Windows on the other. For Linux or
$ git clone https://github.com/ADLINK-IST/idlpp-cxx.git
$ mkdir build
$ cd build
$ cmake -DCycloneDDS_DIR="path to CycloneDDSConfig.cmake" <cmake-config_options> ..
$ cmake <cmake-config_options> ..
$ cmake --build .

and for Windows:

$ git clone https://github.com/ADLINK-IST/idlpp-cxx.git
$ mkdir build
$ cd build
$ cmake -G "<generator-name>" -DCycloneDDS_DIR="path to CycloneDDSConfig.cmake" <cmake-config_options> ..
$ cmake -G "<generator-name>" <cmake-config_options> ..
$ cmake --build .

where you replace ``<generator-name>`` by one of the ways
Expand Down Expand Up @@ -61,7 +61,7 @@ This would make the build look like

$ mkdir build
$ cd build
$ cmake -DCycloneDDS_DIR="path to CycloneDDSConfig.cmake" -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake --build . --target install

Don't forget the generator when building on Windows.
Expand Down
103 changes: 103 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
resources:
repositories:
- repository: self

variables:
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'

jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Clang 6.0 Release:
CC: clang
CXX: clang++
BuildType: Release
USE_SANITIZER: none
GENERATOR: "Unix Makefiles"

GCC 5.4 Release:
BuildType: Release
USE_SANITIZER: none
GENERATOR: "Unix Makefiles"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- template: build.yml

- job: Windows_VS19
pool:
vmImage: 'windows-2019'
strategy:
matrix:
x86_64 Release:
BuildType: Release
GENERATOR: "Visual Studio 16 2019"
USE_SANITIZER: none

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- template: build.yml

- job: Windows_VS17
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
x86_64 Release:
BuildType: Release
GENERATOR: "Visual Studio 15 2017 Win64"
USE_SANITIZER: none

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- template: build.yml


- job: MacOS_10_13
pool:
vmImage: 'macOS-10.13'
strategy:
matrix:
Release Xcode 10.0:
BuildType: Release
USE_SANITIZER: none
GENERATOR: "Unix Makefiles"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- script: |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
- template: build.yml

- job: MacOS_10_14
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Release Xcode 11.0:
BuildType: Release
USE_SANITIZER: none
GENERATOR: "Unix Makefiles"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- bash: |
/bin/bash -c "sudo xcode-select -s /Applications/Xcode_11.app/Contents/Developer"
clang --version
displayName: 'Set Xcode11 as default'
failOnStderr: false
- script: |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
- template: build.yml

48 changes: 48 additions & 0 deletions build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
steps:
- task: CacheBeta@0
inputs:
key: maven
path: $(MAVEN_CACHE_FOLDER)
displayName: Cache Maven local repo
- bash: |
mkdir build
cd build
- task: CMake@1
displayName: 'CMake configure core product'
inputs:
cmakeArgs: '-DCMAKE_BUILD_TYPE=$(BuildType)
-DCMAKE_INSTALL_PREFIX=$(Build.SourcesDirectory)/build/install
-DUSE_SANITIZER=$(USE_SANITIZER)
-G "$(GENERATOR)" ..'
- bash: |
case "$(GENERATOR)" in
"Unix Makefiles")
cmake --build . --config $(BuildType) --target install -- -j 4
;;
"Visual Studio "*)
cmake --build . --config $(BuildType) --target install -- -nologo -verbosity:minimal -maxcpucount -p:CL_MPCount=2
;;
*)
cmake --build . --config $(BuildType) --target install
;;
esac
workingDirectory: build
failOnStderr: false
displayName: 'Compile'
- script: |
cmake --build . --config $(BuildType) --target package
workingDirectory: build
failOnStderr: false
displayName: 'Create installer'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
contents: 'build/?(*.deb|*.msi|*.tar.gz|*.tar|*.zip|*.sh)'
displayName: 'Copy installer'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: idlpp_$(AGENT.JOBNAME)
displayName: 'Publish installer'

6 changes: 0 additions & 6 deletions idlpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#
# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others
#
find_package(CycloneDDS REQUIRED)
if(NOT CycloneDDS_FOUND)
message(WARNING "Could not find Eclipse Cyclone DDS - skipping '${CMAKE_PROJECT_NAME}'")
return()
endif()


# Some locations.
set(IDLPP_OSPLI "${CMAKE_CURRENT_SOURCE_DIR}/ppresources/ospli")
Expand Down
32 changes: 0 additions & 32 deletions idlpp/cmake/modules/FindCycloneDDS.cmake

This file was deleted.

0 comments on commit 807e0fc

Please sign in to comment.