Skip to content

Commit

Permalink
fix(CD): set build/tag management on develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
stefled committed Oct 7, 2024
1 parent 2306266 commit a521e5d
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- '[0-9]+\.[0-9]+\.[0-9]+'

env:
tag_version: ${{ github.ref_name == 'feature/boost_1.84.0' && '0.0.0' || github.ref_name }}
tag_version: ${{ github.ref_name == 'develop' && '0.0.0' || github.ref_name }}

jobs:
windows-ci:
Expand Down
26 changes: 14 additions & 12 deletions scripts/win/update_version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set help=false
set clean=false
set marker=version
set replace=0.0.0
set template=""
set filename=

@REM Check parameters
set argC=0
Expand All @@ -20,8 +20,8 @@ for %%x in (%*) do (
set foundReplace=false
)
if "!foundTemplate!"=="true" (
set template=%%x
set foundTemplate=false
set filename=%%x
REM echo !filename!
)
if "%%x"=="-f" (
set forceReplacement=true
Expand All @@ -48,30 +48,31 @@ for %%x in (%*) do (
set clean=true
)
if "%%x"=="-t" (
set foundTemplate=true
set foundTemplate=true
)
if "%%x"=="--template" (
set foundTemplate=true
set foundTemplate=true
)
)

@REM Check optional parameters
if "!help!"=="true" goto display_usage

if "!foundTemplate!"=="true" (
if "!template!"=="" (
if "!filename!"=="" (
echo "error in template parameters: no template file found"
) else (
set targetFile=!filename:.template=!

set targetFile=!filename:.template=!
REM echo !targetFile!
call :generate_file
)
) else (
for /f %%f in ('dir /s/b *.template') do (
for /f %%f in ('dir /s/b *.template') do (

@REM Define output file
set filename=%%f
set targetFile=!filename:.template=!
REM echo SLE !targetFile!

@REM Remove generated files
if "!clean!"=="true" (
Expand All @@ -87,12 +88,13 @@ goto end
:display_usage
echo This script generates or replaces files from all template files (*.template) in the directory and its subdirectory
echo replacing marker "<version>" by the version (default version "0.0.0").
echo
echo update_version.bat [options] --version|-v <version_number>
echo.
echo update_version.bat [options] --version/-v ^<version_number^>
echo options:
echo - --help or -h display usage
echo - --force or -f force generation (replace previous file)
echo - --clean or -c remove all generated files from template
echo - --template or -t generate the file only for the template file given in parameter
exit /b 0

:generate_file
Expand All @@ -112,7 +114,7 @@ if "!doReplace!"=="true" (
set line=%%i
>> !targetFile! echo(!line:^<%marker%^>=%replace%!
)
echo generated file !targetFile!
echo file !targetFile! generated
) else (
echo no replacement of !targetFile!
)
Expand Down
2 changes: 2 additions & 0 deletions src/BaseTask.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "xpcf/threading/BaseTask.h"

#ifdef XPCF_USE_BOOST
//#define BOOST_FIBERS_STATIC_LINK
//#include "boost/fiber/all.hpp"
#include "boost/fiber/fiber.hpp"
#include "boost/fiber/operations.hpp"
#include "boost/fiber/future.hpp"
Expand Down
4 changes: 0 additions & 4 deletions test/packagedependencies.txt

This file was deleted.

3 changes: 0 additions & 3 deletions test/packagedependencies_incode.txt

This file was deleted.

10 changes: 0 additions & 10 deletions test/testxpcf.pri
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
! exists(../version.pri) {
win32 {
system(scripts/win/update_version.bat -t ../version.pri)
}
linux {
system(scripts/unixes/update_version.sh -t ../version.pri)
}
system(cd $${currentPath})
}
include(../version.pri)
VERSION=$${XPCF_VERSION}

CONFIG += c++1z
Expand Down
15 changes: 3 additions & 12 deletions test/testxpcf.pro
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
TARGET = testxpcf

LIST = "xpcf_registry_test.xml.template" "xpcf_xml_test_missing_end_tag.xml" "xpcf_xml_test_missing_start_tag.xml.template" "xpcf_xml_test_module_uuid_format_ko.xml.template" "xpcf_xml_test_property_type_invalid.xml.template" "xpcf_xml_test_property_unknown_component.xml.template" "xpcf_xml_test_unknown_component.xml.template" "xpcf_xml_test_unknown_property.xml.template" "xpcf_xml_test_valid.xml.template"
for(file, LIST) {
! exists(file) {
win32 {
system(../scripts/win/update_version.bat)
}
linux {
system(../scripts/unixes/update_version.sh)
}
break()
}
}
TEMPLATE_LIST_FILE=../version.pri packagedependencies.txt xpcf_registry_test.xml xpcf_xml_test_missing_end_tag.xml xpcf_xml_test_missing_start_tag.xml xpcf_xml_test_module_uuid_format_ko.xml xpcf_xml_test_property_type_invalid.xml xpcf_xml_test_property_unknown_component.xml xpcf_xml_test_unknown_component.xml xpcf_xml_test_unknown_property.xml xpcf_xml_test_valid.xml
PROJECT_ROOT_PATH=$$_PRO_FILE_PWD_/..
include ($${PROJECT_ROOT_PATH}/generate_template_files.pri)

CONFIG += shared
DEPENDENCIESCONFIG = sharedlib recurse
Expand Down
4 changes: 4 additions & 0 deletions test/testxpcf_static_deps.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
TARGET = testxpcf_static_deps

TEMPLATE_LIST_FILE=../version.pri packagedependencies.txt xpcf_registry_test.xml xpcf_xml_test_missing_end_tag.xml xpcf_xml_test_missing_start_tag.xml xpcf_xml_test_module_uuid_format_ko.xml xpcf_xml_test_property_type_invalid.xml xpcf_xml_test_property_unknown_component.xml xpcf_xml_test_unknown_component.xml xpcf_xml_test_unknown_property.xml xpcf_xml_test_valid.xml
PROJECT_ROOT_PATH=$$_PRO_FILE_PWD_/..
include ($${PROJECT_ROOT_PATH}/generate_template_files.pri)

CONFIG += shared
DEPENDENCIESCONFIG = staticlib recurse
DEFINES += XPCF_STATIC_DEPS
Expand Down
1 change: 0 additions & 1 deletion tools/cli/xpcfcli.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ TARGET = xpcfcli
linux {
system(../../scripts/unixes/update_version.sh -t ../../version.pri.template)
}
system(cd $${currentPath})
}
include(../../version.pri)

Expand Down
2 changes: 1 addition & 1 deletion tools/generators/grpc/xpcf_grpc_gen.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ for(file, LIST) {
!exists(file) {
message("$$TARGET - at least $${file} not present, generate it")
win32 {
system(../../../scripts/win/update_version.bat)
system($$shell_quote($$shell_path(../../../scripts/win/update_version.bat)))
}
linux {
system(../../../scripts/unixes/update_version.sh)
Expand Down
30 changes: 12 additions & 18 deletions xpcf.pro
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
TARGET = xpcf

!exists(version.pri) {
message("$$TARGET - version.pri not present, generate it")
win32 {
system(scripts/win/update_version.bat)
}
linux {
system(scripts/unixes/update_version.sh)
}
}

include(version.pri)
QT -= core gui
TARGET = xpcf
QT -= core gui
CONFIG -= app_bundle qt

FRAMEWORK = $${TARGET}
VERSION=$${XPCF_VERSION}

#CONFIG += verbose

TEMPLATE_LIST_FILE=version.pri
PROJECT_ROOT_PATH=$$_PRO_FILE_PWD_/.
include ($${PROJECT_ROOT_PATH}/generate_template_files.pri)

VERSION=$${XPCF_VERSION}
DEFINES += XPCFVERSION=\\\"$${VERSION}\\\"

CONFIG += c++1z
#CONFIG += verbose
CONFIG += staticlib recurse
!staticlib {
CONFIG += shared
} else {
CONFIG -= shared
}
#message($${CONFIG})
#CONFIG += verbose

# Uncomment following line to prepare remaken package
#CONFIG += package_remaken
Expand Down Expand Up @@ -215,6 +207,8 @@ macx {
win32 {
DEFINES += _X86_VC12_TARGET_
DEFINES += MBCS _MBCS


}

INCLUDEPATH += $${PWD} $${PWD}/interfaces
Expand Down
35 changes: 10 additions & 25 deletions xpcf_static_deps.pro
Original file line number Diff line number Diff line change
@@ -1,42 +1,27 @@
!exists(version.pri) {
message("$$TARGET - version.pri not present, generate it")
win32 {
system(scripts/win/update_version.bat)
}
linux {
system(scripts/unixes/update_version.sh)
}
}

include(version.pri)
VERSION=$${XPCF_VERSION}

TARGET = xpcf_static_deps
QT -= core gui
CONFIG -= app_bundle qt
TARGET = xpcf_static_deps
FRAMEWORK = $${TARGET}

#CONFIG += verbose

TEMPLATE_LIST_FILE=version.pri
PROJECT_ROOT_PATH=$$_PRO_FILE_PWD_/.
include ($${PROJECT_ROOT_PATH}/generate_template_files.pri)

VERSION=$${XPCF_VERSION}
DEFINES += XPCFVERSION=\\\"$${VERSION}\\\"

CONFIG += c++1z
#CONFIG += staticlib
#CONFIG += verbose
#!staticlib {
CONFIG += shared
#} else {
# CONFIG -= shared
#}
#message($${CONFIG})
#CONFIG += verbose
CONFIG += shared

# Uncomment following line to prepare remaken package
#CONFIG += package_remaken

DEFINES += WITHREMOTING
DEFINES += XPCF_USE_BOOST

DEFINES += XPCF_SHARED
DEPENDENCIESCONFIG = staticlib #sharedlib
DEPENDENCIESCONFIG = staticlib
REMAKEN_PKGSUBDIR=shared

CONFIG(debug,debug|release) {
Expand Down

0 comments on commit a521e5d

Please sign in to comment.