Skip to content

Commit 41c148e

Browse files
committed
[VERSION] 1.0.0-beta
0 parents  commit 41c148e

124 files changed

Lines changed: 11456 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build and Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
Build:
13+
permissions:
14+
contents: read
15+
strategy:
16+
matrix:
17+
os: [windows-latest, windows-11-arm]
18+
platform: [x64, x86, ARM64, ARM64EC]
19+
config: [Debug, Release]
20+
fail-fast: false
21+
runs-on: ${{matrix.os}}
22+
steps:
23+
- name: Source checkout
24+
uses: actions/checkout@main
25+
with:
26+
submodules: recursive
27+
- name: Prepare MSBuild
28+
uses: microsoft/setup-msbuild@main
29+
- name: Build
30+
run: msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} /p:RestorePackagesConfig=true
31+
- name: Run Unit Test
32+
if: ${{(matrix.os == 'windows-latest' && (matrix.platform == 'x64' || matrix.platform == 'x86') || matrix.os == 'windows-11-arm')}}
33+
run: .\Source\OutDir\${{matrix.platform}}\${{matrix.config}}\Test.exe -Run
34+
Publish:
35+
if: ${{github.base_ref == '' && startsWith(github.event.head_commit.message, '[VERSION] ')}}
36+
needs: Build
37+
permissions:
38+
contents: write
39+
runs-on: windows-latest
40+
steps:
41+
- name: Set release version
42+
id: relver
43+
shell: pwsh
44+
run: |
45+
$relver="${{github.event.head_commit.message}}".Substring(10)
46+
Write-Output "relver=$relver">>$env:GITHUB_OUTPUT
47+
- name: Source checkout
48+
uses: actions/checkout@main
49+
with:
50+
submodules: recursive
51+
- name: Prepare MSBuild
52+
uses: microsoft/setup-msbuild@main
53+
- name: Build
54+
run: |
55+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Release /p:Platform=x64 /p:RestorePackagesConfig=true
56+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Release /p:Platform=x86 /p:RestorePackagesConfig=true
57+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Release /p:Platform=ARM64 /p:RestorePackagesConfig=true
58+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Release /p:Platform=ARM64EC /p:RestorePackagesConfig=true
59+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Debug /p:Platform=x64 /p:RestorePackagesConfig=true
60+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Debug /p:Platform=x86 /p:RestorePackagesConfig=true
61+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Debug /p:Platform=ARM64 /p:RestorePackagesConfig=true
62+
msbuild .\Source\KNSoft.MakeLifeEasier.sln /restore /m /p:Configuration=Debug /p:Platform=ARM64EC /p:RestorePackagesConfig=true
63+
- name: Run Unit Test
64+
run: |
65+
.\Source\OutDir\x64\Release\Test.exe -Run
66+
.\Source\OutDir\x86\Release\Test.exe -Run
67+
.\Source\OutDir\x64\Debug\Test.exe -Run
68+
.\Source\OutDir\x86\Debug\Test.exe -Run
69+
- name: Create NuGet package
70+
run: |
71+
cd .\Source
72+
nuget pack
73+
- name: Create release
74+
uses: softprops/action-gh-release@v2
75+
with:
76+
name: v${{steps.relver.outputs.relver}}
77+
tag_name: v${{steps.relver.outputs.relver}}
78+
body: "(TO BE FILLED BY MAINTAINER)\n**NuGet Package**: https://www.nuget.org/packages/KNSoft.MakeLifeEasier/${{steps.relver.outputs.relver}}"
79+
prerelease: true
80+
preserve_order: true
81+
fail_on_unmatched_files: true
82+
generate_release_notes: true
83+
files: ./Source/KNSoft.MakeLifeEasier.${{steps.relver.outputs.relver}}.nupkg

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) KNSoft.org
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# KNSoft.MakeLifeEasier

Source/.editorconfig

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
root = true
2+
3+
[*.{inc,mac,asm,s}]
4+
5+
charset = utf-8
6+
7+
# Visual Studio generated .editorconfig file with C++ settings.
8+
9+
[*.{c,c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
10+
11+
charset = utf-8-bom
12+
indent_style = spaces
13+
indent_size = 4
14+
tab_width= 4
15+
end_of_line = crlf
16+
insert_final_newline = true
17+
max_line_length = 120
18+
19+
# Visual C++ Code Style settings
20+
21+
cpp_generate_documentation_comments = xml
22+
23+
# Visual C++ Formatting settings
24+
25+
cpp_indent_braces = false
26+
cpp_indent_multi_line_relative_to = innermost_parenthesis
27+
cpp_indent_within_parentheses = align_to_parenthesis
28+
cpp_indent_preserve_within_parentheses = false
29+
cpp_indent_case_contents = true
30+
cpp_indent_case_labels = true
31+
cpp_indent_case_contents_when_block = false
32+
cpp_indent_lambda_braces_when_parameter = false
33+
cpp_indent_goto_labels = leftmost_column
34+
cpp_indent_preprocessor = leftmost_column
35+
cpp_indent_access_specifiers = false
36+
cpp_indent_namespace_contents = true
37+
cpp_indent_preserve_comments = true
38+
cpp_new_line_before_open_brace_namespace = new_line
39+
cpp_new_line_before_open_brace_type = new_line
40+
cpp_new_line_before_open_brace_function = new_line
41+
cpp_new_line_before_open_brace_block = new_line
42+
cpp_new_line_before_open_brace_lambda = new_line
43+
cpp_new_line_scope_braces_on_separate_lines = true
44+
cpp_new_line_close_brace_same_line_empty_type = true
45+
cpp_new_line_close_brace_same_line_empty_function = true
46+
cpp_new_line_before_catch = false
47+
cpp_new_line_before_else = false
48+
cpp_new_line_before_while_in_do_while = false
49+
cpp_space_before_function_open_parenthesis = remove
50+
cpp_space_within_parameter_list_parentheses = false
51+
cpp_space_between_empty_parameter_list_parentheses = false
52+
cpp_space_after_keywords_in_control_flow_statements = true
53+
cpp_space_within_control_flow_statement_parentheses = false
54+
cpp_space_before_lambda_open_parenthesis = false
55+
cpp_space_within_cast_parentheses = false
56+
cpp_space_after_cast_close_parenthesis = false
57+
cpp_space_within_expression_parentheses = false
58+
cpp_space_before_block_open_brace = true
59+
cpp_space_between_empty_braces = false
60+
cpp_space_before_initializer_list_open_brace = false
61+
cpp_space_within_initializer_list_braces = true
62+
cpp_space_preserve_in_initializer_list = true
63+
cpp_space_before_open_square_bracket = false
64+
cpp_space_within_square_brackets = false
65+
cpp_space_before_empty_square_brackets = false
66+
cpp_space_between_empty_square_brackets = false
67+
cpp_space_group_square_brackets = true
68+
cpp_space_within_lambda_brackets = false
69+
cpp_space_between_empty_lambda_brackets = false
70+
cpp_space_before_comma = false
71+
cpp_space_after_comma = true
72+
cpp_space_remove_around_member_operators = true
73+
cpp_space_before_inheritance_colon = true
74+
cpp_space_before_constructor_colon = true
75+
cpp_space_remove_before_semicolon = true
76+
cpp_space_after_semicolon = true
77+
cpp_space_remove_around_unary_operator = true
78+
cpp_space_around_binary_operator = insert
79+
cpp_space_around_assignment_operator = insert
80+
cpp_space_pointer_reference_alignment = ignore
81+
cpp_space_around_ternary_operator = insert
82+
cpp_use_unreal_engine_macro_formatting = false
83+
cpp_wrap_preserve_blocks = never
84+
85+
# Visual C++ Include Cleanup settings
86+
87+
cpp_include_cleanup_add_missing_error_tag_type = suggestion
88+
cpp_include_cleanup_remove_unused_error_tag_type = dimmed
89+
cpp_include_cleanup_optimize_unused_error_tag_type = suggestion
90+
cpp_include_cleanup_sort_after_edits = false
91+
cpp_sort_includes_error_tag_type = none
92+
cpp_sort_includes_priority_case_sensitive = false
93+
cpp_sort_includes_priority_style = quoted
94+
cpp_includes_style = default
95+
cpp_includes_use_forward_slash = true

Source/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.vs
2+
*.user
3+
*.aps
4+
5+
/packages
6+
/OutDir
7+
IntDir
8+
9+
/*.nupkg
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<Project>
2+
<!-- [Overwrite defaults] -->
3+
4+
<!-- Use the latest installed Windows SDK -->
5+
<PropertyGroup Label="Globals">
6+
<WindowsTargetPlatformVersion>$(_LatestWindowsTargetPlatformVersion)</WindowsTargetPlatformVersion>
7+
</PropertyGroup>
8+
9+
<!-- Add $(OutDir) to library path -->
10+
<PropertyGroup>
11+
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
12+
</PropertyGroup>
13+
14+
<!-- [Predefined macros and MSBuild variables addendum] -->
15+
16+
<!-- $(KnsoftPredefined) includes addendum predefined macros for CL, MASM, and MARMASM -->
17+
<PropertyGroup>
18+
<KnsoftPredefined>_KNSOFT_</KnsoftPredefined>
19+
</PropertyGroup>
20+
21+
<!-- Add some MSBuild variables to $(KnsoftPredefined) -->
22+
<PropertyGroup Condition="'$(ConfigurationType)' == 'Application'">
23+
<KnsoftPredefined>MSBUILD_CONFIGURATION_TYPE_EXE;$(KnsoftPredefined)</KnsoftPredefined>
24+
</PropertyGroup>
25+
<PropertyGroup Condition="'$(ConfigurationType)' == 'DynamicLibrary'">
26+
<KnsoftPredefined>MSBUILD_CONFIGURATION_TYPE_DLL;$(KnsoftPredefined)</KnsoftPredefined>
27+
</PropertyGroup>
28+
<PropertyGroup Condition="'$(ConfigurationType)' == 'StaticLibrary'">
29+
<KnsoftPredefined>MSBUILD_CONFIGURATION_TYPE_LIB;$(KnsoftPredefined)</KnsoftPredefined>
30+
</PropertyGroup>
31+
<PropertyGroup>
32+
<KnsoftPredefined>MSBUILD_SOLUTION_NAME="$(SolutionName)";$(KnsoftPredefined)</KnsoftPredefined>
33+
<KnsoftPredefined>MSBUILD_PROJECT_NAME="$(ProjectName)";$(KnsoftPredefined)</KnsoftPredefined>
34+
<KnsoftPredefined>MSBUILD_CONFIGURATION="$(Configuration)";$(KnsoftPredefined)</KnsoftPredefined>
35+
<KnsoftPredefined>MSBUILD_PLATFORM="$(Platform)";$(KnsoftPredefined)</KnsoftPredefined>
36+
<KnsoftPredefined>MSBUILD_PLATFORM_TOOLSET="$(PlatformToolset)";$(KnsoftPredefined)</KnsoftPredefined>
37+
<KnsoftPredefined>MSBUILD_PLATFORM_TOOLSET_VERSION="$(PlatformToolsetVersion)";$(KnsoftPredefined)</KnsoftPredefined>
38+
<KnsoftPredefined>MSBUILD_TARGET_PLATFORM="$(KnsoftArch)";$(KnsoftPredefined)</KnsoftPredefined>
39+
<KnsoftPredefined>MSBUILD_TARGET_PLATFORM_VERSION="$(TargetPlatformVersion)";$(KnsoftPredefined)</KnsoftPredefined>
40+
<KnsoftPredefined>MSBUILD_VERSION="$(MSBuildVersion)";$(KnsoftPredefined)</KnsoftPredefined>
41+
<KnsoftPredefined>MSBUILD_VCTOOLS_VERSION="$(VCToolsVersion)";$(KnsoftPredefined)</KnsoftPredefined>
42+
</PropertyGroup>
43+
44+
<!-- $(KnsoftAsmPredefined) includes $(KnsoftPredefined) and some CL definitions for MASM and MARMASM -->
45+
<PropertyGroup>
46+
<KnsoftAsmPredefined>$(KnsoftPredefined)</KnsoftAsmPredefined>
47+
<KnsoftAsmPredefined Condition="$(Configuration.Contains(`Debug`))">_DEBUG=1;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
48+
<KnsoftAsmPredefined Condition="$(Configuration.Contains(`Release`))">NDEBUG=1;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
49+
<KnsoftAsmPredefined Condition="'$(Platform)' == 'x64' Or '$(Platform)' == 'ARM64EC'">_M_X64=100;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
50+
<KnsoftAsmPredefined Condition="'$(Platform)' == 'Win32'">_M_IX86=600;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
51+
<KnsoftAsmPredefined Condition="'$(Platform)' == 'ARM64'">_M_ARM64=1;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
52+
<KnsoftAsmPredefined Condition="'$(Platform)' == 'ARM64EC'">_M_ARM64EC=1;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
53+
<KnsoftAsmPredefined Condition="'$(Platform)' == 'ARM'">_M_ARM=7;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
54+
<KnsoftAsmPredefined Condition="'$(Platform)' == 'x64' Or '$(Platform)' == 'ARM64' Or '$(Platform)' == 'ARM64EC'">_WIN64=1;$(KnsoftAsmPredefined)</KnsoftAsmPredefined>
55+
</PropertyGroup>
56+
57+
<!-- Apply predefined macros -->
58+
<ItemDefinitionGroup>
59+
<ClCompile>
60+
<PreprocessorDefinitions>$(KnsoftPredefined);%(PreprocessorDefinitions)</PreprocessorDefinitions>
61+
</ClCompile>
62+
<MASM>
63+
<PreprocessorDefinitions>$(KnsoftAsmPredefined);%(PreprocessorDefinitions)</PreprocessorDefinitions>
64+
</MASM>
65+
<MARMASM>
66+
<PreprocessorDefinitions>$(KnsoftAsmPredefined);%(PreprocessorDefinitions)</PreprocessorDefinitions>
67+
</MARMASM>
68+
</ItemDefinitionGroup>
69+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project>
2+
<!-- [Overwrite defaults] -->
3+
<PropertyGroup>
4+
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
5+
<OutDir>$(SolutionDir)OutDir\$(KnsoftArch)\$(Configuration)\</OutDir>
6+
<IntDir>IntDir\$(KnsoftArch)\$(Configuration)\</IntDir>
7+
</PropertyGroup>
8+
<PropertyGroup Label="Configuration">
9+
<CharacterSet>Unicode</CharacterSet>
10+
</PropertyGroup>
11+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" Label="Configuration">
12+
<UseDebugLibraries>true</UseDebugLibraries>
13+
</PropertyGroup>
14+
</Project>

Source/Directory.Build.props

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<Project>
2+
3+
<!-- [Addendum variables] -->
4+
5+
<!-- $(KnsoftArch) equals to the default solution configuration names (Win32 -> x86) -->
6+
<PropertyGroup Condition="'$(Platform)' != 'Win32'">
7+
<KnsoftArch>$(Platform)</KnsoftArch>
8+
</PropertyGroup>
9+
<PropertyGroup Condition="'$(Platform)' == 'Win32'">
10+
<KnsoftArch>x86</KnsoftArch>
11+
</PropertyGroup>
12+
13+
<!-- [Overwrite defaults] -->
14+
15+
<!-- Recommended defaults and support for source files with the same name -->
16+
<ItemDefinitionGroup>
17+
<ClCompile>
18+
<WarningLevel>Level3</WarningLevel>
19+
<LanguageStandard>stdcpplatest</LanguageStandard>
20+
<LanguageStandard_C>stdclatest</LanguageStandard_C>
21+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
22+
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
23+
</ClCompile>
24+
<Link>
25+
<GenerateDebugInformation>true</GenerateDebugInformation>
26+
</Link>
27+
<MASM>
28+
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
29+
</MASM>
30+
<!-- FIXME: CL preprocessor may break this
31+
<MARMASM>
32+
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
33+
</MARMASM>
34+
-->
35+
</ItemDefinitionGroup>
36+
37+
<!-- Enable Safe SEH for MASM Release x86, as well as CL default -->
38+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'">
39+
<MASM>
40+
<UseSafeExceptionHandlers>true</UseSafeExceptionHandlers>
41+
</MASM>
42+
</ItemDefinitionGroup>
43+
44+
<!-- Use static runtime libraries -->
45+
<ItemDefinitionGroup Condition="'$(Configuration)' == 'Release'">
46+
<ClCompile>
47+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
48+
</ClCompile>
49+
</ItemDefinitionGroup>
50+
<ItemDefinitionGroup Condition="'$(Configuration)' == 'Debug'">
51+
<ClCompile>
52+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
53+
</ClCompile>
54+
</ItemDefinitionGroup>
55+
56+
<!-- Include ntdll.lib by default -->
57+
<ItemDefinitionGroup>
58+
<Link>
59+
<AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
60+
</Link>
61+
</ItemDefinitionGroup>
62+
63+
<!-- Disable LTCG and ignore default libraries for LIB -->
64+
<ItemDefinitionGroup Condition="'$(ConfigurationType)' == 'StaticLibrary'">
65+
<Lib>
66+
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
67+
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
68+
</Lib>
69+
</ItemDefinitionGroup>
70+
71+
<!-- [Customize builds] -->
72+
73+
<!-- Import some sheets before or after Microsoft.Cpp.* files -->
74+
<PropertyGroup>
75+
<ForceImportAfterCppDefaultProps>$(MsbuildThisFileDirectory)\Directory.Build.AfterCppDefault.props</ForceImportAfterCppDefaultProps>
76+
<ForceImportAfterCppProps>$(MsbuildThisFileDirectory)\Directory.Build.AfterCpp.props</ForceImportAfterCppProps>
77+
</PropertyGroup>
78+
79+
<!-- Import $(MSBuildProjectName).Build.(props/targets) if exists -->
80+
<Import Project="$(MSBuildProjectDirectory)\$(MSBuildProjectName).Build.props" Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).Build.props')"/>
81+
<Import Project="$(MSBuildProjectDirectory)\$(MSBuildProjectName).Build.targets" Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).Build.targets')"/>
82+
83+
<!-- Import outer Directory.Build.props if exists -->
84+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" Condition="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')) != ''" />
85+
86+
</Project>

0 commit comments

Comments
 (0)