Skip to content

Commit 90f3884

Browse files
committed
no bug fix/feature, updated to 20 R5/R6, compiled and notarized for dependencies manager
1 parent 5b5988b commit 90f3884

14 files changed

Lines changed: 443 additions & 125 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Components
1010

1111
lib4d-arm64.dylib
1212
userPreferences.Thomas/
13+
UserMode_Component_Build

Project/Sources/Classes/_Build.4dm

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
Class constructor
2+
This:C1470._SettingsUsed:=""
3+
This:C1470._Source:=""
4+
5+
Function Compile($options : Object)->$error : Object
6+
If (Count parameters:C259>0)
7+
$error:=Compile project:C1760($options)
8+
Else
9+
$error:=Compile project:C1760
10+
End if
11+
12+
Function Build($PathToSettings : Text)->$error : Object
13+
// this function uses LAUNCH EXTERNAL PROCESS and not 4D.SystemWorker to allow v19 LTS to use the class
14+
If (Count parameters:C259>0)
15+
This:C1470._SettingsUsed:=$PathToSettings
16+
Else
17+
This:C1470._SettingsUsed:=File:C1566(Build application settings file:K5:60).platformPath
18+
End if
19+
BUILD APPLICATION:C871(This:C1470._SettingsUsed)
20+
21+
var $errortext : Text
22+
If (OK=0)
23+
$errortext:=File:C1566(Build application log file:K5:46).getText()
24+
$error:=New object:C1471("success"; False:C215; "log"; $errortext)
25+
Else
26+
$error:=New object:C1471("success"; True:C214)
27+
End if
28+
29+
Function Notarize($zipfilepath : Text)->$error : Object
30+
ASSERT:C1129($zipfilepath#""; "zip file path must not be empty")
31+
var $in; $out; $err; $cmd : Text
32+
$in:=""
33+
$out:=""
34+
$err:=""
35+
$cmd:="xcrun notarytool submit "+Char:C90(34)+Convert path system to POSIX:C1106($zipfilepath)+Char:C90(34)+" --keychain-profile notarytool --wait"
36+
LAUNCH EXTERNAL PROCESS:C811($cmd; $in; $out; $err)
37+
If (($err#"") & ($err#"@Current status: Accepted@"))
38+
$error:=New object:C1471("success"; False:C215; "log"; $err)
39+
Else
40+
var $id; $out2; $logpath; $logtext : Text
41+
var $pos : Integer
42+
var $log : Object
43+
Case of
44+
: ($out="@ status: Accepted@")
45+
$error:=New object:C1471("success"; True:C214)
46+
: ($out="@ status: Invalid@")
47+
$pos:=Position:C15(" id: "; $out)
48+
If ($pos>0)
49+
$id:=Substring:C12($out; $pos+7)
50+
$pos:=Position:C15(Char:C90(10); $id)
51+
$id:=Substring:C12($id; 1; $pos)
52+
$in:=""
53+
$out2:=""
54+
$err:=""
55+
$logpath:=Get 4D folder:C485(Logs folder:K5:19)+"notarizing log.json"
56+
$cmd:="xcrun notarytool log "+$id+" --keychain-profile \"notarytool\" "+Char:C90(34)+Convert path system to POSIX:C1106($logpath)+Char:C90(34)
57+
LAUNCH EXTERNAL PROCESS:C811($cmd; $in; $out2; $err)
58+
If (Test path name:C476($logpath)=Is a document:K24:1)
59+
$logtext:=Document to text:C1236($logpath)
60+
$log:=JSON Parse:C1218($logtext)
61+
Else
62+
$log:=New object:C1471
63+
End if
64+
$error:=New object:C1471("success"; False:C215; "log"; $out; "id"; $id; "invalid"; $log)
65+
Else
66+
$error:=New object:C1471("success"; False:C215; "log"; $out)
67+
End if
68+
Else
69+
$error:=New object:C1471("success"; False:C215; "log"; $out)
70+
End case
71+
72+
End if
73+
74+
Function Zip($source : Text; $target : Text)->$error : Object
75+
If (($source#"") & ($target#""))
76+
var $in; $out; $err; $cmd : Text
77+
If (Test path name:C476($target)=Is a document:K24:1)
78+
DELETE DOCUMENT:C159($target) // just to be sure that zip works and we can fetch errors
79+
End if
80+
$cmd:="/usr/bin/ditto -c -k --keepParent "+Char:C90(34)+Convert path system to POSIX:C1106($source)+Char:C90(34)+" "+Char:C90(34)+Convert path system to POSIX:C1106($target)+Char:C90(34)
81+
$in:=""
82+
$out:=""
83+
$err:=""
84+
LAUNCH EXTERNAL PROCESS:C811($cmd; $in; $out; $err)
85+
86+
If ($err#"")
87+
$error:=New object:C1471("success"; False:C215; "reason"; "Zip error "+$err)
88+
Else
89+
$error:=New object:C1471("success"; True:C214; "target"; $target)
90+
End if
91+
Else
92+
$error:=New object:C1471("success"; False:C215; "reason"; "source or target path empty")
93+
End if
94+
95+
Function StapleAndZip()->$error : Object
96+
$error:=This:C1470.Staple(This:C1470._Source)
97+
If ($error.success=True:C214)
98+
$error:=This:C1470.Zip(This:C1470._Source)
99+
End if
100+
101+
Function Staple($path : Text)->$error : Object
102+
var $in; $out; $err; $cmd; $source : Text
103+
$cmd:="xcrun stapler staple '"+Convert path system to POSIX:C1106($path)+"'"
104+
$in:=""
105+
$out:=""
106+
$err:=""
107+
LAUNCH EXTERNAL PROCESS:C811($cmd; $in; $out; $err)
108+
If ($err#"")
109+
$error:=New object:C1471("success"; False:C215; "log"; "Staple error "+$out)
110+
Else
111+
$error:=New object:C1471("success"; True:C214)
112+
End if
113+
114+
Function CreateImage($pathContent : Text; $pathImg : Text; $name : Text)->$error : Object
115+
// hdiutil create /Users/thomas/Documents/4D/Komponenten/AdminWindow_Build/tmp.dmg -ov -volname "ComponentTest" -fs HFS+ -srcfolder "/Users/thomas/Documents/4D/Komponenten/AdminWindow_Build/Components"
116+
var $in; $out; $err; $cmd; $source : Text
117+
$cmd:="hdiutil create '"+Convert path system to POSIX:C1106($pathImg)+"' -ov -volname '"+$name+"' -fs HFS+ -srcfolder '"+Convert path system to POSIX:C1106($pathContent)+"'"
118+
$in:=""
119+
$out:=""
120+
$err:=""
121+
LAUNCH EXTERNAL PROCESS:C811($cmd; $in; $out; $err)
122+
If ($err#"")
123+
$error:=New object:C1471("success"; False:C215; "log"; "CreateImage error "+$out)
124+
Else
125+
$error:=New object:C1471("success"; True:C214)
126+
End if
127+
128+
Function ConvertImage($pathTempImg : Text; $pathFinalImg : Text)->$error : Object
129+
// hdiutil convert /Users/thomas/Documents/4D/Komponenten/AdminWindow_Build/tmp.dmg -format UDZO -o /Users/thomas/Documents/4D/Komponenten/AdminWindow_Build/Component.dmg
130+
// delete target if exists...
131+
If (Test path name:C476($pathFinalImg)=Is a document:K24:1)
132+
DELETE DOCUMENT:C159($pathFinalImg)
133+
End if
134+
135+
var $in; $out; $err; $cmd; $source : Text
136+
$cmd:="hdiutil convert '"+Convert path system to POSIX:C1106($pathTempImg)+"' -format UDZO -o '"+Convert path system to POSIX:C1106($pathFinalImg)+"'"
137+
$in:=""
138+
$out:=""
139+
$err:=""
140+
LAUNCH EXTERNAL PROCESS:C811($cmd; $in; $out; $err)
141+
If ($err#"")
142+
$error:=New object:C1471("success"; False:C215; "log"; "ConvertImage error "+$out)
143+
Else
144+
$error:=New object:C1471("success"; True:C214)
145+
End if
146+
147+
Function getSourcePath()->$source : Text
148+
var $settings:=File:C1566(This:C1470._SettingsUsed; fk platform path:K87:2).getText()
149+
var $settingsXML:=DOM Parse XML variable:C720($settings)
150+
var $Found:=DOM Find XML element:C864($settingsXML; "/Preferences4D/BuildApp/BuildMacDestFolder")
151+
If (ok=1)
152+
var $value : Text
153+
DOM GET XML ELEMENT VALUE:C731($Found; $value)
154+
Case of
155+
: ($value="::@")
156+
// cannot use Folder(fk database folder).parent, as we need to go outside of protected area
157+
var $sourcefolder:=Folder:C1567(Get 4D folder:C485(Database folder:K5:14); fk platform path:K87:2)
158+
$sourcefolder:=Folder:C1567($sourcefolder.parent.platformPath+Substring:C12($value; 3)+"Components"; fk platform path:K87:2)
159+
var $sourcefolderfiles:=$sourcefolder.folders()
160+
If ($sourcefolderfiles.length>0)
161+
$source:=$sourcefolderfiles[0].platformPath
162+
End if
163+
: ($value=":@")
164+
$sourcefolder:=Folder:C1567(Folder:C1567(fk database folder:K87:14).platformPath+Substring:C12($value; 2)+"Components"; fk platform path:K87:2)
165+
$sourcefolderfiles:=$sourcefolder.folders()
166+
If ($sourcefolderfiles.length>0)
167+
$source:=$sourcefolderfiles[0].platformPath
168+
End if
169+
Else
170+
$source:=$value
171+
End case
172+
End if
173+
DOM CLOSE XML:C722($settingsXML)
174+

Project/Sources/Forms/UserMode_Buttons/ObjectMethods/UserMode_ExecuteButton.4dm

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
C_TEXT:C284($message;$text)
2-
C_LONGINT:C283($selectedItem;$form)
1+
C_TEXT:C284($message; $text)
2+
C_LONGINT:C283($selectedItem; $form)
3+
C_POINTER:C301($ptr)
34

45
Case of
5-
: (Form event:C388=On Clicked:K2:4)
6+
: (Form event code:C388=On Clicked:K2:4)
67
If (ar_UserMode_Execute{iUserMode_CurrentTable})
7-
EDIT FORMULA:C806(Table:C252(iUserMode_CurrentTable)->;UserModeFormula)
8+
EDIT FORMULA:C806(Table:C252(iUserMode_CurrentTable)->; UserModeFormula)
89
If (OK=1)
9-
C_POINTER:C301($ptr)
1010
$ptr:=Table:C252(iUserMode_CurrentTable)
1111

1212
If (Records in set:C195("UserSet")#Records in table:C83($ptr->))
1313
USE SET:C118("UserSet")
1414
End if
15-
//EXECUTE FORMULA(UserModeFormula)
15+
//EXECUTE FORMULA(UserModeFormula)
1616

17-
CREATE EMPTY SET:C140($ptr->;"LockedSet")
18-
APPLY TO SELECTION:C70($ptr->;EXECUTE FORMULA:C63(UserModeFormula))
17+
CREATE EMPTY SET:C140($ptr->; "LockedSet")
18+
APPLY TO SELECTION:C70($ptr->; EXECUTE FORMULA:C63(UserModeFormula))
1919
If (Records in set:C195("LockedSet")#0)
2020
$message:=Get localized string:C991("UserMode Locked")
2121
ALERT:C41($message)
@@ -25,7 +25,7 @@ Case of
2525

2626
End if
2727

28-
: (Form event:C388=On Alternative Click:K2:36)
28+
: (Form event code:C388=On Alternative Click:K2:36)
2929
If (UserMode_ExecuteAll)
3030
$text:=Get localized string:C991("UserMode ExecutePopup") // "Apply Formula; Execute Code"
3131
$selectedItem:=Pop up menu:C542($text)
@@ -36,18 +36,17 @@ Case of
3636
Case of
3737
: ($selectedItem=1) // same as on clicked
3838
If (ar_UserMode_Execute{iUserMode_CurrentTable})
39-
EDIT FORMULA:C806(Table:C252(iUserMode_CurrentTable)->;UserModeFormula)
39+
EDIT FORMULA:C806(Table:C252(iUserMode_CurrentTable)->; UserModeFormula)
4040
If (OK=1)
41-
C_POINTER:C301($ptr)
4241
$ptr:=Table:C252(iUserMode_CurrentTable)
4342

4443
If (Records in set:C195("UserSet")#Records in table:C83($ptr->))
4544
USE SET:C118("UserSet")
4645
End if
47-
//EXECUTE FORMULA(UserModeFormula)
46+
//EXECUTE FORMULA(UserModeFormula)
4847

49-
CREATE EMPTY SET:C140($ptr->;"LockedSet")
50-
APPLY TO SELECTION:C70($ptr->;EXECUTE FORMULA:C63(UserModeFormula))
48+
CREATE EMPTY SET:C140($ptr->; "LockedSet")
49+
APPLY TO SELECTION:C70($ptr->; EXECUTE FORMULA:C63(UserModeFormula))
5150
If (Records in set:C195("LockedSet")#0)
5251
$message:=Get localized string:C991("UserMode Locked")
5352
ALERT:C41($message)

Project/Sources/Forms/UserMode_ListboxPro/ObjectMethods/ListboxDetail.4dm

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,46 @@
11
C_TEXT:C284($type)
2+
C_LONGINT:C283($column; $row; $table; $field)
3+
C_TEXT:C284($text)
4+
C_POINTER:C301($columnptr; $ptr)
25

36
Case of
47
: (Form event code:C388=On Alternative Click:K2:36)
5-
C_LONGINT:C283($column;$row)
6-
C_TEXT:C284($text)
7-
C_POINTER:C301($columnptr;$ptr)
8-
LISTBOX GET CELL POSITION:C971(*;"ListBoxDetail";$column;$row;$columnptr)
8+
LISTBOX GET CELL POSITION:C971(*; "ListBoxDetail"; $column; $row; $columnptr)
99
If ($column=2)
10-
$type:=OB Get:C1224($columnptr->{$row};"valueType";Is text:K8:3)
10+
$type:=OB Get:C1224($columnptr->{$row}; "valueType"; Is text:K8:3)
1111
If ($type="text")
12-
$text:=OB Get:C1224($columnptr->{$row};"value";Is text:K8:3)
13-
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5;"variableTextEntry")
12+
$text:=OB Get:C1224($columnptr->{$row}; "value"; Is text:K8:3)
13+
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5; "variableTextEntry")
1414
$ptr->:=$text
1515
FORM GOTO PAGE:C247(2)
1616
End if
1717
End if
1818

1919
: (Form event code:C388=On Clicked:K2:4)
20-
C_LONGINT:C283($column;$row;$table;$field)
21-
C_TEXT:C284($text)
22-
C_POINTER:C301($columnptr;$ptr)
23-
LISTBOX GET CELL POSITION:C971(*;"ListBoxDetail";$column;$row;$columnptr)
20+
LISTBOX GET CELL POSITION:C971(*; "ListBoxDetail"; $column; $row; $columnptr)
2421
If ($column=2)
25-
$type:=OB Get:C1224($columnptr->{$row};"_UC_type";Is text:K8:3)
22+
$type:=OB Get:C1224($columnptr->{$row}; "_UC_type"; Is text:K8:3)
2623
Case of
2724
: ($type="picture")
28-
$table:=OB Get:C1224($columnptr->{$row};"_UC_table";Is longint:K8:6)
29-
$field:=OB Get:C1224($columnptr->{$row};"_UC_field";Is longint:K8:6)
30-
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5;"variablePictureEntry")
31-
$ptr->:=Field:C253($table;$field)->
25+
$table:=OB Get:C1224($columnptr->{$row}; "_UC_table"; Is longint:K8:6)
26+
$field:=OB Get:C1224($columnptr->{$row}; "_UC_field"; Is longint:K8:6)
27+
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5; "variablePictureEntry")
28+
$ptr->:=Field:C253($table; $field)->
3229
FORM GOTO PAGE:C247(3)
3330

3431
: ($type="object")
35-
$table:=OB Get:C1224($columnptr->{$row};"_UC_table";Is longint:K8:6)
36-
$field:=OB Get:C1224($columnptr->{$row};"_UC_field";Is longint:K8:6)
37-
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5;"variableTextEntry")
38-
$text:=JSON Stringify:C1217(Field:C253($table;$field)->;*)
32+
$table:=OB Get:C1224($columnptr->{$row}; "_UC_table"; Is longint:K8:6)
33+
$field:=OB Get:C1224($columnptr->{$row}; "_UC_field"; Is longint:K8:6)
34+
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5; "variableTextEntry")
35+
$text:=JSON Stringify:C1217(Field:C253($table; $field)->; *)
3936
$ptr->:=$text
4037
FORM GOTO PAGE:C247(2)
4138

4239
: ($type="blob")
43-
$table:=OB Get:C1224($columnptr->{$row};"_UC_table";Is longint:K8:6)
44-
$field:=OB Get:C1224($columnptr->{$row};"_UC_field";Is longint:K8:6)
45-
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5;"variableTextEntry")
46-
BASE64 ENCODE:C895(Field:C253($table;$field)->;$text)
40+
$table:=OB Get:C1224($columnptr->{$row}; "_UC_table"; Is longint:K8:6)
41+
$field:=OB Get:C1224($columnptr->{$row}; "_UC_field"; Is longint:K8:6)
42+
$ptr:=OBJECT Get pointer:C1124(Object named:K67:5; "variableTextEntry")
43+
BASE64 ENCODE:C895(Field:C253($table; $field)->; $text)
4744
$ptr->:=$text
4845
FORM GOTO PAGE:C247(2)
4946
End case

0 commit comments

Comments
 (0)