Skip to content

Commit

Permalink
Bump 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Jan 19, 2024
1 parent 4c3c9bd commit 8ee68b5
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 77 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: publish

on:
workflow_run:
workflows: [build]
types: [completed]
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
Expand Down
110 changes: 54 additions & 56 deletions 1k/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ $exeSuffix = if ($HOST_OS -eq 0) { '.exe' } else { '' }
$Script:cmake_generator = $null

# import VersionEx
. (Join-Path $PSScriptRoot 'versionex.ps1')
. (Join-Path $PSScriptRoot 'extensions.ps1')

class build1k {
[void] println($msg) {
Expand Down Expand Up @@ -301,6 +301,8 @@ $Global:is_darwin_embed_family = $Global:is_ios -or $Global:is_tvos -or $Global:
$Global:is_darwin_family = $Global:is_mac -or $Global:is_darwin_embed_family
$Global:is_gh_act = "$env:GITHUB_ACTIONS" -eq 'true'

$Script:cmake_ver = ''

if (!$is_wasm) {
$TARGET_CPU = $options.a
if (!$TARGET_CPU) {
Expand Down Expand Up @@ -665,7 +667,7 @@ function setup_ninja() {
function setup_cmake($skipOS = $false) {
$cmake_prog, $cmake_ver = find_prog -name 'cmake'
if ($cmake_prog -and (!$skipOS -or $cmake_prog.IndexOf($myRoot) -ne -1)) {
return $cmake_prog
return $cmake_prog, $cmake_ver
}

$cmake_root = $(Join-Path $external_prefix 'cmake')
Expand Down Expand Up @@ -731,7 +733,7 @@ function setup_cmake($skipOS = $false) {
if (($null -ne $cmake_bin) -and ($env:PATH.IndexOf($cmake_bin) -eq -1)) {
$env:PATH = "$cmake_bin$ENV_PATH_SEP$env:PATH"
}
return $cmake_prog
return $cmake_prog, $cmake_ver
}

function ensure_cmake_ninja($cmake_prog, $ninja_prog) {
Expand Down Expand Up @@ -1254,7 +1256,7 @@ function preprocess_andorid([string[]]$inputOptions) {

$archs = $archlist -join ':' # TODO: modify gradle, split by ';'

$outputOptions += "-P__1K_CMAKE_VERSION=$($manifest['cmake'])"
$outputOptions += "-P__1K_CMAKE_VERSION=$($Script:cmake_ver.TrimLast('-'))"
$outputOptions += "-P__1K_ARCHS=$archs"
$outputOptions += '--parallel', '--info'
}
Expand Down Expand Up @@ -1374,7 +1376,7 @@ validHostAndToolchain

$null = setup_glslcc

$cmake_prog = setup_cmake
$cmake_prog,$Script:cmake_ver = setup_cmake

if ($Global:is_win_family) {
find_vs_latest
Expand All @@ -1394,7 +1396,7 @@ elseif ($Global:is_android) {
$ninja_prog = setup_ninja
# ensure ninja in cmake_bin
if (!(ensure_cmake_ninja $cmake_prog $ninja_prog)) {
$cmake_prog = setup_cmake -Force
$cmake_prog,$Script:cmake_ver = setup_cmake -Force
if (!(ensure_cmake_ninja $cmake_prog $ninja_prog)) {
$b1k.println("Ensure ninja in cmake bin directory fail")
}
Expand Down Expand Up @@ -1576,10 +1578,9 @@ if (!$setupOnly) {
$b1k.println("CONFIG_ALL_OPTIONS=$CONFIG_ALL_OPTIONS, Count={0}" -f $CONFIG_ALL_OPTIONS.Count)

if ($Global:is_android -and $is_gradlew) {
$storedLocation = (Get-Location).Path
$build_tool = (Get-Command $options.xt).Source
$build_tool_dir = Split-Path $build_tool -Parent
Set-Location $build_tool_dir
Push-Location $build_tool_dir
if (!$configOnly) {
if ($optimize_flag -eq 'Debug') {
& $build_tool assembleDebug $CONFIG_ALL_OPTIONS | Out-Host
Expand All @@ -1591,65 +1592,64 @@ if (!$setupOnly) {
else {
& $build_tool tasks
}
Set-Location $storedLocation
Pop-Location
}
else {
# step3. configure

$workDir = $(Get-Location).Path

$mainDep = Join-Path $workDir 'CMakeLists.txt'
if (!$b1k.isfile($mainDep)) {
$b1k.println("Missing CMakeLists.txt in $workDir")
Set-Location $stored_cwd
return
}

$mainDepChanged = $false
# A Windows file time is a 64-bit value that represents the number of 100-nanosecond
$tempFileItem = Get-Item $mainDep
$lastWriteTime = $tempFileItem.LastWriteTime.ToFileTimeUTC()
$tempFile = Join-Path $BUILD_DIR 'b1k_cache.txt'

$storeHash = 0
if ($b1k.isfile($tempFile)) {
$storeHash = Get-Content $tempFile -Raw
}
$hashValue = $b1k.hash("$CONFIG_ALL_OPTIONS#$lastWriteTime")
$mainDepChanged = "$storeHash" -ne "$hashValue"
$cmakeCachePath = $b1k.realpath("$BUILD_DIR/CMakeCache.txt")

if ($mainDepChanged -or !$b1k.isfile($cmakeCachePath) -or $forceConfig) {
if (!$is_wasm) {
cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
if ($b1k.isfile($mainDep)) {
$mainDepChanged = $false
# A Windows file time is a 64-bit value that represents the number of 100-nanosecond
$tempFileItem = Get-Item $mainDep
$lastWriteTime = $tempFileItem.LastWriteTime.ToFileTimeUTC()
$tempFile = Join-Path $BUILD_DIR 'b1k_cache.txt'

$storeHash = 0
if ($b1k.isfile($tempFile)) {
$storeHash = Get-Content $tempFile -Raw
}
else {
emcmake cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
}
Set-Content $tempFile $hashValue -NoNewline
}
$hashValue = $b1k.hash("$CONFIG_ALL_OPTIONS#$lastWriteTime")
$mainDepChanged = "$storeHash" -ne "$hashValue"
$cmakeCachePath = $b1k.realpath("$BUILD_DIR/CMakeCache.txt")

if (!$configOnly) {
if (!$is_engine) {
if (!$b1k.isfile($cmakeCachePath)) {
throw "The cmake generate incomplete, pelase add '-f' to re-generate again"
if ($mainDepChanged -or !$b1k.isfile($cmakeCachePath) -or $forceConfig) {
if (!$is_wasm) {
cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
}
else {
emcmake cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
}
Set-Content $tempFile $hashValue -NoNewline
}

# step4. build
# apply additional build options
$BUILD_ALL_OPTIONS += "--parallel"
if ($Global:is_linux) {
$BUILD_ALL_OPTIONS += "$(nproc)"
}
if (($cmake_generator -eq 'Xcode') -and ($BUILD_ALL_OPTIONS.IndexOf('--verbose') -eq -1)) {
$BUILD_ALL_OPTIONS += '--', '-quiet'
}
$b1k.println("BUILD_ALL_OPTIONS=$BUILD_ALL_OPTIONS, Count={0}" -f $BUILD_ALL_OPTIONS.Count)
if (!$configOnly) {
if (!$is_engine) {
if (!$b1k.isfile($cmakeCachePath)) {
Set-Location $stored_cwd
throw "The cmake generate incomplete, pelase add '-f' to re-generate again"
}
}

cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS | Out-Host
# step4. build
# apply additional build options
$BUILD_ALL_OPTIONS += "--parallel"
if ($Global:is_linux) {
$BUILD_ALL_OPTIONS += "$(nproc)"
}
if (($cmake_generator -eq 'Xcode') -and ($BUILD_ALL_OPTIONS.IndexOf('--verbose') -eq -1)) {
$BUILD_ALL_OPTIONS += '--', '-quiet'
}
$b1k.println("BUILD_ALL_OPTIONS=$BUILD_ALL_OPTIONS, Count={0}" -f $BUILD_ALL_OPTIONS.Count)

cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS | Out-Host
}
} else {
$b1k.println("Missing CMakeLists.txt in $workDir")
}
}

Set-Location $stored_cwd
} else {
# google gclient/gn build system
# refer: https://chromium.googlesource.com/chromium/src/+/eca97f87e275a7c9c5b7f13a65ff8635f0821d46/tools/gn/docs/reference.md#args_specifies-build-arguments-overrides-examples
Expand Down Expand Up @@ -1728,7 +1728,5 @@ if (!$setupOnly) {
isHostTarget = $is_host_target
compilerID = $TOOLCHAIN_NAME
}

Set-Location $stored_cwd
}

15 changes: 15 additions & 0 deletions 1k/versionex.ps1 → 1k/extensions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,21 @@ namespace System
return v1.CompareTo(v2) >= 0;
}
}
public static class ExtensionMethods
{
public static string TrimLast(this Management.Automation.PSObject thiz, string separator)
{
var str = thiz.BaseObject as string;
var index = str.LastIndexOf(separator);
if (index != -1)
return str.Substring(0, index);
return str;
}
}
}
"@

$TrimLastMethod = [ExtensionMethods].GetMethod('TrimLast')
Update-TypeData -TypeName System.String -MemberName TrimLast -MemberType CodeMethod -Value $TrimLastMethod
}
4 changes: 2 additions & 2 deletions cmake/Modules/AXPlatform.cmake → 1k/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ elseif(CMAKE_GENERATOR MATCHES Visual)
set(VS TRUE)
endif()

function(ax_check_archs)
function(_1k_deprecated_32bit project_name release_ver)
if(("${ARCH_ALIAS}" MATCHES "x86") OR ("${ARCH_ALIAS}" MATCHES "armeabi-v7a"))
message(WARNING "Building 32-bit[${ARCH_ALIAS}] axmol is deprecated, and will be removed in next release axmol-2.2.0")
message(WARNING "Building 32-bit[${ARCH_ALIAS}] ${project_name} is deprecated, and will be removed in next release ${release_ver}")
endif()
endfunction()
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
- KEY_STORE_PASSWORD ==> KEY_STORE_PASSWORD
- RELEASE_KEY_ALIAS ==> KEY_ALIAS
- RELEASE_KEY_PASSWORD ==> KEY_PASSWORD
- Enable template projects' `aidl` by default for In-app purchases by @armanhossiny

### Break changes

Expand Down
3 changes: 2 additions & 1 deletion cmake/Modules/AXBuildSet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ include(AXConfigDefine)
# config libraries dependence
include(AXConfigDepend)

message(AUTHOR_WARNING "CMAKE_VERSION:" ${CMAKE_VERSION})
message(STATUS "CMAKE_HOST_SYSTEM_NAME:" ${CMAKE_HOST_SYSTEM_NAME})
message(STATUS "CMAKE_SYSTEM_NAME:" ${CMAKE_SYSTEM_NAME})
message(STATUS "CMAKE_GENERATOR_PLATFORM:" ${CMAKE_GENERATOR_PLATFORM})
Expand All @@ -65,4 +66,4 @@ message(STATUS "PROJECT_BINARY_DIR:" ${PROJECT_BINARY_DIR})
message(STATUS "ENGINE_BINARY_PATH:" ${ENGINE_BINARY_PATH})
message(STATUS "ARCH_ALIAS:" ${ARCH_ALIAS})

ax_check_archs()
_1k_deprecated_32bit(axmol 2.2.0)
3 changes: 1 addition & 2 deletions cmake/Modules/AXConfigDefine.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

include(AXPlatform)
include(${_AX_ROOT}/1k/platform.cmake)

# custom target property for lua/js link
define_property(TARGET
Expand Down
5 changes: 2 additions & 3 deletions cmake/Modules/AXLinkHelpers.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include(AXPlatform)

ax_check_archs()
include(${_AX_ROOT}/1k/platform.cmake)
_1k_deprecated_32bit(axmol 2.2.0)

if(NOT CMAKE_GENERATOR MATCHES "Ninja")
set(BUILD_CONFIG_DIR "\$\(Configuration\)/")
Expand Down
2 changes: 1 addition & 1 deletion setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $AX_ROOT = $myRoot
Set-Alias println Write-Host

# import VersionEx
. (Join-Path $PSScriptRoot '1k/versionex.ps1')
. (Join-Path $PSScriptRoot '1k/extensions.ps1')

$pwsh_ver = [VersionEx]$PSVersionTable.PSVersion.ToString()

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/angle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(lib_name angle)

project(${lib_name})

_1kfetch_dist(angle "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(angle)

if(WINRT)
# -----macro: set openssl sub target-----
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/c-ares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(target_name c-ares)

project(${target_name})

_1kfetch_dist(cares "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(cares)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/curl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(target_name ${lib_name})

project(${lib_name})

_1kfetch_dist(curl "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(curl)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/jpeg-turbo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(target_name ${lib_name})

project(${lib_name})

_1kfetch_dist(jpeg-turbo "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(jpeg-turbo)

add_library(${target_name} STATIC IMPORTED GLOBAL)

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/lua/luajit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(lib_name luajit)
set(target_name ${lib_name})
project(${lib_name})

_1kfetch_dist(luajit "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(luajit)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/openssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(lib_name openssl)

project(${lib_name})

_1kfetch_dist(openssl "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(openssl)

set(OPENSSL_INCLUDE_DIR "${openssl_INC_DIR}" CACHE STRING "OpenSSL include dir" FORCE)

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(target_name "zlib")
project(${target_name})

_1kfetch_dist(zlib "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(zlib)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/make-pkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function Compress-ArchiveEx() {
}

# import VersionEx
. (Join-Path $AX_ROOT '1k/versionex.ps1')
. (Join-Path $AX_ROOT '1k/extensions.ps1')

if (([VersionEx]$PSVersionTable.PSVersion.ToString() -ge [VersionEx]'7.0') -and $IsWindows) {

Expand Down
2 changes: 1 addition & 1 deletion tools/console/axmol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@ if ($args[0] -eq 'new') {
}
}

. $plugin.proc @sub_args @sub_opts
. $plugin.proc $sub_args @sub_opts

0 comments on commit 8ee68b5

Please sign in to comment.