Skip to content

Commit

Permalink
Enable FDROID constant by replacing the content of Directory.Build.pr…
Browse files Browse the repository at this point in the history
…ops in the clean stage of F-Droid
  • Loading branch information
fedemkr committed Mar 15, 2024
1 parent e59a22e commit 950b2ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,14 @@ jobs:

- name: Clean for F-Droid
run: |
$appPath = $($env:GITHUB_WORKSPACE + "/${{ env.main_app_project_path }}");
$corePath = $($env:GITHUB_WORKSPACE + "/src/Core/Core.csproj");
$directoryBuildProps = $($env:GITHUB_WORKSPACE + "/Directory.Build.props");
$androidManifest = $($env:GITHUB_WORKSPACE + "/${{ env.android_manifest_path }}");
Write-Output "##### Back up project files"
Copy-Item $androidManifest $($androidManifest + ".original");
Copy-Item $appPath $($appPath + ".original");
Copy-Item $directoryBuildProps $($directoryBuildProps + ".original");
Write-Output "##### Cleanup Android Manifest"
Expand All @@ -383,6 +382,10 @@ jobs:
$xml.Save($androidManifest);
Write-Output "##### Enabling FDROID constant"
(Get-Content $directoryBuildProps).Replace('<!-- <CustomConstants>FDROID</CustomConstants> -->', '<CustomConstants>FDROID</CustomConstants>') | Set-Content $directoryBuildProps
- name: Restore packages
run: dotnet restore

Expand All @@ -401,8 +404,7 @@ jobs:
/p:AndroidSigningKeyStore=$signingFdroidKeyStore `
/p:AndroidSigningKeyAlias=bitwarden `
/p:AndroidSigningKeyPass="$($env:FDROID_KEYSTORE_PASSWORD)" `
/p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" `
/p:CustomConstants="FDROID" --no-restore
/p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" ` --no-restore
Write-Output "##### Copy FDroid apk to project root"
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@

<!-- Uncomment this when Unit Testing-->
<!-- <CustomConstants>UT</CustomConstants> -->

<!-- Uncomment this when building FDROID-->
<!-- <CustomConstants>FDROID</CustomConstants> -->
</PropertyGroup>
</Project>

0 comments on commit 950b2ea

Please sign in to comment.