Skip to content

Commit

Permalink
Update _BuildComponent to notarise zip as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMaul committed Jun 19, 2024
1 parent 5a72bb5 commit fe9620b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 25 deletions.
5 changes: 5 additions & 0 deletions Project/Sources/Classes/_Build.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ Function CreateImage($pathContent : Text; $pathImg : Text; $name : Text)->$error

Function ConvertImage($pathTempImg : Text; $pathFinalImg : Text)->$error : Object
// hdiutil convert /Users/thomas/Documents/4D/Komponenten/AdminWindow_Build/tmp.dmg -format UDZO -o /Users/thomas/Documents/4D/Komponenten/AdminWindow_Build/Component.dmg
// delete target if exists...
If (Test path name:C476($pathFinalImg)=Is a document:K24:1)
DELETE DOCUMENT:C159($pathFinalImg)
End if

var $in; $out; $err; $cmd; $source : Text
$cmd:="hdiutil convert '"+Convert path system to POSIX:C1106($pathTempImg)+"' -format UDZO -o '"+Convert path system to POSIX:C1106($pathFinalImg)+"'"
$in:=""
Expand Down
26 changes: 18 additions & 8 deletions Project/Sources/Methods/__buildComponent.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ you might need to start Xcode to accept Apple contract changes or update expired
/* JOB:
Build (and sign)
// for Mac user (also useable on Windows if expanded on Mac)
create img
upload img for notarize
staple img
convert img to be read only
// for Win user
// useable on both Mac and Windows
zip
// only if running on Mac: upload zip for notarize
// for Mac user (also useable on Windows if expanded on Mac)
create dmg
upload dmg for notarize
staple dmg
convert dmg to be read only
// finally we have a zip, useable on both Mac and Windows. The zip was uploaded to Apple (if createdon Mac) for notarisation
// but the zip is not (cannot be) stapled, so if downloaded for first run, the downloaded version needs to be checked with Apple servers
// the dmg is stapled, so can be run even without internet connections, as it has a flag accepted by the macOS
*/

If (Is Windows:C1573)
Expand Down Expand Up @@ -77,14 +82,19 @@ If ($error.success=True:C214)
End if

// run only on Mac
If ($error.success=True:C214)
Progress SET MESSAGE($progress; "Notarize zip and wait for Apple's approval...")
$error:=$builder.Notarize($targetpath)
End if

If ($error.success=True:C214)
Progress SET MESSAGE($progress; "Build IMG...")
var $tempimgpath : Text:=$sourcefile.parent.parent.platformPath+"tmp.dmg"
$error:=$builder.CreateImage($sourcepath; $tempimgpath; $sourcefile.name)
End if

If ($error.success=True:C214)
Progress SET MESSAGE($progress; "Notarize and wait for Apple's approval...")
Progress SET MESSAGE($progress; "Notarize dmg and wait for Apple's approval...")
$error:=$builder.Notarize($tempimgpath)
End if

Expand Down
23 changes: 11 additions & 12 deletions userPreferences.Thomas/methodPreferences.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,28 +378,27 @@
"stamp": "2019-04-26T12:33:38.478Z"
},
"Sources/Methods/__buildComponent.4dm": {
"startSelection": 0,
"endSelection": 0,
"firstSelectedLine": 48,
"lastSelectedLine": 48,
"startSelection": 25,
"endSelection": 25,
"firstSelectedLine": 105,
"lastSelectedLine": 105,
"folding": [],
"bookmarks": [],
"stamp": "2024-06-17T10:24:54.819Z"
"stamp": "2024-06-19T06:20:14.874Z"
},
"Sources/Classes/_Build.4dm": {
"startSelection": 89,
"endSelection": 89,
"firstSelectedLine": 54,
"lastSelectedLine": 54,
"startSelection": 29,
"endSelection": 29,
"firstSelectedLine": 72,
"lastSelectedLine": 72,
"folding": [
4,
28,
100,
127,
141
146
],
"bookmarks": [],
"stamp": "2024-06-17T09:12:25.298Z"
"stamp": "2024-06-19T06:24:12.091Z"
},
"Sources/Methods/test.4dm": {
"startSelection": 0,
Expand Down
8 changes: 4 additions & 4 deletions userPreferences.Thomas/methodWindowPositions.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@
"height": 1016
},
"Sources/Methods/__buildComponent.4dm": {
"left": 1068,
"top": 186,
"width": 1623,
"height": 1218
"left": 1453,
"top": 145,
"width": 1536,
"height": 1077
},
"Sources/Classes/_Build.4dm": {
"left": 159,
Expand Down
14 changes: 13 additions & 1 deletion userPreferences.Thomas/workspace.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
{
"editors": []
"editors": [
{
"type": "explorer"
},
{
"type": "method",
"id": 2147483641,
"codeDescriptor": {
"type": 1,
"methodName": "__buildComponent"
}
}
]
}

0 comments on commit fe9620b

Please sign in to comment.