From d2be9a09a4c42747c6180c6338d26c9c8e2d463c Mon Sep 17 00:00:00 2001 From: Dominique Delahaye Date: Mon, 25 Nov 2024 16:37:17 +0100 Subject: [PATCH] github:10751. change code sign script file /!\ adHocSignature will not work anymore --- Build4D/Project/Sources/Classes/_core.4dm | 23 ++++++++++++------- .../Sources/Methods/buildComponent.4dm | 9 +++++++- Build4D/Project/Sources/Methods/onError.4dm | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Build4D/Project/Sources/Classes/_core.4dm b/Build4D/Project/Sources/Classes/_core.4dm index df5d686..c39cd16 100644 --- a/Build4D/Project/Sources/Classes/_core.4dm +++ b/Build4D/Project/Sources/Classes/_core.4dm @@ -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 @@ -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 @@ -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 diff --git a/Build4D/Project/Sources/Methods/buildComponent.4dm b/Build4D/Project/Sources/Methods/buildComponent.4dm index bd2fc02..0007f5d 100644 --- a/Build4D/Project/Sources/Methods/buildComponent.4dm +++ b/Build4D/Project/Sources/Methods/buildComponent.4dm @@ -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() @@ -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) diff --git a/Build4D/Project/Sources/Methods/onError.4dm b/Build4D/Project/Sources/Methods/onError.4dm index ab2c181..5741b54 100644 --- a/Build4D/Project/Sources/Methods/onError.4dm +++ b/Build4D/Project/Sources/Methods/onError.4dm @@ -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