Skip to content

Commit

Permalink
github:10751. change code sign script file /!\ adHocSignature will no…
Browse files Browse the repository at this point in the history
…t work anymore
  • Loading branch information
delahaye-4D committed Nov 25, 2024
1 parent d7978ea commit d2be9a0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
23 changes: 15 additions & 8 deletions Build4D/Project/Sources/Classes/_core.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Function _resolvePath($path : Variant; $baseFolder : 4D.Folder) : Object

// a path on different volume ?

$_volume:=Get system info.volumes.query(" name = :1 "; $path_root)
$_volume:=System info.volumes.query(" name = :1 "; $path_root)
If ($_volume.length>0)
$absolutePath:=$path
Else
Expand Down Expand Up @@ -1116,29 +1116,31 @@ Function _sign() : Boolean

If (This.settings.signApplication.macSignature || This.settings.signApplication.adHocSignature)

var $commandLine; $certificateName : Text
var $signatureWorker : 4D.SystemWorker
var $script; $entitlements : 4D.File

$script:=Folder(Application file; fk platform path).file("Contents/Resources/SignApp.sh")
$entitlements:=Folder(Application file; fk platform path).file("Contents/Resources/4D.entitlements")

$script:=Folder(Application file; fk platform path).file("Contents/Resources/app_sign_pack_notarize.sh")

If ($script.exists && $entitlements.exists)

var $commandLine; $certificateName : Text
var $signatureWorker : 4D.SystemWorker

$certificateName:=(Not(This.settings.signApplication.macSignature) && This.settings.signApplication.adHocSignature) ? "-" : This.settings.signApplication.macCertificate // If AdHocSignature, the certificate name shall be '-'

If ($certificateName#"")

$commandLine:="'"
$commandLine+=$script.path+"' '"
$commandLine+=$certificateName+"' '"
$commandLine+=$script.path+"' sign '"
$commandLine+=This.settings.destinationFolder.path+"' '"
$commandLine+=$entitlements.path+"'"
$commandLine+=$entitlements.path+"' '"
$commandLine+=$certificateName+"'"

$signatureWorker:=4D.SystemWorker.new($commandLine)
$signatureWorker.wait(120)


/*
#DD
Warning, if you receive an exitcode == 1 with a timestamp error
Expand Down Expand Up @@ -1178,14 +1180,19 @@ check your network configuration proxy .....
End if

Else

This._log(New object(\
"function"; "Signature"; \
"message"; "Signature files are missing."; \
"severity"; Error message; \
"script"; $script.path; \
"entitlements"; $entitlements.path))
return False

End if

Else


End if
End if

Expand Down
9 changes: 8 additions & 1 deletion Build4D/Project/Sources/Methods/buildComponent.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ $settings.versioning.version:="20.7.0"
$settings.versioning.copyright:="4D SA"
$settings.versioning.companyName:="4D SA"



$settings.signApplication:={}
$settings.signApplication.macSignature:=True
$settings.signApplication.macCertificate:="Developer ID Application: CEDRIC GAREAU (BXSE3R8CQZT)"
//$settings.signApplication.adHocSignature:=True

$build:=cs.Component.new($settings)

$success:=$build.build()
Expand All @@ -34,7 +41,7 @@ If (Not($success)) // Write logs if failed
File("/PACKAGE/Build_failed.log").setText(JSON Stringify($build.logs; *))
End if

If (Get application info.headless)
If (Application info.headless)

Else
If ($success)
Expand Down
2 changes: 1 addition & 1 deletion Build4D/Project/Sources/Methods/onError.4dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//%attributes = {"invisible":true,"preemptive":"capable"}

This._log(New object("severity"; Error message; "callChain"; Get call chain; "errorCode"; Error; "errorMethod"; Error method; "errorLine"; Error line; "errorFormula"; Error formula))
This._log(New object("severity"; Error message; "callChain"; Call chain; "errorCode"; Error; "errorMethod"; Error method; "errorLine"; Error line; "errorFormula"; Error formula))
This._noError:=False

0 comments on commit d2be9a0

Please sign in to comment.