mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
Compare commits
54
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9d7c8fc41 | ||
|
|
f28c98e274 | ||
|
|
11dafd063b | ||
|
|
b0688f81b9 | ||
|
|
eaae1e44c9 | ||
|
|
0cb5771762 | ||
|
|
5ca1a76ff8 | ||
|
|
a03d95fef4 | ||
|
|
a835d167b2 | ||
|
|
bd4f529078 | ||
|
|
6b1b8ef6ea | ||
|
|
6cee3f2411 | ||
|
|
80618cd3e1 | ||
|
|
5ff7221b80 | ||
|
|
144548aef5 | ||
|
|
cdc666a1d5 | ||
|
|
2816871e93 | ||
|
|
1b05181858 | ||
|
|
b2eae1bd23 | ||
|
|
13ed5bcd26 | ||
|
|
29eb8a7598 | ||
|
|
7e08ce29c0 | ||
|
|
9fdf00417b | ||
|
|
ac15674069 | ||
|
|
b31d41b539 | ||
|
|
09886da058 | ||
|
|
e03ea3854d | ||
|
|
fe710715aa | ||
|
|
d7061cc18c | ||
|
|
e935d9adde | ||
|
|
d0913d07d3 | ||
|
|
6b51c170c1 | ||
|
|
a4213dd4c6 | ||
|
|
9ebabacc32 | ||
|
|
70983cb2e7 | ||
|
|
d61079e1f6 | ||
|
|
76e8c56235 | ||
|
|
10db7fe1a5 | ||
|
|
8afb96c229 | ||
|
|
66539d7f1f | ||
|
|
5f7c5eb1a2 | ||
|
|
886dadfedb | ||
|
|
66daf5054b | ||
|
|
9aec5a70a8 | ||
|
|
42aef59f9e | ||
|
|
7d1fdce8b5 | ||
|
|
45508c3d99 | ||
|
|
5cb43da0e5 | ||
|
|
858662e225 | ||
|
|
a30dd8399b | ||
|
|
3e4b31aebb | ||
|
|
e3401732c1 | ||
|
|
6284f7869f | ||
|
|
95fa410e45 |
@@ -0,0 +1 @@
|
|||||||
|
d0913d07d33929d7b753a3a09a0dac70e5befbc1
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
name: Build Mob
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build Mob
|
||||||
|
shell: pwsh
|
||||||
|
run: ./bootstrap.ps1 -Verbose
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: Lint Mob
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Check format
|
||||||
|
uses: ModOrganizer2/check-formatting-action@master
|
||||||
|
with:
|
||||||
|
check-path: "."
|
||||||
|
exclude-regex: "third-party"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
project(mob)
|
||||||
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT mob)
|
||||||
+21
-6
@@ -1,8 +1,20 @@
|
|||||||
|
param(
|
||||||
|
[switch]
|
||||||
|
$Verbose,
|
||||||
|
[ValidateSet("Debug", "RelWithDebInfo", "Release")]
|
||||||
|
[string]
|
||||||
|
$Config = "Release"
|
||||||
|
)
|
||||||
|
|
||||||
$root = $PSScriptRoot
|
$root = $PSScriptRoot
|
||||||
if (!$root) {
|
if (!$root) {
|
||||||
$root = "."
|
$root = "."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$output = if ($Verbose) { "Out-Default" } else { "Out-Null" }
|
||||||
|
|
||||||
|
cmake -B $root/build $root | & $output
|
||||||
|
|
||||||
$installationPath = & $root\third-party\bin\vswhere.exe -products * -nologo -prerelease -latest -property installationPath
|
$installationPath = & $root\third-party\bin\vswhere.exe -products * -nologo -prerelease -latest -property installationPath
|
||||||
if (! $?) {
|
if (! $?) {
|
||||||
Write-Error "vswhere returned $LastExitCode"
|
Write-Error "vswhere returned $LastExitCode"
|
||||||
@@ -15,13 +27,16 @@ if (! $installationPath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$opts = ""
|
$opts = ""
|
||||||
$opts += " $root\vs\mob.sln"
|
$opts += " $root\build\mob.sln"
|
||||||
$opts += " -m"
|
$opts += " -m"
|
||||||
$opts += " -p:Configuration=Release"
|
$opts += " -p:Configuration=${Config}"
|
||||||
$opts += " -noLogo"
|
$opts += " -noLogo"
|
||||||
$opts += " -p:UseMultiToolTask=true"
|
$opts += " -p:UseMultiToolTask=true"
|
||||||
$opts += " -p:EnforceProcessCountAcrossBuilds=true"
|
$opts += " -p:EnforceProcessCountAcrossBuilds=true"
|
||||||
$opts += " -clp:ErrorsOnly;Verbosity=minimal"
|
|
||||||
|
if (!$Verbose) {
|
||||||
|
$opts += " -clp:ErrorsOnly;Verbosity=minimal"
|
||||||
|
}
|
||||||
|
|
||||||
$vsDevCmd = "$installationPath\Common7\Tools\VsDevCmd.bat"
|
$vsDevCmd = "$installationPath\Common7\Tools\VsDevCmd.bat"
|
||||||
if (!(Test-Path "$vsDevCmd")) {
|
if (!(Test-Path "$vsDevCmd")) {
|
||||||
@@ -36,5 +51,5 @@ if (! $?) {
|
|||||||
exit $LastExitCode
|
exit $LastExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
Copy-Item "$root\build\Release\x64\mob.exe" "$root\mob.exe"
|
Copy-Item "$root\build\src\${Config}\mob.exe" "$root\mob.exe"
|
||||||
echo "run ``.\mob -d prefix/path build`` to start building"
|
Write-Output "run ``.\mob -d prefix/path build`` to start building"
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) Matthias Moeller 2016 m_moeller@live.de
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
+170
-118
@@ -1,125 +1,177 @@
|
|||||||
|
|
||||||
LICENSE ISSUES
|
Apache License
|
||||||
==============
|
Version 2.0, January 2004
|
||||||
|
https://www.apache.org/licenses/
|
||||||
|
|
||||||
The OpenSSL toolkit stays under a double license, i.e. both the conditions of
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
the OpenSSL License and the original SSLeay license apply to the toolkit.
|
|
||||||
See below for the actual license texts.
|
|
||||||
|
|
||||||
OpenSSL License
|
1. Definitions.
|
||||||
---------------
|
|
||||||
|
|
||||||
/* ====================================================================
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
* Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved.
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in
|
|
||||||
* the documentation and/or other materials provided with the
|
|
||||||
* distribution.
|
|
||||||
*
|
|
||||||
* 3. All advertising materials mentioning features or use of this
|
|
||||||
* software must display the following acknowledgment:
|
|
||||||
* "This product includes software developed by the OpenSSL Project
|
|
||||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
|
||||||
*
|
|
||||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
|
||||||
* endorse or promote products derived from this software without
|
|
||||||
* prior written permission. For written permission, please contact
|
|
||||||
* openssl-core@openssl.org.
|
|
||||||
*
|
|
||||||
* 5. Products derived from this software may not be called "OpenSSL"
|
|
||||||
* nor may "OpenSSL" appear in their names without prior written
|
|
||||||
* permission of the OpenSSL Project.
|
|
||||||
*
|
|
||||||
* 6. Redistributions of any form whatsoever must retain the following
|
|
||||||
* acknowledgment:
|
|
||||||
* "This product includes software developed by the OpenSSL Project
|
|
||||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
|
||||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
|
||||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
||||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
* ====================================================================
|
|
||||||
*
|
|
||||||
* This product includes cryptographic software written by Eric Young
|
|
||||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
|
||||||
* Hudson (tjh@cryptsoft.com).
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
Original SSLeay License
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
-----------------------
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
* All rights reserved.
|
other entities that control, are controlled by, or are under common
|
||||||
*
|
control with that entity. For the purposes of this definition,
|
||||||
* This package is an SSL implementation written
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
* by Eric Young (eay@cryptsoft.com).
|
direction or management of such entity, whether by contract or
|
||||||
* The implementation was written so as to conform with Netscapes SSL.
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
*
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
* This library is free for commercial and non-commercial use as long as
|
|
||||||
* the following conditions are aheared to. The following conditions
|
|
||||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
|
||||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
|
||||||
* included with this distribution is covered by the same copyright terms
|
|
||||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
|
||||||
*
|
|
||||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
|
||||||
* the code are not to be removed.
|
|
||||||
* If this package is used in a product, Eric Young should be given attribution
|
|
||||||
* as the author of the parts of the library used.
|
|
||||||
* This can be in the form of a textual message at program startup or
|
|
||||||
* in documentation (online or textual) provided with the package.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
|
||||||
* must display the following acknowledgement:
|
|
||||||
* "This product includes cryptographic software written by
|
|
||||||
* Eric Young (eay@cryptsoft.com)"
|
|
||||||
* The word 'cryptographic' can be left out if the rouines from the library
|
|
||||||
* being used are not cryptographic related :-).
|
|
||||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
|
||||||
* the apps directory (application code) you must include an acknowledgement:
|
|
||||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* The licence and distribution terms for any publically available version or
|
|
||||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
|
||||||
* copied and put under another distribution licence
|
|
||||||
* [including the GNU Public Licence.]
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|||||||
@@ -21,10 +21,6 @@ host =
|
|||||||
super = cmake_common modorganizer* githubpp
|
super = cmake_common modorganizer* githubpp
|
||||||
plugins = check_fnis bsapacker bsa_extractor diagnose_basic installer_* plugin_python preview_base preview_bsa tool_* game_*
|
plugins = check_fnis bsapacker bsa_extractor diagnose_basic installer_* plugin_python preview_base preview_bsa tool_* game_*
|
||||||
|
|
||||||
[translations]
|
|
||||||
mo2-translations = organizer
|
|
||||||
mo2-game-bethesda = game_creation game_enderal game_enderalse game_fallout3 game_fallout4 game_fallout4vr game_falloutNV game_gamebryo game_morrowind game_nehrim game_oblivion game_skyrim game_skyrimse game_skyrimvr game_ttw
|
|
||||||
|
|
||||||
[task]
|
[task]
|
||||||
enabled = true
|
enabled = true
|
||||||
mo_org = ModOrganizer2
|
mo_org = ModOrganizer2
|
||||||
@@ -100,38 +96,39 @@ vs = 17
|
|||||||
vs_year = 2022
|
vs_year = 2022
|
||||||
vs_toolset = 14.3
|
vs_toolset = 14.3
|
||||||
sdk = 10.0.22621.0
|
sdk = 10.0.22621.0
|
||||||
sevenz = 23.01
|
sevenz = 24.05
|
||||||
boost = 1.82.0
|
boost = 1.85.0
|
||||||
boost_vs = 14.3
|
boost_vs = 14.3
|
||||||
fmt = 8.1.1
|
fmt = 10.2.1
|
||||||
gtest = main
|
gtest = main
|
||||||
libloot = 0.19.4
|
libloot = 0.22.4
|
||||||
lz4 = v1.9.4
|
lz4 = v1.9.4
|
||||||
nmm = 0.71.2
|
nmm = 0.71.2
|
||||||
openssl = 1.1.1u
|
openssl = 3.3.0
|
||||||
pyqt = 6.5.1
|
pyqt = 6.7.0
|
||||||
pyqt_builder = 1.15.1
|
pyqt_builder = 1.16.2
|
||||||
pyqt_sip = 13.5.1
|
pyqt_sip = 13.7.0
|
||||||
python = v3.10.12
|
python = v3.12.3
|
||||||
pybind11 = v2.10.4
|
pybind11 = v2.12.0
|
||||||
bzip2 = 1.0.8
|
bzip2 = 1.0.8
|
||||||
sip = 6.7.1
|
sip = 6.8.3
|
||||||
spdlog = v1.10.0
|
spdlog = v1.14.1
|
||||||
qt = 6.5.1
|
qt = 6.7.0
|
||||||
qt_vs = 2019
|
qt_vs = 2019
|
||||||
zlib = v1.2.13
|
zlib = v1.3.1
|
||||||
libbsarch = 0.0.9
|
libbsarch = 0.0.9
|
||||||
usvfs = qt6
|
usvfs = qt6
|
||||||
explorerpp = 1.3.5
|
explorerpp = 1.4.0
|
||||||
|
|
||||||
ss_paper_lad_6788 = 7.0
|
ss_paper_lad_6788 = 7.2
|
||||||
ss_paper_automata_6788 = 3.0
|
ss_paper_automata_6788 = 3.2
|
||||||
ss_paper_mono_6788 = 2.2
|
ss_paper_mono_6788 = 3.2
|
||||||
ss_dark_mode_1809_6788 = 3.0
|
ss_dark_mode_1809_6788 = 3.0
|
||||||
ss_morrowind_trosski = 1.1
|
ss_morrowind_trosski = 1.1
|
||||||
ss_skyrim_trosski = v1.1
|
ss_skyrim_trosski = v1.1
|
||||||
ss_fallout3_trosski = v1.1
|
ss_starfield_trosski = V1.11
|
||||||
ss_fallout4_trosski = v1.1
|
ss_fallout3_trosski = v1.11
|
||||||
|
ss_fallout4_trosski = v1.11
|
||||||
|
|
||||||
[paths]
|
[paths]
|
||||||
third_party =
|
third_party =
|
||||||
@@ -148,10 +145,10 @@ install_pdbs =
|
|||||||
install_dlls =
|
install_dlls =
|
||||||
install_loot =
|
install_loot =
|
||||||
install_plugins =
|
install_plugins =
|
||||||
install_extensions =
|
|
||||||
install_stylesheets =
|
install_stylesheets =
|
||||||
install_licenses =
|
install_licenses =
|
||||||
install_pythoncore =
|
install_pythoncore =
|
||||||
|
install_translations =
|
||||||
vs =
|
vs =
|
||||||
qt_install =
|
qt_install =
|
||||||
qt_bin =
|
qt_bin =
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
--- publish.bat Thu Apr 30 00:08:44 2020
|
|
||||||
+++ publish.bat Thu Apr 30 00:08:14 2020
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
set _NMMPATH=%~dp0..\Nexus-Mod-Manager
|
|
||||||
set _NMMCLIPATH=%~dp0
|
|
||||||
-set outputPath=..\..\install\bin
|
|
||||||
+set outputPath=%~1
|
|
||||||
|
|
||||||
mkdir "%outputPath%\NCC"
|
|
||||||
copy "%_NMMPATH%\Stage\Release\AntlrUtil.dll" "%outputPath%\NCC"
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
--- PCbuild/openssl.props (revision 5c02a39a0b31a330e06b4d6f44835afb205dc7cc)
|
--- PCbuild/openssl.props (revision 5c02a39a0b31a330e06b4d6f44835afb205dc7cc)
|
||||||
+++ PCbuild/openssl.props (date 1575994670797)
|
+++ PCbuild/openssl.props (date 1575994670797)
|
||||||
@@ -13,6 +13,7 @@
|
@@ -13,6 +13,7 @@
|
||||||
<_DLLSuffix>-1_1</_DLLSuffix>
|
<_DLLSuffix>-3</_DLLSuffix>
|
||||||
<_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
|
<_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
|
||||||
<_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
|
<_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
|
||||||
+ <_DLLSuffix Condition="$(Platform) == 'x64'">$(_DLLSuffix)-x64</_DLLSuffix>
|
+ <_DLLSuffix Condition="$(Platform) == 'x64'">$(_DLLSuffix)-x64</_DLLSuffix>
|
||||||
|
<OpenSSLDLLSuffix Condition="$(OpenSSLDLLSuffix) == ''">$(_DLLSuffix)</OpenSSLDLLSuffix>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
|
|
||||||
|
|||||||
@@ -25,26 +25,51 @@
|
|||||||
|
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
```
|
```powershell
|
||||||
> git clone https://github.com/ModOrganizer2/mob
|
> git clone https://github.com/ModOrganizer2/mob
|
||||||
> cd mob
|
> cd mob
|
||||||
> bootstrap
|
> bootstrap
|
||||||
> mob -d c:\somewhere build
|
> mob -d c:\somewhere build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Slow start
|
## Extended start
|
||||||
- Install Qt 6.5.1 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
|
|
||||||
|
### Qt - CLI based install using [aqt](https://github.com/miurahr/aqtinstall)
|
||||||
|
|
||||||
|
[aqt](https://github.com/miurahr/aqtinstall) is a CLI installer for Qt, it makes installing Qt extremely quick and painless, and doesn't require a login
|
||||||
|
|
||||||
|
#### Installing aqt via package manager
|
||||||
|
- Start an administrative terminal
|
||||||
|
- Install aqt using one of the two popular packaage managers
|
||||||
|
- `winget install --id=miurahr.aqtinstall -e`
|
||||||
|
- `choco install aqt`
|
||||||
|
|
||||||
|
#### Installing aqt via python/pip
|
||||||
|
|
||||||
|
- Install [Python 3.9](https://www.python.org/downloads/release/python-390/)
|
||||||
|
- Install [aqt](https://github.com/miurahr/aqtinstall) using `pip`
|
||||||
|
|
||||||
|
#### Using aqt
|
||||||
|
- Open a terminal with administrative rights, and run
|
||||||
|
```powershell
|
||||||
|
aqt install-qt --outputdir "C:\Qt" windows desktop 6.5.0 win64_msvc2019_64 -m qtwebengine qtimageformats qtpositioning qtserialport qtwebchannel qtwebsockets
|
||||||
|
```
|
||||||
|
|
||||||
|
### Qt - Manual installation
|
||||||
|
- Install Qt 6.5.0 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
|
||||||
- MSVC 2019 64-bit
|
- MSVC 2019 64-bit
|
||||||
- Additional Libraries:
|
- Additional Libraries:
|
||||||
- Qt WebEngine (display nexus pages)
|
- Qt WebEngine (display nexus pages)
|
||||||
- Qt Image Formats (display images in image tab and preview)
|
- Qt Image Formats (display images in image tab and preview)
|
||||||
- Qt Positioning (required by QtWebEngine)
|
- Qt Positioning (required by QtWebEngine)
|
||||||
- Qt Serial Port (required by Qt Core)
|
- Qt Serial Port (required by Qt Core)
|
||||||
- Qt Web Channel (required by QtWebEngine)
|
- Qt WebChannel (required by QtWebEngine)
|
||||||
- Qt WebSockets (Nexus api/download)
|
- Qt WebSockets (Nexus api/download)
|
||||||
- Optional:
|
- Optional:
|
||||||
- Qt Source Files
|
- Qt Source Files
|
||||||
- Qt Debug Files
|
- Qt Debug Files
|
||||||
|
|
||||||
|
### Visual Studio
|
||||||
- Install Visual Studio 2022 ([Installer](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030&passive=false))
|
- Install Visual Studio 2022 ([Installer](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030&passive=false))
|
||||||
- Desktop development with C++
|
- Desktop development with C++
|
||||||
- Desktop .NET desktop development (needed by OMOD and FOMOD installers)
|
- Desktop .NET desktop development (needed by OMOD and FOMOD installers)
|
||||||
@@ -56,22 +81,19 @@
|
|||||||
- C++ /CLI support for v143 build Tools (Latest) (for OMOD and FOMOD installers)
|
- C++ /CLI support for v143 build Tools (Latest) (for OMOD and FOMOD installers)
|
||||||
- Windows 11 SDK (get latest)
|
- Windows 11 SDK (get latest)
|
||||||
- C++ Build Tools core features
|
- C++ Build Tools core features
|
||||||
- Optional:
|
- Git for Windows (Skip if you have this already installed outside of the VS installer)
|
||||||
- Git for Windows (if you don't have git already installed)
|
- CMake tools for Windows (Skip if you have this already installed outside of the VS installer)
|
||||||
- Start a shell
|
|
||||||
- If you have git in your path, a regular cmd shell works.
|
|
||||||
- If not, start the _x64 Native Tools Command Prompt for VS 2019_, it'll use Git for Windows installed above.
|
|
||||||
- Do:
|
|
||||||
```
|
|
||||||
mkdir C:\dev
|
|
||||||
cd C:\dev
|
|
||||||
git clone https://github.com/ModOrganizer2/mob
|
|
||||||
cd mob
|
|
||||||
bootstrap
|
|
||||||
mob -d C:\dev\modorganizer build
|
|
||||||
```
|
|
||||||
- Once `mob` is finished, everything will be in `C:\dev\modorganizer`. Mod Organizer can be run from `install\bin\ModOrganizer.exe`. The Visual Studio solution for Mod Organizer itself is `build\modorganizer_super\modorganizer\vsbuild\organizer.sln`.
|
|
||||||
|
|
||||||
|
## Setting up MOB
|
||||||
|
- Open a shell. If you've installed Git or CMake through the VS installer, they won't be on your PATH, so you must use x64 Native Tools Command Prompt for VS 2022.- Pick a folder to develop MO2 in, for these steps it'll be `C:\dev`
|
||||||
|
- Execute these commands
|
||||||
|
```powershell
|
||||||
|
mkdir C:\dev
|
||||||
|
cd C:\dev
|
||||||
|
git clone https://github.com/ModOrganizer2/mob
|
||||||
|
mob -d C:\dev\modorganizer build
|
||||||
|
```
|
||||||
|
- Once `mob` is finished, everything will be in `C:\dev\modorganizer`. Mod Organizer can be run from `install\bin\ModOrganizer.exe`. The Visual Studio solution for Mod Organizer itself is `build\modorganizer_super\modorganizer\vsbuild\organizer.sln`.
|
||||||
|
|
||||||
### Prebuilts
|
### Prebuilts
|
||||||
Some third-parties are not normally built from source, but this can be changed in the options by setting the various tasks in `[prebuilt]` to `false`. If OpenSSL is built from source, perl is required ([Strawberry Perl 5.30.2.1 installer](http://strawberryperl.com/download/5.30.2.1/strawberry-perl-5.30.2.1-64bit.msi)).
|
Some third-parties are not normally built from source, but this can be changed in the options by setting the various tasks in `[prebuilt]` to `false`. If OpenSSL is built from source, perl is required ([Strawberry Perl 5.30.2.1 installer](http://strawberryperl.com/download/5.30.2.1/strawberry-perl-5.30.2.1-64bit.msi)).
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE source_files *.cpp)
|
||||||
|
file(GLOB_RECURSE header_files *.h)
|
||||||
|
|
||||||
|
add_executable(mob ${source_files} ${header_files})
|
||||||
|
set_target_properties(mob PROPERTIES CXX_STANDARD 20)
|
||||||
|
|
||||||
|
target_compile_definitions(mob PUBLIC NOMINMAX)
|
||||||
|
target_compile_options(mob PUBLIC "/MT")
|
||||||
|
target_include_directories(mob PUBLIC ${CMAKE_SOURCE_DIR}/third-party/include)
|
||||||
|
target_link_libraries(mob PUBLIC
|
||||||
|
wsock32 ws2_32 crypt32 wldap32 dbghelp shlwapi version
|
||||||
|
optimized ${CMAKE_SOURCE_DIR}/third-party/lib/libcurl.lib
|
||||||
|
debug ${CMAKE_SOURCE_DIR}/third-party/lib/libcurl-d.lib
|
||||||
|
optimized ${CMAKE_SOURCE_DIR}/third-party/lib/zlib.lib
|
||||||
|
debug ${CMAKE_SOURCE_DIR}/third-party/lib/zlibd.lib)
|
||||||
|
|
||||||
|
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
PREFIX src
|
||||||
|
FILES ${source_files} ${header_files})
|
||||||
|
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT mob)
|
||||||
+5
-8
@@ -122,7 +122,7 @@ namespace mob {
|
|||||||
git_wrap g(task->source_path());
|
git_wrap g(task->source_path());
|
||||||
|
|
||||||
g.fetch(task->git_url().string(),
|
g.fetch(task->git_url().string(),
|
||||||
fmt::format("pull/{}/head", pr.number));
|
std::format("pull/{}/head", pr.number));
|
||||||
|
|
||||||
g.checkout("FETCH_HEAD");
|
g.checkout("FETCH_HEAD");
|
||||||
}
|
}
|
||||||
@@ -208,13 +208,10 @@ namespace mob {
|
|||||||
{
|
{
|
||||||
nlohmann::json json;
|
nlohmann::json json;
|
||||||
|
|
||||||
constexpr auto* pattern =
|
constexpr auto* pattern = "https://api.github.com/search/issues?per_page=100&q="
|
||||||
"https://api.github.com/search/issues?per_page=100&q="
|
"is:pr+org:{0:}+author:{1:}+is:open+head:{2:}";
|
||||||
"is:pr+org:{org:}+author:{author:}+is:open+head:{branch:}";
|
|
||||||
|
|
||||||
const auto search_url =
|
const auto search_url = std::format(pattern, org, author, branch);
|
||||||
fmt::format(pattern, fmt::arg("org", org), fmt::arg("author", author),
|
|
||||||
fmt::arg("branch", branch));
|
|
||||||
|
|
||||||
u8cout << "search url is " << search_url << "\n";
|
u8cout << "search url is " << search_url << "\n";
|
||||||
|
|
||||||
@@ -275,7 +272,7 @@ namespace mob {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const url u(fmt::format("https://api.github.com/repos/{}/{}/pulls/{}",
|
const url u(std::format("https://api.github.com/repos/{}/{}/pulls/{}",
|
||||||
task->org(), task->repo(), pr));
|
task->org(), task->repo(), pr));
|
||||||
|
|
||||||
curl_downloader dl;
|
curl_downloader dl;
|
||||||
|
|||||||
+2
-2
@@ -367,7 +367,7 @@ namespace mob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto q =
|
const auto q =
|
||||||
fmt::format("prefix {} already exists, delete?", path_to_utf8(prefix));
|
std::format("prefix {} already exists, delete?", path_to_utf8(prefix));
|
||||||
|
|
||||||
if (ask_yes_no(q, yn::no) != yn::yes)
|
if (ask_yes_no(q, yn::no) != yn::yes)
|
||||||
return false;
|
return false;
|
||||||
@@ -489,7 +489,7 @@ namespace mob {
|
|||||||
const auto* lcp = static_cast<LANGANDCODEPAGE*>(value_pointer);
|
const auto* lcp = static_cast<LANGANDCODEPAGE*>(value_pointer);
|
||||||
|
|
||||||
const auto sub_block =
|
const auto sub_block =
|
||||||
fmt::format(L"\\StringFileInfo\\{:04x}{:04x}\\FileVersion", lcp->wLanguage,
|
std::format(L"\\StringFileInfo\\{:04x}{:04x}\\FileVersion", lcp->wLanguage,
|
||||||
lcp->wCodePage);
|
lcp->wCodePage);
|
||||||
|
|
||||||
ret = VerQueryValueW(buffer.get(), sub_block.c_str(), &value_pointer,
|
ret = VerQueryValueW(buffer.get(), sub_block.c_str(), &value_pointer,
|
||||||
|
|||||||
+14
-27
@@ -34,32 +34,24 @@ namespace mob::details {
|
|||||||
|
|
||||||
// returns a string from conf, bails out if it doesn't exist
|
// returns a string from conf, bails out if it doesn't exist
|
||||||
//
|
//
|
||||||
std::string get_string(std::string_view section, std::string_view key,
|
std::string get_string(std::string_view section, std::string_view key)
|
||||||
std::optional<std::string> default_)
|
|
||||||
{
|
{
|
||||||
auto sitor = g_conf.find(section);
|
auto sitor = g_conf.find(section);
|
||||||
if (sitor == g_conf.end())
|
if (sitor == g_conf.end())
|
||||||
gcx().bail_out(context::conf, "[{}] doesn't exist", section);
|
gcx().bail_out(context::conf, "[{}] doesn't exist", section);
|
||||||
|
|
||||||
auto kitor = sitor->second.find(key);
|
auto kitor = sitor->second.find(key);
|
||||||
if (kitor == sitor->second.end()) {
|
if (kitor == sitor->second.end())
|
||||||
if (!default_.has_value()) {
|
gcx().bail_out(context::conf, "no key '{}' in [{}]", key, section);
|
||||||
gcx().bail_out(context::conf, "no key '{}' in [{}]", key, section);
|
|
||||||
}
|
|
||||||
return *default_;
|
|
||||||
}
|
|
||||||
|
|
||||||
return kitor->second;
|
return kitor->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
// calls get_string(), converts to int
|
// calls get_string(), converts to int
|
||||||
//
|
//
|
||||||
int get_int(std::string_view section, std::string_view key,
|
int get_int(std::string_view section, std::string_view key)
|
||||||
std::optional<int> default_)
|
|
||||||
{
|
{
|
||||||
const auto s = get_string(section, key, default_.transform([](auto v) {
|
const auto s = get_string(section, key);
|
||||||
return std::to_string(v);
|
|
||||||
}));
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return std::stoi(s);
|
return std::stoi(s);
|
||||||
@@ -71,12 +63,9 @@ namespace mob::details {
|
|||||||
|
|
||||||
// calls get_string(), converts to bool
|
// calls get_string(), converts to bool
|
||||||
//
|
//
|
||||||
bool get_bool(std::string_view section, std::string_view key,
|
bool get_bool(std::string_view section, std::string_view key)
|
||||||
std::optional<bool> default_)
|
|
||||||
{
|
{
|
||||||
const auto s = get_string(section, key, default_.transform([](auto v) {
|
const auto s = get_string(section, key);
|
||||||
return v ? "true" : "false";
|
|
||||||
}));
|
|
||||||
return bool_from_string(s);
|
return bool_from_string(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,8 +378,13 @@ namespace mob {
|
|||||||
|
|
||||||
MOB_ASSERT(!tasks.empty());
|
MOB_ASSERT(!tasks.empty());
|
||||||
|
|
||||||
for (auto& t : tasks)
|
for (auto& t : tasks) {
|
||||||
|
if (t->name() != task &&
|
||||||
|
details::find_string_for_task(t->name(), key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
details::set_string_for_task(t->name(), key, value);
|
details::set_string_for_task(t->name(), key, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// global task option
|
// global task option
|
||||||
@@ -494,7 +488,7 @@ namespace mob {
|
|||||||
resolve_path("install_licenses", p.install_bin(), "licenses");
|
resolve_path("install_licenses", p.install_bin(), "licenses");
|
||||||
resolve_path("install_pythoncore", p.install_bin(), "pythoncore");
|
resolve_path("install_pythoncore", p.install_bin(), "pythoncore");
|
||||||
resolve_path("install_stylesheets", p.install_bin(), "stylesheets");
|
resolve_path("install_stylesheets", p.install_bin(), "stylesheets");
|
||||||
resolve_path("install_extensions", p.install_bin(), "extensions");
|
resolve_path("install_translations", p.install_bin(), "translations");
|
||||||
|
|
||||||
// finally, resolve the tools that are unlikely to be in PATH; all the
|
// finally, resolve the tools that are unlikely to be in PATH; all the
|
||||||
// other tools (7z, jom, patch, etc.) are assumed to be in PATH (which
|
// other tools (7z, jom, patch, etc.) are assumed to be in PATH (which
|
||||||
@@ -640,11 +634,6 @@ namespace mob {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_translations conf::translation()
|
|
||||||
{
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
conf_prebuilt conf::prebuilt()
|
conf_prebuilt conf::prebuilt()
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
@@ -736,8 +725,6 @@ namespace mob {
|
|||||||
|
|
||||||
conf_versions::conf_versions() : conf_section("versions") {}
|
conf_versions::conf_versions() : conf_section("versions") {}
|
||||||
|
|
||||||
conf_translations::conf_translations() : conf_section("translations") {}
|
|
||||||
|
|
||||||
conf_prebuilt::conf_prebuilt() : conf_section("prebuilt") {}
|
conf_prebuilt::conf_prebuilt() : conf_section("prebuilt") {}
|
||||||
|
|
||||||
conf_paths::conf_paths() : conf_section("paths") {}
|
conf_paths::conf_paths() : conf_section("paths") {}
|
||||||
|
|||||||
+12
-28
@@ -7,18 +7,15 @@ namespace mob::details {
|
|||||||
|
|
||||||
// returns an option named `key` from the given `section`
|
// returns an option named `key` from the given `section`
|
||||||
//
|
//
|
||||||
std::string get_string(std::string_view section, std::string_view key,
|
std::string get_string(std::string_view section, std::string_view key);
|
||||||
std::optional<std::string> default_ = {});
|
|
||||||
|
|
||||||
// calls get_string(), converts to bool
|
// calls get_string(), converts to bool
|
||||||
//
|
//
|
||||||
bool get_bool(std::string_view section, std::string_view key,
|
bool get_bool(std::string_view section, std::string_view key);
|
||||||
std::optional<bool> default_ = {});
|
|
||||||
|
|
||||||
// calls get_string(), converts to in
|
// calls get_string(), converts to in
|
||||||
//
|
//
|
||||||
int get_int(std::string_view section, std::string_view key,
|
int get_int(std::string_view section, std::string_view key);
|
||||||
std::optional<int> default_ = {});
|
|
||||||
|
|
||||||
// sets the given option, bails out if the option doesn't exist
|
// sets the given option, bails out if the option doesn't exist
|
||||||
//
|
//
|
||||||
@@ -49,31 +46,25 @@ namespace mob {
|
|||||||
template <class DefaultType>
|
template <class DefaultType>
|
||||||
class conf_section {
|
class conf_section {
|
||||||
public:
|
public:
|
||||||
DefaultType get(std::string_view key,
|
DefaultType get(std::string_view key) const
|
||||||
std::optional<DefaultType> default_ = {}) const
|
|
||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<DefaultType, std::string>) {
|
return details::get_string(name_, key);
|
||||||
return details::get_string(name_, key, default_);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return details::get_string(name_, key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// undefined
|
// undefined
|
||||||
template <class T>
|
template <class T>
|
||||||
T get(std::string_view key, std::optional<T> default_ = {}) const;
|
T get(std::string_view key) const;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool get<bool>(std::string_view key, std::optional<bool> default_) const
|
bool get<bool>(std::string_view key) const
|
||||||
{
|
{
|
||||||
return details::get_bool(name_, key, default_);
|
return details::get_bool(name_, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
int get<int>(std::string_view key, std::optional<int> default_) const
|
int get<int>(std::string_view key) const
|
||||||
{
|
{
|
||||||
return details::get_int(name_, key, default_);
|
return details::get_int(name_, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(std::string_view key, std::string_view value)
|
void set(std::string_view key, std::string_view value)
|
||||||
@@ -229,13 +220,6 @@ namespace mob {
|
|||||||
conf_versions();
|
conf_versions();
|
||||||
};
|
};
|
||||||
|
|
||||||
// options in [translations]
|
|
||||||
//
|
|
||||||
class conf_translations : public conf_section<std::string> {
|
|
||||||
public:
|
|
||||||
conf_translations();
|
|
||||||
};
|
|
||||||
|
|
||||||
// options in [prebuilt]
|
// options in [prebuilt]
|
||||||
//
|
//
|
||||||
class conf_prebuilt : public conf_section<std::string> {
|
class conf_prebuilt : public conf_section<std::string> {
|
||||||
@@ -270,10 +254,11 @@ namespace mob {
|
|||||||
|
|
||||||
VALUE(install_dlls);
|
VALUE(install_dlls);
|
||||||
VALUE(install_loot);
|
VALUE(install_loot);
|
||||||
VALUE(install_extensions);
|
VALUE(install_plugins);
|
||||||
VALUE(install_stylesheets);
|
VALUE(install_stylesheets);
|
||||||
VALUE(install_licenses);
|
VALUE(install_licenses);
|
||||||
VALUE(install_pythoncore);
|
VALUE(install_pythoncore);
|
||||||
|
VALUE(install_translations);
|
||||||
|
|
||||||
VALUE(vs);
|
VALUE(vs);
|
||||||
VALUE(qt_install);
|
VALUE(qt_install);
|
||||||
@@ -297,7 +282,6 @@ namespace mob {
|
|||||||
conf_cmake cmake();
|
conf_cmake cmake();
|
||||||
conf_tools tool();
|
conf_tools tool();
|
||||||
conf_transifex transifex();
|
conf_transifex transifex();
|
||||||
conf_translations translation();
|
|
||||||
conf_prebuilt prebuilt();
|
conf_prebuilt prebuilt();
|
||||||
conf_versions version();
|
conf_versions version();
|
||||||
conf_paths path();
|
conf_paths path();
|
||||||
|
|||||||
@@ -5,25 +5,6 @@
|
|||||||
#include "../utility.h"
|
#include "../utility.h"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
namespace mob::details {
|
|
||||||
|
|
||||||
std::string converter<std::wstring>::convert(const std::wstring& s)
|
|
||||||
{
|
|
||||||
return utf16_to_utf8(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string converter<fs::path>::convert(const fs::path& s)
|
|
||||||
{
|
|
||||||
return utf16_to_utf8(s.native());
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string converter<url>::convert(const url& u)
|
|
||||||
{
|
|
||||||
return u.string();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace mob::details
|
|
||||||
|
|
||||||
namespace mob {
|
namespace mob {
|
||||||
|
|
||||||
// timestamps are relative to this
|
// timestamps are relative to this
|
||||||
|
|||||||
+14
-52
@@ -1,45 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../utility.h"
|
#include "../utility.h"
|
||||||
|
#include "./formatters.h"
|
||||||
// T to std::string converters
|
|
||||||
//
|
|
||||||
// those are kept in this namespace so they don't leak all over the place;
|
|
||||||
// they're used directly by context::do_log() below
|
|
||||||
|
|
||||||
namespace mob::details {
|
|
||||||
|
|
||||||
class mob::url;
|
|
||||||
|
|
||||||
template <class T, class = void>
|
|
||||||
struct converter {
|
|
||||||
static const T& convert(const T& t) { return t; }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct converter<std::wstring> {
|
|
||||||
static std::string convert(const std::wstring& s);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct converter<fs::path> {
|
|
||||||
static std::string convert(const fs::path& s);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct converter<url> {
|
|
||||||
static std::string convert(const url& u);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct converter<T, std::enable_if_t<std::is_enum_v<T>>> {
|
|
||||||
static std::string convert(T e)
|
|
||||||
{
|
|
||||||
return std::to_string(static_cast<std::underlying_type_t<T>>(e));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace mob::details
|
|
||||||
|
|
||||||
namespace mob {
|
namespace mob {
|
||||||
|
|
||||||
@@ -57,7 +19,7 @@ namespace mob {
|
|||||||
// in places where there is no context available, there's a global one can that
|
// in places where there is no context available, there's a global one can that
|
||||||
// be retrieved with gcx() for logging
|
// be retrieved with gcx() for logging
|
||||||
//
|
//
|
||||||
// all log functions will use fmt::format() internally, so they can be used
|
// all log functions will use std::format() internally, so they can be used
|
||||||
// like:
|
// like:
|
||||||
//
|
//
|
||||||
// cx.log(context::generic, "eat more {}", "potatoes");
|
// cx.log(context::generic, "eat more {}", "potatoes");
|
||||||
@@ -161,7 +123,7 @@ namespace mob {
|
|||||||
// logs a formatted string with the dump level
|
// logs a formatted string with the dump level
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void dump(reason r, const char* f, Args&&... args) const
|
void dump(reason r, std::format_string<Args...> f, Args&&... args) const
|
||||||
{
|
{
|
||||||
do_log(false, r, level::dump, f, std::forward<Args>(args)...);
|
do_log(false, r, level::dump, f, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@@ -169,7 +131,7 @@ namespace mob {
|
|||||||
// logs a formatted string with the trace level
|
// logs a formatted string with the trace level
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void trace(reason r, const char* f, Args&&... args) const
|
void trace(reason r, std::format_string<Args...> f, Args&&... args) const
|
||||||
{
|
{
|
||||||
do_log(false, r, level::trace, f, std::forward<Args>(args)...);
|
do_log(false, r, level::trace, f, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@@ -177,7 +139,7 @@ namespace mob {
|
|||||||
// logs a formatted string with the debug level
|
// logs a formatted string with the debug level
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void debug(reason r, const char* f, Args&&... args) const
|
void debug(reason r, std::format_string<Args...> f, Args&&... args) const
|
||||||
{
|
{
|
||||||
do_log(false, r, level::debug, f, std::forward<Args>(args)...);
|
do_log(false, r, level::debug, f, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@@ -185,7 +147,7 @@ namespace mob {
|
|||||||
// logs a formatted string with the info level
|
// logs a formatted string with the info level
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void info(reason r, const char* f, Args&&... args) const
|
void info(reason r, std::format_string<Args...> f, Args&&... args) const
|
||||||
{
|
{
|
||||||
do_log(false, r, level::info, f, std::forward<Args>(args)...);
|
do_log(false, r, level::info, f, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@@ -193,7 +155,7 @@ namespace mob {
|
|||||||
// logs a formatted string with the warning level
|
// logs a formatted string with the warning level
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void warning(reason r, const char* f, Args&&... args) const
|
void warning(reason r, std::format_string<Args...> f, Args&&... args) const
|
||||||
{
|
{
|
||||||
do_log(false, r, level::warning, f, std::forward<Args>(args)...);
|
do_log(false, r, level::warning, f, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@@ -201,7 +163,7 @@ namespace mob {
|
|||||||
// logs a formatted string with the error level
|
// logs a formatted string with the error level
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void error(reason r, const char* f, Args&&... args) const
|
void error(reason r, std::format_string<Args...> f, Args&&... args) const
|
||||||
{
|
{
|
||||||
do_log(false, r, level::error, f, std::forward<Args>(args)...);
|
do_log(false, r, level::error, f, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@@ -211,7 +173,8 @@ namespace mob {
|
|||||||
// tasks
|
// tasks
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
[[noreturn]] void bail_out(reason r, const char* f, Args&&... args) const
|
[[noreturn]] void bail_out(reason r, std::format_string<Args...> f,
|
||||||
|
Args&&... args) const
|
||||||
{
|
{
|
||||||
do_log(true, r, level::error, f, std::forward<Args>(args)...);
|
do_log(true, r, level::error, f, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@@ -227,7 +190,8 @@ namespace mob {
|
|||||||
// bailed exception after logging
|
// bailed exception after logging
|
||||||
//
|
//
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void do_log(bool bail, reason r, level lv, const char* f, Args&&... args) const
|
void do_log(bool bail, reason r, level lv, std::format_string<Args...> f,
|
||||||
|
Args&&... args) const
|
||||||
{
|
{
|
||||||
// discard log if it's not enabled and it's not bailing out
|
// discard log if it's not enabled and it's not bailing out
|
||||||
if (!bail && !enabled(lv))
|
if (!bail && !enabled(lv))
|
||||||
@@ -235,9 +199,7 @@ namespace mob {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// formatting string
|
// formatting string
|
||||||
const std::string s =
|
const std::string s = std::format(f, std::forward<Args>(args)...);
|
||||||
fmt::format(f, details::converter<std::decay_t<Args>>::convert(
|
|
||||||
std::forward<Args>(args))...);
|
|
||||||
|
|
||||||
do_log_impl(bail, r, lv, s);
|
do_log_impl(bail, r, lv, s);
|
||||||
}
|
}
|
||||||
@@ -253,7 +215,7 @@ namespace mob {
|
|||||||
// a ghetto conversion and hope it gives enough info
|
// a ghetto conversion and hope it gives enough info
|
||||||
std::wstring s;
|
std::wstring s;
|
||||||
|
|
||||||
const char* p = f;
|
const char* p = f.get().data();
|
||||||
while (*p) {
|
while (*p) {
|
||||||
s += (wchar_t)*p;
|
s += (wchar_t)*p;
|
||||||
++p;
|
++p;
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../utility/string.h"
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct std::formatter<std::wstring, char> : std::formatter<std::string, char> {
|
||||||
|
template <class FmtContext>
|
||||||
|
FmtContext::iterator format(std::wstring const& s, FmtContext& ctx) const
|
||||||
|
{
|
||||||
|
return std::formatter<std::string, char>::format(mob::utf16_to_utf8(s), ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct std::formatter<std::filesystem::path, char>
|
||||||
|
: std::formatter<std::basic_string<std::filesystem::path::value_type>, char> {
|
||||||
|
template <class FmtContext>
|
||||||
|
FmtContext::iterator format(std::filesystem::path const& s, FmtContext& ctx) const
|
||||||
|
{
|
||||||
|
return std::formatter<std::basic_string<std::filesystem::path::value_type>,
|
||||||
|
char>::format(s.native(), ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class Enum, class CharT>
|
||||||
|
requires std::is_enum_v<Enum>
|
||||||
|
struct std::formatter<Enum, CharT>
|
||||||
|
: std::formatter<std::underlying_type_t<Enum>, CharT> {
|
||||||
|
template <class FmtContext>
|
||||||
|
FmtContext::iterator format(Enum v, FmtContext& ctx) const
|
||||||
|
{
|
||||||
|
return std::formatter<std::underlying_type_t<Enum>, CharT>::format(
|
||||||
|
static_cast<std::underlying_type_t<Enum>>(v), ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
+2
-2
@@ -10,11 +10,11 @@
|
|||||||
namespace mob {
|
namespace mob {
|
||||||
|
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void ini_error(const ini_data& ini, std::size_t line, std::string_view f,
|
void ini_error(const ini_data& ini, std::size_t line, std::format_string<Args...> f,
|
||||||
Args&&... args)
|
Args&&... args)
|
||||||
{
|
{
|
||||||
gcx().bail_out(context::conf, "{}:{}: {}", path_to_utf8(ini.path), (line + 1),
|
gcx().bail_out(context::conf, "{}:{}: {}", path_to_utf8(ini.path), (line + 1),
|
||||||
fmt::format(f, std::forward<Args>(args)...));
|
std::format(f, std::forward<Args>(args)...));
|
||||||
}
|
}
|
||||||
|
|
||||||
ini_data::kv_map& ini_data::get_section(std::string_view name)
|
ini_data::kv_map& ini_data::get_section(std::string_view name)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user