diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index d13cf91031..0e99365496 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -34,14 +34,16 @@ jobs: build: runs-on: ubuntu-latest - container: acemod/armake:master steps: - name: Checkout the source code uses: actions/checkout@master - - name: Build (armake) - run: armake --version && make -j4 - - name: Upload Artifact - uses: actions/upload-artifact@master + - name: Build using HEMTT + uses: arma-actions/hemtt@master with: - name: ace3-${{ github.sha }}-nobin - path: '@ace' + command: build --ci # no --release due to https://github.com/synixebrett/HEMTT/issues/227 + # https://github.com/actions/upload-artifact/issues/3#issuecomment-524442814 + # - name: Upload Artifact + # uses: actions/upload-artifact@master + # with: + # name: ace3-${{ github.sha }}-nobin + # path: '@ace' diff --git a/.gitignore b/.gitignore index 6a37c85d53..a8f6a13221 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ @* *.zip release/* +releases/* +hemtt +hemtt.exe tools/temp -tools/armake.exe *.cache *.pbo texHeaders.bin diff --git a/Makefile b/Makefile deleted file mode 100644 index 2f725f93b5..0000000000 --- a/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -VERSION = $(shell cat "VERSION") -PREFIX = ace -BIN = @ace -ZIP = ace3 -FLAGS = -i include -w unquoted-string -w redefinition-wo-undef -VERSION_FILES = README.md docs/README_DE.md docs/README_PL.md README.zh-TW.md mod.cpp - -MAJOR = $(word 1, $(subst ., ,$(VERSION))) -MINOR = $(word 2, $(subst ., ,$(VERSION))) -PATCH = $(word 3, $(subst ., ,$(VERSION))) -BUILD = $(word 4, $(subst ., ,$(VERSION))) -VERSION_S = $(MAJOR).$(MINOR).$(PATCH) -GIT_HASH = $(shell git log -1 --pretty=format:"%H" | head -c 8) - -ifeq ($(OS), Windows_NT) - ARMAKE = ./tools/armake.exe # Downloaded via make.ps (rename armake_wXY.exe otherwise) -else - ARMAKE = armake -endif - -$(BIN)/addons/$(PREFIX)_%.pbo: addons/% - @mkdir -p $(BIN)/addons - @echo " PBO $@" - @${ARMAKE} build ${FLAGS} -f -e "version=$(GIT_HASH)" $< $@ - -$(BIN)/optionals/$(PREFIX)_%.pbo: optionals/% - @mkdir -p $(BIN)/optionals - @echo " PBO $@" - @${ARMAKE} build ${FLAGS} -f -e "version=$(GIT_HASH)" $< $@ - -# Shortcut for building single addons (eg. "make .pbo") -%.pbo: - "$(MAKE)" $(MAKEFLAGS) $(patsubst %, $(BIN)/addons/$(PREFIX)_%, $@) - -all: $(patsubst addons/%, $(BIN)/addons/$(PREFIX)_%.pbo, $(wildcard addons/*)) \ - $(patsubst optionals/%, $(BIN)/optionals/$(PREFIX)_%.pbo, $(wildcard optionals/*)) - -filepatching: - "$(MAKE)" $(MAKEFLAGS) FLAGS="-w unquoted-string -p" - -$(BIN)/keys/%.biprivatekey: - @mkdir -p $(BIN)/keys - @echo " KEY $@" - @${ARMAKE} keygen -f $(patsubst $(BIN)/keys/%.biprivatekey, $(BIN)/keys/%, $@) - -$(BIN)/addons/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION)-$(GIT_HASH).bisign: $(BIN)/addons/$(PREFIX)_%.pbo $(BIN)/keys/$(PREFIX)_$(VERSION).biprivatekey - @echo " SIG $@" - @${ARMAKE} sign -f -s $@ $(BIN)/keys/$(PREFIX)_$(VERSION).biprivatekey $< - -$(BIN)/optionals/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION)-$(GIT_HASH).bisign: $(BIN)/optionals/$(PREFIX)_%.pbo $(BIN)/keys/$(PREFIX)_$(VERSION).biprivatekey - @echo " SIG $@" - @${ARMAKE} sign -f -s $@ $(BIN)/keys/$(PREFIX)_$(VERSION).biprivatekey $< - -signatures: $(patsubst addons/%, $(BIN)/addons/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION)-$(GIT_HASH).bisign, $(wildcard addons/*)) \ - $(patsubst optionals/%, $(BIN)/optionals/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION)-$(GIT_HASH).bisign, $(wildcard optionals/*)) - -extensions: $(wildcard extensions/*/*) - cd extensions/build && cmake .. && make - find ./extensions/build/ \( -name "*.so" -o -name "*.dll" \) -exec cp {} ./ \; - -extensions-win64: $(wildcard extensions/*/*) - cd extensions/build && CXX=$(eval $(which g++-w64-mingw-i686)) cmake .. && make - -version: - @echo " VER $(VERSION)" - $(shell sed -i -r -s 's/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/$(VERSION)/g' $(VERSION_FILES)) - $(shell sed -i -r -s 's/[0-9]+\.[0-9]+\.[0-9]+/$(VERSION_S)/g' $(VERSION_FILES)) - @echo -e "#define MAJOR $(MAJOR)\n#define MINOR $(MINOR)\n#define PATCHLVL $(PATCH)\n#define BUILD $(BUILD)" > "addons/main/script_version.hpp" - $(shell sed -i -r -s 's/ACE_VERSION_MAJOR [0-9]+/ACE_VERSION_MAJOR $(MAJOR)/g' extensions/CMakeLists.txt) - $(shell sed -i -r -s 's/ACE_VERSION_MINOR [0-9]+/ACE_VERSION_MINOR $(MINOR)/g' extensions/CMakeLists.txt) - $(shell sed -i -r -s 's/ACE_VERSION_REVISION [0-9]+/ACE_VERSION_REVISION $(PATCH)/g' extensions/CMakeLists.txt) - -commit: - @echo " GIT commit release preparation" - @git add -A - @git diff-index --quiet HEAD || git commit -am "Prepare release $(VERSION_S)" -q - -push: commit - @echo " GIT push release preparation" - @git push -q - -release: clean version commit - @"$(MAKE)" $(MAKEFLAGS) signatures - @echo " ZIP $(ZIP)_$(VERSION_S).zip" - @cp *.dll *.so mod.cpp README.md docs/README_DE.md docs/README_PL.md AUTHORS.txt LICENSE logo_ace3_ca.paa meta.cpp $(BIN) - @zip -qr $(ZIP)_$(VERSION_S).zip $(BIN) - -clean: - rm -rf $(BIN) $(ZIP)_*.zip - -.PHONY: all filepatching signatures extensions extensions-win64 version commit push release clean diff --git a/VERSION b/VERSION deleted file mode 100644 index d87a10b470..0000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.12.6.43 diff --git a/build.bat b/build.bat new file mode 100644 index 0000000000..3392b5bf8d --- /dev/null +++ b/build.bat @@ -0,0 +1,3 @@ +@echo off +hemtt.exe build +pause diff --git a/hemtt.toml b/hemtt.toml new file mode 100644 index 0000000000..7962d508a2 --- /dev/null +++ b/hemtt.toml @@ -0,0 +1,26 @@ +name = "ACE3" +prefix = "ace" +author = "ACE-Team" +files = [ + "*.dll", + "*.so", + "mod.cpp", + "README.md", + "docs/README_DE.md", + "docs/README_PL.md", + "README.zh-TW.md", + "AUTHORS.txt", + "LICENSE", + "logo_ace3_ca.paa", + "meta.cpp" +] + +keyname = "{{prefix}}_{{version}}" +signame = "{{prefix}}_{{version}}-{{git \"id 8\"}}" + +releasebuild = [ + "@zip ace3_{{semver.major}}.{{semver.minor}}.{{semver.patch}}" +] + +[header_exts] +version= "{{git \"id 8\"}}" diff --git a/include/a3/ui_f/hpp/defineCommonColors.inc b/include/a3/ui_f/hpp/defineCommonColors.inc old mode 100755 new mode 100644 diff --git a/include/a3/ui_f/hpp/defineDIKCodes.inc b/include/a3/ui_f/hpp/defineDIKCodes.inc index c641d60132..eb914f9482 100644 --- a/include/a3/ui_f/hpp/defineDIKCodes.inc +++ b/include/a3/ui_f/hpp/defineDIKCodes.inc @@ -187,4 +187,3 @@ #endif /* DIK_ESCAPE */ - diff --git a/tools/make.ps1 b/tools/make.ps1 deleted file mode 100644 index 2aac0f2c9f..0000000000 --- a/tools/make.ps1 +++ /dev/null @@ -1,130 +0,0 @@ -$projectRoot = Split-Path -Parent $PSScriptRoot -$releasePage = "https://github.com/KoffeinFlummi/armake/releases" -$downloadPage = "https://github.com/KoffeinFlummi/armake/releases/download/v{0}/armake_v{0}.zip" -$armake = "$projectRoot\tools\armake.exe" -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - - -function Compare-VersionNewerThan { - param( - [Parameter(Mandatory=$True)] - $version1, - - [Parameter(Mandatory=$True)] - $version2 - ) - - $version1 = $version1.Split(".") | % {[int] $_} - $version2 = $version2.Split(".") | % {[int] $_} - - $newer = $False - for ($i = 0; $i -lt $version1.Length; $i++) { - if ($version1[$i] -gt $version2[$i]) { - $newer = $True - break - } - } - - $newer -} - - -function Get-InstalledArmakeVersion { - if (Test-Path $armake) { - $version = & $armake --version - $version = $version.Substring(1) - } else { - $version = "0.0.0" - } - - $version -} - - -function Get-LatestArmakeVersion { - $client = New-Object Net.WebClient - $content = $client.DownloadString($releasePage) - $client.dispose() - - $match = $content -match "" - if (!$match) { - Write-Error "Failed to find valid armake download link." - $version = "0.0.0" - } else { - $version = $matches[1] - } - - $version -} - - -function Update-Armake { - param( - [Parameter(Mandatory=$True)] - $url - ) - - New-Item "$PSScriptRoot\temp" -ItemType "directory" -Force | Out-Null - - Write-Output "Downloading armake..." - $client = New-Object Net.WebClient - $client.DownloadFile($url, "$PSScriptRoot\temp\armake.zip") - $client.dispose() - - Write-Output "Download complete, unpacking..." - Expand-Archive "$PSScriptRoot\temp\armake.zip" "$PSScriptRoot\temp\armake" - Remove-Item "$PSScriptRoot\temp\armake.zip" - - if ([Environment]::Is64BitProcess) { - $binary = Get-ChildItem -Path "$PSScriptRoot\temp\armake" -Include "*.exe" -Recurse | Where-Object {$_.Name -match ".*w64.exe"} - } else { - $binary = Get-ChildItem -Path "$PSScriptRoot\temp\armake" -Include "*.exe" -Recurse | Where-Object {$_.Name -match ".*w64.exe"} - } - Move-Item $binary.FullName $armake -Force - - Remove-Item "$PSScriptRoot\temp" -Recurse -Force -} - - -function Build-Directory { - param( - [Parameter(Mandatory=$True)] - $directory - ) - - $component = $directory.Name - $fullPath = $directory.FullName - $parent = $directory.Parent - $binPath = "$projectRoot\@ace\$parent\ace_$component.pbo" - - Write-Output " PBO $component" - & $armake build -i "$projectRoot\include" -w unquoted-string -w redefinition-wo-undef -f $fullPath $binPath - - if ($LastExitCode -ne 0) { - Write-Error "Failed to build $component." - } -} - - -function Main { - $installed = Get-InstalledArmakeVersion - $latest = Get-LatestArmakeVersion - - if (Compare-VersionNewerThan $latest $installed) { - Write-Output "Found newer version of armake:" " Installed: $installed" " Latest: $latest" - Update-Armake ($downloadPage -f $latest) - Write-Output "Update complete, armake up-to-date." - } - - $orgLocation = Get-Location - Set-Location -Path $projectRoot - foreach ($folder in "addons", "optionals") { - New-Item "$projectRoot\@ace\$folder" -ItemType "directory" -Force | Out-Null - foreach ($component in Get-ChildItem -Directory "$PSScriptRoot\..\$folder") { - Build-Directory $component - } - } - Set-Location $orgLocation -} - -Main