Skip to content

Commit 86048d8

Browse files
committed
craft gl leftovers
1 parent 9e0aa75 commit 86048d8

4 files changed

Lines changed: 16 additions & 12 deletions

File tree

.github/workflows/configure_project.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
workflow_dispatch:
55
inputs:
66
new_project_name:
7-
description: 'The name for the new project.'
7+
description: 'The name for the project.'
88
required: true
9-
default: 'New Project Name'
9+
default: 'My Awesome Project'
1010
project_description:
1111
description: 'A short description of the project.'
1212
required: true
@@ -41,6 +41,9 @@ jobs:
4141
# Convert the project name to snake_case for use in filenames and other contexts.
4242
PROJECT_NAME_LOWER=$(echo "${{ github.event.inputs.new_project_name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
4343
echo "project_name_lower=$PROJECT_NAME_LOWER" >> $GITHUB_OUTPUT
44+
# Convert the project name to CamelCase for use in class names.
45+
PROJECT_NAME_CAMEL=$(echo "${{ github.event.inputs.new_project_name }}" | sed -e 's/\b\(.\)/\u\1/g' -e 's/ //g')
46+
echo "project_name_camel=$PROJECT_NAME_CAMEL" >> $GITHUB_OUTPUT
4447
4548
- name: Set homepage URL
4649
id: set-url
@@ -56,12 +59,13 @@ jobs:
5659
# This command finds all files and uses 'sed' to replace all the placeholders.
5760
# The sed delimiter is changed from '/' to '|' to safely handle path names.
5861
find . -type f -not -path './.git/*' -not -path './.github/workflows/*' -exec sed -i \
59-
-e "s|{{PROJECT_NAME}}|${{ github.event.inputs.new_project_name }}|g" \
60-
-e "s|{{PROJECT_NAME_LOWER}}|${{ steps.set-variables.outputs.project_name_lower }}|g" \
61-
-e "s|{{PROJECT_DESCRIPTION}}|${{ github.event.inputs.project_description }}|g" \
62-
-e "s|{{PROJECT_REPOSITORY_URL}}|${{ github.server_url }}/${{ github.repository }}|g" \
63-
-e "s|{{PROJECT_HOMEPAGE_URL}}|${{ steps.set-url.outputs.homepage_url }}|g" \
64-
-e "s|{{CPACK_PACKAGE_CONTACT}}|${{ github.event.inputs.cpack_package_contact }}|g" \
62+
-e "s|{{PROJECT_NAME}}|${{ github.event.inputs.new_project_name }}|g"
63+
-e "s|{{PROJECT_NAME_LOWER}}|${{ steps.set-variables.outputs.project_name_lower }}|g"
64+
-e "s|{{PROJECT_NAME_CAMEL}}|${{ steps.set-variables.outputs.project_name_camel }}|g"
65+
-e "s|{{PROJECT_DESCRIPTION}}|${{ github.event.inputs.project_description }}|g"
66+
-e "s|{{PROJECT_REPOSITORY_URL}}|${{ github.server_url }}/${{ github.repository }}|g"
67+
-e "s|{{PROJECT_HOMEPAGE_URL}}|${{ steps.set-url.outputs.homepage_url }}|g"
68+
-e "s|{{CPACK_PACKAGE_CONTACT}}|${{ github.event.inputs.cpack_package_contact }}|g"
6569
{} +
6670
6771
- name: Remove template-specific files and instructions
@@ -82,4 +86,4 @@ jobs:
8286
body: |
8387
This pull request configures the project from the template with the information you provided.
8488
branch: configure-project-${{ github.run_number }}
85-
token: ${{ secrets.GITHUB_TOKEN }}
89+
token: ${{ secrets.GITHUB_TOKEN }}

cmake/StaticAnalysis.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if(ENABLE_CPPCHECK)
4444
COMMENT "Running cppcheck analysis on the entire project..."
4545
)
4646

47-
add_dependencies(static_analysis_cppcheck craftgl)
47+
add_dependencies(static_analysis_cppcheck ${PROJECT_NAME})
4848
else()
4949
message(WARNING "Cppcheck not found. Static analysis target for cppcheck will be not created nor run.")
5050
endif()

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_version(conanfile):
1515
except Exception as e:
1616
return None
1717

18-
class CraftGLConan(ConanFile):
18+
class {{PROJECT_NAME_CAMEL}}Conan(ConanFile):
1919
name = "{{PROJECT_NAME_LOWER}}"
2020
url = "{{PROJECT_HOMEPAGE_URL}}"
2121
description = "{{PROJECT_DESCRIPTION}}"

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ set(GAME_HEADERS
1111
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${GAME_SOURCES} ${GAME_HEADERS})
1212
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
1313
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
14-
target_link_libraries(${PROJECT_NAME} PRIVATE craftgl::engine)
14+
target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}::engine)

0 commit comments

Comments
 (0)