Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into get_env
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinEady committed Feb 26, 2021
2 parents 259a209 + 0cd9412 commit e6bf192
Show file tree
Hide file tree
Showing 233 changed files with 1,594 additions and 1,403 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build.yml
Expand Up @@ -131,12 +131,6 @@ jobs:
with:
name: Testlog-${{ runner.os }}-${{ matrix.config.cxx-compiler }}
path: bin-build/coretest/log/pol.log
- name: Stylecheck
if: matrix.config.cxx-compiler == 'g++' && matrix.config.os == 'ubuntu-latest'
run: |
cd testsuite/style
./checknl.py -q
./checkstyle.py -q

- name: Create Artefact
if: matrix.config.nopch == 0
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/clang-format.yml
@@ -0,0 +1,64 @@
name: StyleCheck

on: [push, pull_request]

jobs:
stylecheck:
strategy:
fail-fast: false
matrix:
config:
- os: "ubuntu-latest"
runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- name: Install Compiler and Dependencies
shell: pwsh
run: |
sudo apt-get update
sudo apt-get install clang-format-10 -y
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-10 800
- name: Stylecheck
run: |
cd testsuite/style
chmod +x clang-format-test.py
./clang-format-test.py
notify_on_failure:
needs: stylecheck
runs-on: "ubuntu-latest"
if: failure()
steps:
- name: Discord notification failure
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: failure
job: StyleCheck
notify_on_success:
needs: stylecheck
runs-on: "ubuntu-latest"
if: success()
steps:
- name: Discord notification success
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: success
job: StyleCheck
notify_on_cancel:
needs: stylecheck
runs-on: "ubuntu-latest"
if: cancelled()
steps:
- name: Discord notification cancelled
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: cancelled
job: StyleCheck
13 changes: 9 additions & 4 deletions .github/workflows/coverity-scan.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
- os: "ubuntu-latest"
cxx-compiler: g++
c-compiler: gcc
compiler-version: 8
compiler-version: 9
build-type: Release
runs-on: ${{ matrix.config.os }}
steps:
Expand All @@ -40,7 +40,7 @@ jobs:
chmod +x "$cmake_archive/bin/cmake"
echo "$Env:GITHUB_WORKSPACE/$cmake_archive/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# I'm to dumb to get coverity to work with non default compiler
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 800 --slave /usr/bin/g++ g++ /usr/bin/g++-9
- name: Download Coverity Build Tool
run: |
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Build 3rd party libs
run: |
cd bin-build
cmake ..
cmake .. -DNO_PCH=1
cmake --build . --target libcurl
cmake --build . --target libantlr_ex
cmake --build . --target boost
Expand All @@ -68,7 +68,7 @@ jobs:
- name: Build with cov-build
run: |
cd bin-build
cov-configure --gcc
cov-configure --template --comptype gcc --compiler gcc
cmake ..
cov-build --dir cov-int make -j 2
Expand All @@ -85,3 +85,8 @@ jobs:
https://scan.coverity.com/builds?project=polserver%2Fpolserver
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
# - name: Upload Artefact
# uses: actions/upload-artifact@v1
# with:
# name: test
# path: bin-build/polserver.tgz
92 changes: 55 additions & 37 deletions cmake/escript_grammar.cmake
@@ -1,47 +1,65 @@
find_package(Java QUIET COMPONENTS Runtime)

if(NOT ANTLR_EXECUTABLE)
find_program(ANTLR_EXECUTABLE
NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.8-complete.jar
)
endif()
if(Java_JAVA_EXECUTABLE AND ANTLR_EXECUTABLE)
message("adding target 'escriptgrammar'")
add_custom_target(escriptgrammar
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
-Dlanguage=Cpp -package EscriptGrammar
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.g4
-o ${POL_EXT_LIB_DIR}/EscriptGrammar
# You'll have to qualify the namespace antlr4::TokenStream
# in the EscriptParser constructor when regenerating.
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
-Dlanguage=Cpp -visitor -package EscriptGrammar
if(CMAKE_SCRIPT_MODE_FILE)
file(GLOB files "${path}/*.cpp" "${path}/*.h" )
foreach(file ${files})
get_filename_component(filename "${file}" NAME)
message("* Fixing ${filename}")
file(READ ${file} contents)
string(REGEX REPLACE "Generated from [^\r\n]*lib" "Generated from lib" replaced "${contents}")
if(filename STREQUAL "EscriptParser.cpp")
string(REPLACE "EscriptParser::EscriptParser(TokenStream *input)" "EscriptParser::EscriptParser(antlr4::TokenStream *input)" replaced "${replaced}")
endif()
file(WRITE ${file} "${replaced}")
endforeach()
else()
if(NOT ANTLR_EXECUTABLE)
find_program(ANTLR_EXECUTABLE
NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.8-complete.jar
)
endif()
if(Java_JAVA_EXECUTABLE AND ANTLR_EXECUTABLE)
message("adding target 'escriptgrammar'")
add_custom_target(escriptgrammar
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
-Dlanguage=Cpp -package EscriptGrammar
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.g4
-o ${POL_EXT_LIB_DIR}/EscriptGrammar
# You'll have to qualify the namespace antlr4::TokenStream
# in the EscriptParser constructor when regenerating.
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
-Dlanguage=Cpp -visitor -package EscriptGrammar
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.g4
-o ${POL_EXT_LIB_DIR}/EscriptGrammar
COMMENT "Generating grammar files"
)
add_custom_command(TARGET escriptgrammar
POST_BUILD COMMAND ${CMAKE_COMMAND} -Dpath=${POL_EXT_LIB_DIR}/EscriptGrammar -P ${CMAKE_CURRENT_LIST_FILE}
COMMENT "Fixing files"
)
endif()

#fake target for vstudio gui
add_custom_target(escriptfiles
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
VERBATIM
SOURCES
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.g4
-o ${POL_EXT_LIB_DIR}/EscriptGrammar
COMMENT "Generating grammar files"
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.h
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.cpp
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.g4
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.h
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.cpp
)
endif()

#fake target for vstudio gui
add_custom_target(escriptfiles
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
VERBATIM
SOURCES
source_group(escriptgrammar FILES
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.g4
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.h
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.cpp
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.g4
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.h
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.cpp
)
source_group(escriptgrammar FILES
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.g4
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.h
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptParser.cpp
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.g4
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.h
${POL_EXT_LIB_DIR}/EscriptGrammar/EscriptLexer.cpp
)
set_target_properties(escriptfiles PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(escriptfiles PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(escriptfiles PROPERTIES FOLDER Grammar)
)
set_target_properties(escriptfiles PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(escriptfiles PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(escriptfiles PROPERTIES FOLDER Grammar)
endif()
19 changes: 10 additions & 9 deletions docs/docs.polserver.com/pol100/corechanges.xml
Expand Up @@ -2,20 +2,21 @@
<ESCRIPT>
<header>
<topic>Latest Core Changes</topic>
<datemodified>12-28-2020</datemodified>
<datemodified>02-26-2021</datemodified>
</header>
<version name="POL100">
<entry>
<date>12-28-2020</date>
<author>Turley:</author>
<change type="Added">pol.cfg AllowEnvironmentVariableAccess disable this setting to disallow execution of os::GetEnvironmentVariable</change>
<date>02-26-2020</date>
<author>Turley, Kevin:</author>
<change type="Added">os::GetEnvironmentVariable(name:=&quot;&quot;)<br/>
Returns String value of given environment variable name. If name is empty, returns Dictionary of all environment variables.<br/>
The pol.cfg setting AllowedEnvironmentVariablesAccess controls script access to this function. See documentation for more details.</change>
</entry>
<entry>
<date>12-26-2020</date>
<author>Turley:</author>
<change type="Added">os::GetEnvironmentVariable(name:=&quot;&quot;)<br/>
returns String value of given environment variable name<br/>
if name is empty returns dictionary of all environment variables</change>
<date>02-22-2021</date>
<author>Kevin:</author>
<change type="Fixed">Various compilation issues when using &quot;\\&quot; in scripts.</change>
<change type="Fixed">Passing a string for the skill to CheckSkill() now correctly uses the mobile's skill.</change>
</entry>
<entry>
<date>12-17-2020</date>
Expand Down

0 comments on commit e6bf192

Please sign in to comment.