Skip to content

Commit 317ae14

Browse files
committed
dev: change test code to inject src
1 parent b209911 commit 317ae14

File tree

1 file changed

+12
-60
lines changed

1 file changed

+12
-60
lines changed
Lines changed: 12 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,29 @@
11

22
// simulate copy files of resources
3+
34
var $platformPath : Text
4-
$platformPath:=Folder:C1567(fk home folder:K87:24).folder("git").folder("4edimension").platformPath // I know is for me
5-
$platformPath:=Select folder:C670("Select root of main repo"; $platformPath)
5+
$platformPath:=Folder:C1567(fk home folder:K87:24).folder("git").folder("SpreadJS").platformPath
6+
$platformPath:=Select folder:C670("Select root"; $platformPath)
67

78
If (Length:C16($platformPath)=0)
89
return // cancel
910
End if
1011

12+
var $database:=Folder:C1567(Folder:C1567(fk database folder:K87:14).platformPath; fk platform path:K87:2)
13+
1114
var $reverse:=Shift down:C543
1215

1316
var $folder : 4D:C1709.Folder
1417
$folder:=Folder:C1567($platformPath; fk platform path:K87:2)
1518

16-
If (Not:C34($folder.exists))
19+
If (Not:C34($folder.file("bundler.py").exists))
1720
return
1821
End if
22+
var $mode:="debug"
23+
24+
var $cmd:=$folder.file("bundler.py").path
25+
$cmd+=" --mode "+$mode+" \""+$database.path+"\""
1926

20-
var $copyFileText : Text
21-
var $lang : Text
27+
var $worker:=4D:C1709.SystemWorker.new($cmd).wait()
2228

23-
For each ($lang; New collection:C1472("en"; "fr")) // will have duplicate copy for not localized files but do not care about...
24-
25-
$copyFileText:=$folder.file("4D/scripts/CF_common.json").getText()
26-
27-
$copyFileText:=Replace string:C233($copyFileText; "${BRANCH_ROOT}/"; $folder.path)
28-
$copyFileText:=Replace string:C233($copyFileText; "${THIRD_PARTY}"; $folder.path+"ThirdParty")
29-
$copyFileText:=Replace string:C233($copyFileText; "${TARGET_CONTENTS}/Components/4D ViewPro.4dbase/Resources/"; Folder:C1567(fk resources folder:K87:11).path)
30-
$copyFileText:=Replace string:C233($copyFileText; "${TARGET_CONTENTS}/Components/4D ViewPro.4dbase/Contents/Resources/"; Folder:C1567(fk resources folder:K87:11).path)
31-
32-
$copyFileText:=Replace string:C233($copyFileText; "${LibLangueLproj}"; $lang+".lproj")
33-
$copyFileText:=Replace string:C233($copyFileText; "${Lib2Langue}"; $lang)
34-
$copyFileText:=Replace string:C233($copyFileText; "${Lib2LangueMAJ}"; Uppercase:C13($lang))
35-
36-
var $copyFileData : Collection
37-
$copyFileData:=JSON Parse:C1218($copyFileText)["4DViewPro"]
38-
39-
var $operations : Object
40-
var $dest : 4D:C1709.Folder
41-
var $fromPath : Text
42-
var $destFile; $file : 4D:C1709.File
43-
For each ($operations; $copyFileData)
44-
45-
$dest:=Folder:C1567($operations.to; fk posix path:K87:1)
46-
If (Not:C34($dest.exists))
47-
$dest.create()
48-
End if
49-
50-
For each ($fromPath; $operations.from)
51-
52-
$file:=File:C1566($fromPath; fk posix path:K87:1)
53-
If ($reverse)
54-
$destFile:=$dest.file($file.fullName)
55-
$destFile.copyTo($file.parent; fk overwrite:K87:5)
56-
Else
57-
$destFile:=$file.copyTo($dest; fk overwrite:K87:5)
58-
End if
59-
60-
// copy not min
61-
If ((Position:C15(".min"; $fromPath)>0) && (File:C1566(Replace string:C233($fromPath; ".min"; ""); fk posix path:K87:1).exists))
62-
63-
$file:=File:C1566(Replace string:C233($fromPath; ".min"; ""); fk posix path:K87:1)
64-
If ($reverse)
65-
$destFile:=$dest.file($file.fullName)
66-
$destFile.copyTo($file.parent; fk overwrite:K87:5)
67-
Else
68-
$destFile:=$file.copyTo($dest; fk overwrite:K87:5)
69-
End if
70-
71-
End if
72-
73-
End for each
74-
75-
End for each
76-
77-
End for each
29+
ALERT:C41($worker.response)

0 commit comments

Comments
 (0)