[mtouch] Generate own constants file. (#16321)

Generate own constants file, instead of relying on platform-specific files in
src/, which may or may not exist depending on the enabled platforms.
This commit is contained in:
Rolf Bjarne Kvinge 2022-10-14 09:24:04 +02:00 коммит произвёл GitHub
Родитель d4e54cccbb
Коммит 73ec322dd9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -35,6 +35,9 @@ bin/Debug/mtouchtests.dll: $(mtouchtests_dependencies)
$(SYSTEM_XIBUILD) -- mtouchtests.csproj /r $(XBUILD_VERBOSITY) /bl
$(Q) rm -f .failed-stamp
$(abspath $(TOP)/tools/mtouch/Constants.cs):
$(Q) $(MAKE) $(notdir $@) -C $(dir $@)
build: bin/Debug/mtouchtests.dll
test.config: $(TOP)/Make.config Makefile

1
tools/mtouch/.gitignore поставляемый
Просмотреть файл

@ -1,3 +1,4 @@
Constants.cs
*.a
*.dylib
*.dSYM

Просмотреть файл

@ -0,0 +1,6 @@
namespace Xamarin.Bundler {
public static partial class Constants {
public const string Version = "@VERSION@";
internal const string Revision = "@REVISION@";
}
}

Просмотреть файл

@ -223,6 +223,11 @@ mtouch.csproj.inc: export BUILD_VERBOSITY=$(MSBUILD_VERBOSITY)
$(MTOUCH_DIR)/mtouch.exe: $(mtouch_dependencies)
$(Q_GEN) $(SYSTEM_MSBUILD) $(TOP)/Xamarin.iOS.sln "/t:mtouch" $(XBUILD_VERBOSITY) /p:Configuration=$(MTOUCH_CONF)
Constants.cs: Constants.cs.in Makefile $(TOP)/Make.config.inc
$(Q_GEN) sed \
-e "s/@VERSION@/$(IOS_PACKAGE_VERSION_MAJOR).$(IOS_PACKAGE_VERSION_MINOR).$(IOS_PACKAGE_VERSION_REV)/g" \
-e 's/@REVISION@/$(IOS_COMMIT_DISTANCE) ($(CURRENT_BRANCH_SED_ESCAPED): $(CURRENT_HASH))/g' \
$< > $@
#
# Partial static registrar libraries
#

Просмотреть файл

@ -52,9 +52,7 @@
<Compile Include="..\..\builds\mono-ios-sdk-destdir\ios-sources\mcs\class\Mono.Options\Mono.Options\Options.cs">
<Link>mono-archive\Options.cs</Link>
</Compile>
<Compile Include="..\..\src\build\ios\Constants.cs">
<Link>src\build\ios\Constants.cs</Link>
</Compile>
<Compile Include="Constants.cs" />
<Compile Include="..\..\src\ObjCRuntime\Constants.cs">
<Link>src\ObjCRuntime\Constants.cs</Link>
</Compile>