feat(build): add --dist to redirect output to dist/ instead of plugins/
When --dist is passed (forwarded by build_plugin.py to the per-version script), built nsis7z.dll files are copied to <repo>/dist/<config> instead of <repo>/plugins/<config>. Lets CI collect a clean dist/ tree without touching the committed plugins/ dir. Windows (2601_vs2026) and Linux build paths both supported. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -630,6 +630,9 @@ Examples:
|
|||||||
help='Disable additional build optimizations')
|
help='Disable additional build optimizations')
|
||||||
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
||||||
help='Visual Studio version to use (default: auto)')
|
help='Visual Studio version to use (default: auto)')
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead '
|
||||||
|
'of <repo>/plugins/<config>')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -642,6 +645,9 @@ Examples:
|
|||||||
|
|
||||||
# Get project paths
|
# Get project paths
|
||||||
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
||||||
|
# --dist: redirect the output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
if not project_file.exists():
|
if not project_file.exists():
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ def _build_one(
|
|||||||
jobs: int,
|
jobs: int,
|
||||||
clean: bool,
|
clean: bool,
|
||||||
cleanup_artifacts: bool,
|
cleanup_artifacts: bool,
|
||||||
|
dist: bool = False,
|
||||||
) -> int:
|
) -> int:
|
||||||
layout = VERSION_LAYOUT[zip_version]
|
layout = VERSION_LAYOUT[zip_version]
|
||||||
vendor_7zip = layout["vendor_7zip"]
|
vendor_7zip = layout["vendor_7zip"]
|
||||||
@@ -243,7 +244,10 @@ def _build_one(
|
|||||||
print(f"ERROR: expected artifact not found: {built}", file=sys.stderr)
|
print(f"ERROR: expected artifact not found: {built}", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
dest = ROOT / cfg["dest"]
|
rel_dest = cfg["dest"]
|
||||||
|
if dist and rel_dest.startswith("plugins/"):
|
||||||
|
rel_dest = "dist/" + rel_dest[len("plugins/"):]
|
||||||
|
dest = ROOT / rel_dest
|
||||||
dest.parent.mkdir(parents=True, exist_ok=True)
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||||
shutil.copy2(built, dest)
|
shutil.copy2(built, dest)
|
||||||
|
|
||||||
@@ -303,6 +307,12 @@ def main() -> int:
|
|||||||
help="Keep per-config build artifact directories (_o_*)",
|
help="Keep per-config build artifact directories (_o_*)",
|
||||||
)
|
)
|
||||||
parser.add_argument("--verbose", action="store_true", help="Verbose output")
|
parser.add_argument("--verbose", action="store_true", help="Verbose output")
|
||||||
|
parser.add_argument(
|
||||||
|
"--dist",
|
||||||
|
action="store_true",
|
||||||
|
help="Copy built DLLs to <repo>/dist/<config> instead of "
|
||||||
|
"<repo>/plugins/<config>",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
_require_tool("make")
|
_require_tool("make")
|
||||||
@@ -327,6 +337,7 @@ def main() -> int:
|
|||||||
jobs,
|
jobs,
|
||||||
args.clean,
|
args.clean,
|
||||||
args.cleanup_artifacts,
|
args.cleanup_artifacts,
|
||||||
|
args.dist,
|
||||||
)
|
)
|
||||||
if code != 0:
|
if code != 0:
|
||||||
return code
|
return code
|
||||||
|
|||||||
Reference in New Issue
Block a user