forked from LiteLDev/LeviLamina
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Improve CMake project structure (LiteLDev#787)
* Feature: Improve CMake project structure * Rename Test to test * Move RELEASE to assets * Rename Scripts to scripts * Fix CI * Merge PackOutput into CMake build workflow * Pack SDK wit CMake
- Loading branch information
1 parent
d6556b4
commit 561a848
Showing
69 changed files
with
182 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,14 +36,14 @@ jobs: | |
path: | | ||
${{ env.GITHUB_WORKSPACE }}LiteLoader/Lib/bedrock_server_api.lib | ||
${{ env.GITHUB_WORKSPACE }}LiteLoader/Lib/bedrock_server_var.lib | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Scripts/LINK.txt') }} | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('scripts/LINK.txt') }} | ||
|
||
- name: Download Server | ||
if: steps.cache-bds-lib.outputs.cache-hit != 'true' | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
run: | | ||
mkdir Tools/Server | ||
ServerLink=$(cat 'Scripts/LINK.txt') | ||
ServerLink=$(cat 'scripts/LINK.txt') | ||
curl -L -o Tools/Server/server.zip "$ServerLink" | ||
unzip Tools/Server/server.zip -d Tools/Server/ > /dev/null | ||
shell: bash | ||
|
@@ -107,39 +107,36 @@ jobs: | |
- name: Build SymDBHelper | ||
run: cmake --build ${{github.workspace}}/build_clang --config ${{env.BUILD_TYPE}} --target SymDBHelper | ||
|
||
- name: Compress Resource Packs | ||
- name: Configure CMake(MSVC) | ||
run: | | ||
cd RELEASE/plugins/LiteLoader/ResourcePacks | ||
7z a LiteLoaderBDS-CUI.tar LiteLoaderBDS-CUI | ||
rm -r LiteLoaderBDS-CUI | ||
shell: bash | ||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
shell: cmd | ||
|
||
- name: Copy Release | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
- name: Pack output and SDK | ||
run: | | ||
cd Scripts | ||
./CopyRelease.cmd action | ||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackOutput | ||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackSDK | ||
shell: cmd | ||
|
||
- name: Move PDB to path | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
- name: Compress Resource Packs | ||
run: | | ||
mkdir PDB | ||
cp x64/Release/*.pdb PDB | ||
cd build/output/plugins/LiteLoader/ResourcePacks | ||
7z a LiteLoaderBDS-CUI.tar LiteLoaderBDS-CUI | ||
rm -r LiteLoaderBDS-CUI | ||
shell: bash | ||
|
||
- name: Pack PDB | ||
- name: Pack PDB for Release | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: 7z a -tzip PDB.zip PDB | ||
run: 7z a -tzip PDB.zip build/pdb | ||
shell: bash | ||
|
||
- name: Update LiteLoaderSDK | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
cd Scripts | ||
cd scripts | ||
./UploadSDK.cmd action | ||
env: | ||
REPO_KEY: ${{secrets.PUSH_TOKEN}} | ||
|
@@ -150,16 +147,16 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
name: LiteLoader | ||
path: ${{ github.workspace }}\RELEASE\ | ||
path: ${{ github.workspace }}\build\output\ | ||
|
||
- name: Upload PDB | ||
uses: actions/[email protected] | ||
with: | ||
name: PDB | ||
path: ${{ github.workspace }}\PDB | ||
path: ${{ github.workspace }}\build\pdb\ | ||
|
||
- name: Pack Release | ||
working-directory: ${{ env.GITHUB_WORKSPACE }}/RELEASE | ||
working-directory: ${{ env.GITHUB_WORKSPACE }}/build/output | ||
id: rel | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,14 +37,14 @@ jobs: | |
path: | | ||
${{ env.GITHUB_WORKSPACE }}LiteLoader/Lib/bedrock_server_api.lib | ||
${{ env.GITHUB_WORKSPACE }}LiteLoader/Lib/bedrock_server_var.lib | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Scripts/LINK.txt') }} | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('scripts/LINK.txt') }} | ||
|
||
- name: Download Server | ||
if: steps.cache-bds-lib.outputs.cache-hit != 'true' | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
run: | | ||
mkdir Tools/Server | ||
ServerLink=$(cat 'Scripts/LINK.txt') | ||
ServerLink=$(cat 'scripts/LINK.txt') | ||
curl -L -o Tools/Server/server.zip "$ServerLink" | ||
unzip Tools/Server/server.zip -d Tools/Server/ > /dev/null | ||
shell: bash | ||
|
@@ -97,28 +97,14 @@ jobs: | |
- name: Build SymDBHelper | ||
run: cmake --build ${{github.workspace}}/build_clang --config ${{env.BUILD_TYPE}} --target SymDBHelper | ||
|
||
- name: Copy Release | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
run: | | ||
cd Scripts | ||
./CopyRelease.cmd action | ||
shell: cmd | ||
|
||
- name: Move PDB to path | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} | ||
run: | | ||
mkdir PDB | ||
cp x64/Release/*.pdb PDB | ||
shell: bash | ||
|
||
- name: Upload LiteLoader | ||
uses: actions/[email protected] | ||
with: | ||
name: LiteLoader | ||
path: ${{ github.workspace }}\RELEASE\ | ||
path: ${{ github.workspace }}\build\output\ | ||
|
||
- name: Upload PDB | ||
uses: actions/[email protected] | ||
with: | ||
name: PDB | ||
path: ${{ github.workspace }}\PDB | ||
path: ${{ github.workspace }}\build\pdb\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,19 @@ | ||
x64/ | ||
**/.vs/ | ||
**/x64/ | ||
**/*.user | ||
**/.vscode/ | ||
# Visual Studio related | ||
/.vs/ | ||
/CMakeSettings.json | ||
|
||
**/bedrock_server_api.lib | ||
**/bedrock_server_var.lib | ||
**/SymDB_DelayLoadHelper.lib | ||
LiteLoader/Lib/SymDBHelper.lib | ||
**/*.lastcodeanalysissucceeded | ||
*.zip | ||
|
||
/LiteLoader/out/ | ||
LiteLoaderSDK/ | ||
|
||
RELEASE/*.dll | ||
RELEASE/LLPeEditor.exe | ||
!RELEASE/ChakraCore.dll | ||
RELEASE/plugins/LiteLoader/LiteLoader.*.dll | ||
RELEASE/plugins/LiteLoader/LiteLoader.*.pdb | ||
RELEASE/plugins/LiteLoader/pdb | ||
!RELEASE/plugins/LiteLoader/CrashLogger.dll | ||
# Visual Studio Code related | ||
/.vscode/ | ||
|
||
# Idea related | ||
.idea/** | ||
!.idea/cmake.xml | ||
|
||
cmake-build-release/ | ||
/out | ||
LiteLoader/Lib/Demangler.pdb | ||
LiteLoader/Lib/Demangler.lib | ||
|
||
# Build related | ||
/build | ||
**/Directory.build.props | ||
RELEASE/plugins/lib/BaseLib.js | ||
RELEASE/plugins/lib/BaseLib.lua | ||
**/bedrock_server_api.lib | ||
**/bedrock_server_var.lib | ||
|
||
# Misc | ||
LiteLoaderSDK/ | ||
/output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "RELEASE/plugins/LiteLoader/ResourcePacks/LiteLoaderBDS-CUI"] | ||
path = RELEASE/plugins/LiteLoader/ResourcePacks/LiteLoaderBDS-CUI | ||
[submodule "assets/plugins/LiteLoader/ResourcePacks/LiteLoaderBDS-CUI"] | ||
path = assets/plugins/LiteLoader/ResourcePacks/LiteLoaderBDS-CUI | ||
url = https://github.com/OEOTYAN/LiteLoaderBDS-CUI.git |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
add_custom_target( | ||
CleanOutput | ||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/output | ||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/pdb | ||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/sdk | ||
COMMENT "Cleaning output/pdb/sdk directory" | ||
VERBATIM | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/pdb) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/output) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/output/plugins/LiteLoader/) | ||
|
||
add_custom_target(PackOutput) | ||
|
||
# Copy assets to output after build all. | ||
add_custom_command( | ||
TARGET PackOutput POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/assets ${CMAKE_BINARY_DIR}/output/ | ||
COMMENT "Copying assets to output" | ||
VERBATIM | ||
) | ||
|
||
# Copy ScriptEngine BaseLib to output after build all. | ||
add_custom_command( | ||
TARGET PackOutput POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/ScriptEngine/BaseLib ${CMAKE_BINARY_DIR}/output/plugins/lib/ | ||
COMMENT "Copying ScriptEngine BaseLib to output" | ||
VERBATIM | ||
) | ||
|
||
# Copy LLPeEditor to output after build all. | ||
add_custom_command( | ||
TARGET PackOutput POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/LLPeEditor.exe ${CMAKE_BINARY_DIR}/output/ | ||
COMMENT "Copying LLPeEditor to output" | ||
VERBATIM | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/sdk) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/sdk/Tools) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/sdk/Lib) | ||
|
||
add_custom_target(PackSDK) | ||
|
||
add_custom_command( | ||
TARGET PackSDK POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LiteLoader_SOURCE_DIR}/Header ${CMAKE_BINARY_DIR}/sdk/Header | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/LibraryBuilder.exe ${CMAKE_BINARY_DIR}/sdk/Tools/ | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/LLPeEditor.exe ${CMAKE_BINARY_DIR}/sdk/Tools/ | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/SDK-submodule-add.cmd ${CMAKE_BINARY_DIR}/sdk/Tools/ | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/SDK-submodule-update.cmd ${CMAKE_BINARY_DIR}/sdk/Tools/ | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/SDK-subtree.cmd ${CMAKE_BINARY_DIR}/sdk/Tools/ | ||
COMMENT "Copying SDK files" | ||
VERBATIM | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.