Skip to content

Commit

Permalink
adjust Makefile to hardlink the appropriate Manifest file from the Ma…
Browse files Browse the repository at this point in the history
…nifests folder. Adjust build.yml for renamed test project. Add AndroidManifest.xml to .gitignore as this is only a link.
  • Loading branch information
PhilippC committed Jan 14, 2025
1 parent 0cae15a commit 29fc0fe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ jobs:
run: |
make msbuild Flavor=NoNet
- name: Test Autofill
working-directory: ./src/Kp2aAutofillParserTest
working-directory: ./src/Kp2aAutofillParser.Tests
run: dotnet test

- name: Build APK (nonet)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,4 @@ src/java/Keepass2AndroidPluginSDK2/build/generated/mockable-Google-Inc.-Google-A
/docs/gdrive-verification
/src/MegaTest
*.dtbcache.json
/src/keepass2android-app/AndroidManifest.xml
37 changes: 33 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,38 @@ ifneq ($(Configuration),)
else
$(warning Configuration environment variable not set.)
endif

DELETE_MANIFEST_LINK :=
CREATE_MANIFEST_LINK :=

MANIFEST_FILE :=
ifneq ($(Flavor),)
MSBUILD_PARAM += -p:Flavor="$(Flavor)"
ifneq ($(Flavor),)
ifeq ($(Flavor),Debug)
MANIFEST_FILE := AndroidManifest_debug.xml
endif
ifeq ($(Flavor),Net)
MANIFEST_FILE := AndroidManifest_net.xml
endif
ifeq ($(Flavor),NoNet)
MANIFEST_FILE := AndroidManifest_nonet.xml
endif
ifeq ($(detected_OS),Windows)
DELETE_MANIFEST_LINK := @cmd /c del src\keepass2android-app\AndroidManifest.xml
CREATE_MANIFEST_LINK := @cmd /c mklink /h src\keepass2android-app\AndroidManifest.xml src\keepass2android-app\Manifests\$(MANIFEST_FILE)
else
DELETE_MANIFEST_LINK := rm -f src/keepass2android-app/AndroidManifest.xml
CREATE_MANIFEST_LINK := ln -f src/keepass2android-app/Manifests/$(MANIFEST_FILE) src/keepass2android-app/AndroidManifest.xml
endif

endif
else
$(warning Flavor environment variable not set.)
endif

ifneq ($(KeyStore),)
MSBUILD_PARAM += -p:AndroidKeyStore=True -p:AndroidSigningKeyStore="$(KeyStore)" -p:AndroidSigningStorePass=env:MyAndroidSigningStorePass -p:AndroidSigningKeyPass=env:MyAndroidSigningKeyPass
MSBUILD_PARAM += -p:AndroidKeyStore=True -p:AndroidSigningKeyStore="$(KeyStore)" -p:AndroidSigningStorePass=env:MyAndroidSigningStorePass -p:AndroidSigningKeyPass=env:MyAndroidSigningKeyPass -p:AndroidSigningKeyAlias="kp2a"
endif

ifeq ($(detected_OS),Windows)
Expand Down Expand Up @@ -281,6 +305,11 @@ endif
$(MSBUILD) src/KeePass.sln -t:restore $(MSBUILD_PARAM) -p:RestorePackagesConfig=true
@echo "" > stamp.nuget_$(Flavor)

manifestlink:
$(info Creating hardlink for manifest of Flavor: $(Flavor))
$(DELETE_MANIFEST_LINK)
$(CREATE_MANIFEST_LINK)

#####
src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs:
ifeq ($(detected_OS),Windows)
Expand All @@ -289,11 +318,11 @@ else
$(CP) src/Kp2aBusinessLogic/Io/DropboxFileStorageKeysDummy.cs $@
endif

msbuild: native java nuget src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs
msbuild: manifestlink native java nuget src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs
$(MSBUILD) src/KeePass.sln -target:keepass2android-app -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -p:BuildProjectReferences=true $(MSBUILD_PARAM) -p:Platform="Any CPU" -m

apk: msbuild
$(MSBUILD) src/keepass2android/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m
apk: msbuild
$(MSBUILD) src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m

build_all: msbuild

Expand Down

0 comments on commit 29fc0fe

Please sign in to comment.