From ceffa85c0aa38b6f8613172186944dd231c72c4f Mon Sep 17 00:00:00 2001 From: halx99 Date: Wed, 7 Aug 2024 23:46:31 +0800 Subject: [PATCH] Update 1k & copyright notice in some sources --- 1k/1kiss.ps1 | 13 +++++++++++-- 1k/fetch.ps1 | 21 ++++++++++++++++++--- 1k/manifest.ps1 | 4 ++-- 1k/setup-msvc.ps1 | 14 +++++++++----- CHANGELOG.md | 1 + core/network/Downloader-wasm.cpp | 4 +--- core/network/Downloader-wasm.h | 4 +--- core/network/HttpClient-wasm.h | 7 ++----- core/network/WebSocket-wasm.cpp | 4 +--- core/network/WebSocket-wasm.h | 4 +--- 10 files changed, 47 insertions(+), 29 deletions(-) diff --git a/1k/1kiss.ps1 b/1k/1kiss.ps1 index 8d98e9f5ebd3..1189a310bd82 100644 --- a/1k/1kiss.ps1 +++ b/1k/1kiss.ps1 @@ -484,6 +484,9 @@ function devtool_url($filename) { function version_eq($ver1, $ver2) { return $ver1 -eq $ver2 } +function version_like($ver1, $ver2) { + return $ver1 -like $ver2 +} # $ver2: accept x.y.z-rc1 function version_ge($ver1, $ver2) { @@ -569,6 +572,7 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params = $checkVerCond = $null $minimalVer = '' $preferredVer = '' + $wildcardVer = '' $requiredVer = $manifest[$name] if ($requiredVer) { $preferredVer = $null @@ -591,7 +595,13 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params = $checkVerCond = '$(version_in_range $foundVer $minimalVer $preferredVer)' } else { - $checkVerCond = '$(version_eq $foundVer $preferredVer)' + if (!$preferredVer.Contains('*')) { + $checkVerCond = '$(version_eq $foundVer $preferredVer)' + } else { + $wildcardVer = $preferredVer + $preferredVer = $wildcardVer.TrimLast('*') + $checkVerCond = '$(version_like $foundVer $wildcardVer)' + } } } } @@ -645,7 +655,6 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params = } else { if ($preferredVer) { - # if (!$silent) { $1k.println("Not found $name, needs install: $preferredVer") } $found_rets = $null, $preferredVer } else { diff --git a/1k/fetch.ps1 b/1k/fetch.ps1 index 38ddab689ee9..411c38fb27a9 100644 --- a/1k/fetch.ps1 +++ b/1k/fetch.ps1 @@ -50,8 +50,8 @@ function fetch_repo($url, $name, $dest, $ext) { if ($ext -eq '.zip') { Expand-Archive -Path $out -DestinationPath $prefix -Force } - elseif ($ext -match '\.tar(\..*)?$'){ - tar xf "$out" -C $prefix + elseif ($ext -match '\.tar(\..*)?$') { + tar xvf "$out" -C $prefix } } catch { @@ -62,7 +62,22 @@ function fetch_repo($url, $name, $dest, $ext) { if (!(Test-Path $dest -PathType Container)) { $original_lib_src = Join-Path $prefix $Script:url_pkg_name if (Test-Path $original_lib_src -PathType Container) { - Rename-Item $original_lib_src $dest -Force + $tries = 0 + do { + try { + Rename-Item $original_lib_src $dest -Force + if ($?) { + break + } + } + catch { + + } + + println "fetch.ps1: rename $original_lib_src to $dest failed, try after 1 seconds" + $tries += 1 + Start-Sleep -Seconds 1 + } while ($tries -lt 10) } else { throw "fetch.ps1: the package name mismatch for $out" diff --git a/1k/manifest.ps1 b/1k/manifest.ps1 index 9396c6b31314..efbc5ee8452b 100644 --- a/1k/manifest.ps1 +++ b/1k/manifest.ps1 @@ -11,9 +11,9 @@ if ($Global:is_axmol_app -or $Global:is_axmol_engine) { $manifest['nuget'] = '5.5.1' # since 5.6.0, requires .net 4.0 $manifest['glslcc'] = '1.9.5+' - $manifest['cmake'] = '3.29.3~3.30.1+' + $manifest['cmake'] = '3.29.3~3.30.2+' $manifest['emsdk'] = '3.1.63+' - $manifest['jdk'] = '17.0.10~17.0.11+' + $manifest['jdk'] = '17.0.10~17.0.12+' } # android sdk tools diff --git a/1k/setup-msvc.ps1 b/1k/setup-msvc.ps1 index 3839c47aed90..eb06c162dbe8 100644 --- a/1k/setup-msvc.ps1 +++ b/1k/setup-msvc.ps1 @@ -1,18 +1,22 @@ param( - $ver = '14.39' + $ver = '14.39', + $arch = 'x64' ) $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" $vs_installs = ConvertFrom-Json "$(&$vswhere -version '17.0' -format 'json')" $vs_installs -$vs_installer = '${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe' +$vs_installer = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" $vs_path = $vs_installs[0].installationPath -$msvc_comp_id = "Microsoft.VisualStudio.Component.VC.$ver.17.9.x86.x64" # refer to: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022 + +$vs_arch = @{x64 = 'x86.x64'; x86 = 'x86.x64'; arm64 = 'ARM64'; arm = 'ARM' }[$arch] +$msvc_comp_id = "Microsoft.VisualStudio.Component.VC.$ver.17.9.$vs_arch" # refer to: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022 echo "Installing $msvc_comp_id ..." &$vs_installer modify --quiet --installPath $vs_path --add $msvc_comp_id | Out-Host -if($?) { +if ($?) { echo 'setup msvc success.' -} else { +} +else { echo 'setup msvc fail' } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8759e08e2c..a62a10fc8454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Move FastRNG to ax ns and more improvements by @DelinWorks in https://github.com/axmolengine/axmol/pull/2057 - Handle premultiplied alpha for grayscale PNGs by @j-jorge in https://github.com/axmolengine/axmol/pull/2047 - Optimize ProgramState::setTexture() to avoid vector (de)allocations by @smilediver in https://github.com/axmolengine/axmol/pull/2061 +- Add OpenType font (.otf) to the noCompress list by @danialias in https://github.com/axmolengine/axmol/pull/2077 ### 3rdparty updates diff --git a/core/network/Downloader-wasm.cpp b/core/network/Downloader-wasm.cpp index 50553ad2dbdf..cdcf85126309 100644 --- a/core/network/Downloader-wasm.cpp +++ b/core/network/Downloader-wasm.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - Copyright (c) 2015-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - http://www.cocos2d-x.org + https://axmol.dev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/network/Downloader-wasm.h b/core/network/Downloader-wasm.h index 03690bf0ec56..a5b8307ca78a 100644 --- a/core/network/Downloader-wasm.h +++ b/core/network/Downloader-wasm.h @@ -1,10 +1,8 @@ /**************************************************************************** - Copyright (c) 2015-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - http://www.cocos2d-x.org + https://axmol.dev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/network/HttpClient-wasm.h b/core/network/HttpClient-wasm.h index 4d2d54de0ba7..618000a1ba6e 100644 --- a/core/network/HttpClient-wasm.h +++ b/core/network/HttpClient-wasm.h @@ -1,10 +1,7 @@ /**************************************************************************** - Copyright (c) 2012 greathqy - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2013-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - http://www.cocos2d-x.org + https://axmol.dev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/network/WebSocket-wasm.cpp b/core/network/WebSocket-wasm.cpp index e7f021b7b0e2..92e86592ccca 100644 --- a/core/network/WebSocket-wasm.cpp +++ b/core/network/WebSocket-wasm.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - Copyright (c) 2015-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - http://www.cocos2d-x.org + https://axmol.dev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/network/WebSocket-wasm.h b/core/network/WebSocket-wasm.h index 980f334074bb..c87be25523b4 100644 --- a/core/network/WebSocket-wasm.h +++ b/core/network/WebSocket-wasm.h @@ -1,9 +1,7 @@ /**************************************************************************** - Copyright (c) 2015-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - http://www.cocos2d-x.org + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal