1414
1515 [string ]$OutDir = $ (Join-Path $PSScriptRoot ' out' ),
1616
17+ [string ]$BuildSuffix = ' ' ,
18+
1719 [switch ]$KeepStageDir
1820)
1921begin {
@@ -50,8 +52,12 @@ process {
5052 $CustomiseScriptFile = Join-Path (Split-Path $OutDir ) ' module_template/customize.sh'
5153 $InstallScripts = Join-Path (Split-Path $OutDir ) ' module_template/META-INF'
5254
53- $ModuleProps = Get-Content $ModulePropFile | ConvertFrom-StringData
55+ $ModuleProps = Get-Content $ModulePropFile - Raw | ConvertFrom-StringData
5456 if (-not $? ) { return }
57+ if (-not [string ]::IsNullOrWhiteSpace($BuildSuffix )) {
58+ $ModuleProps.id = $ModuleProps.id , $BuildSuffix -join ' -'
59+ $ModuleProps.updateJson = $ModuleProps.updateJson -replace ' \.json$' , " -$BuildSuffix .json"
60+ }
5561
5662 Write-Host - fo White " Packaging module for SQLite $ ( $ModuleProps.version ) SDK $FirstVer -$LastVer "
5763
@@ -68,8 +74,17 @@ process {
6874 Set-Content (Join-Path $StageDir ' customize.sh' ) $CustomiseScript - NoNewline
6975 if (-not $? ) { return }
7076
71- Write-Host - fo White ' Copy module.prop metadata...'
72- Copy-Item $ModulePropFile $StageDir
77+ Write-Host - fo White ' Create module.prop metadata...'
78+ $ModulePropTarget = Join-Path $StageDir ' module.prop'
79+ Set-Content $ModulePropTarget - Value @"
80+ id=$ ( $ModuleProps.id )
81+ name=$ ( $ModuleProps.name )
82+ version=$ ( $ModuleProps.version )
83+ versionCode=$ ( $ModuleProps.versionCode )
84+ author=$ ( $ModuleProps.author )
85+ description=$ ( $ModuleProps.description )
86+ updateJson=$ ( $ModuleProps.updateJson )
87+ "@
7388 if (-not $? ) { return }
7489
7590 Write-Host - fo White ' Copy module installer scripts...'
@@ -126,6 +141,8 @@ end {
126141. PARAMETER KeepStageDir
127142 Prevents the script from deleting the staging directory where module files are copied before compression.
128143 Staging dirs are always a GUID/UUID e.g. 'a96d3ea2-b602-45f3-af67-d294a7871255'
144+ . PARAMETER BuildSuffix
145+ Changes the module updateJson URL target and module ID to include a suffix.
129146. LINK
130147 https://github.com/TheFreeman193/sqlite3-android-module/blob/main/README.md
131148. EXAMPLE
0 commit comments