Skip to content

Commit 57e0f5d

Browse files
committed
Preparations for NuGet packages
1 parent ea730cd commit 57e0f5d

File tree

455 files changed

+23354
-3703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

455 files changed

+23354
-3703
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AddTatinDependencies←{##.AddTatinDependencies ⍵}

APLSource/Cider/API/ListTatinPackages.aplf

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
r←AddNuGetDependencies
2+
⍝ Either add one or more Tatin packages or one or more or nuget packages
3+
⍝Morten⍝
4+
∘∘∘
5+
load←9=⎕NC'ns' ⍝ Project Space provided
6+
none←'No nuget dependencies registered.'
7+
type←⎕C type
8+
:If (~list∨load)∧0∊≢¨type package
9+
'syntax is ]Cider.Dependency nuget|tatin package [folder] -list'⎕SIGNAL 11
10+
:EndIf
11+
12+
:If ~∧/m←(gotnuget gottatin)←9=⌊⎕SE.⎕NC'NuGet' 'Tatin'
13+
⎕←'Warning: ',(⍕(~m)/'⎕SE.NuGet' '⎕SE.Tatin'),' not found - unable to report on or manage those dependencies.'
14+
:EndIf
15+
16+
:If gotnuget
17+
NuGet←⎕SE.NuGet
18+
:EndIf
19+
20+
:If ~load
21+
ns←path{3::0 ⋄ ⊃⍵[⍵[;2]⍳⊂⍺;1]}ListOpenProjects 0
22+
:EndIf
23+
config←Get_JSON5 configfile←path,'/cider.config'
24+
:If load∧~hasdeps←0≠⎕NC'config.CIDER.dependencies.nuget'
25+
→0⊣r←'' ⍝ Asked to load, and there are no nuget dependencies
26+
:EndIf
27+
28+
:If ~list∨load∨hasdeps∨~gotnuget
29+
config.CIDER.dependencies.nuget←'nuget-packages'
30+
config Put_JSON5 configfile
31+
:EndIf
32+
33+
nuget_dir←path,'/',{0::⍵ ⋄ config.CIDER.dependencies.nuget}'nuget-packages'
34+
tatin_dir←path,'/',config.CIDER.dependencies.tatin
35+
gotnuget←gotnuget∧~list∧~⎕NEXISTS nuget_dir ⍝ Pretend we have no nuget if listing and no folder
36+
37+
:If gotnuget∧type≡'nuget'
38+
r←NuGet.Setup nuget_dir
39+
→(∨/'error:'⍷⎕C r)⍴0
40+
:EndIf
41+
42+
:If list
43+
r←0 2⍴⊂nuget←tatin←''
44+
:If gotnuget
45+
:AndIf ⎕NEXISTS nuget_dir
46+
nuget←{⍵,(0=≢⍵)/none}NuGet.Packages nuget_dir
47+
nuget←{1↓∊'/',¨⍵}¨nuget
48+
:EndIf
49+
:If gottatin
50+
:If {0::0 ⋄ ⎕NEXISTS ⍵}tatin_dir
51+
:Trap 11 ⍝ ListTatinPackages fails if there are none
52+
tatin←{2=⍴⍴⍵:(3↓⍵[;2])/3↓⍵[;1] ⋄ ⍬}ListTatinPackages path
53+
tatin←(' '=⊃¨tatin)↓¨tatin ⍝ leading space?
54+
:EndTrap
55+
:EndIf
56+
:EndIf
57+
r←(×≢¨nuget tatin)⌿2 2⍴'nuget: 'nuget'tatin:'tatin
58+
:If 0=≢r
59+
r←'No dependencies found'
60+
:EndIf
61+
→0
62+
:EndIf
63+
64+
:If gotnuget∧(0≠≢package)∧type≡'nuget'
65+
r←NuGet.Add nuget_dir package
66+
→(∨/'error:'⍷⎕C r)⍴0
67+
:EndIf
68+
69+
:If ns≢0
70+
:If 2=⎕NC'ns'
71+
ns←⍎ns
72+
:EndIf
73+
'dotnet'ns.⎕NS''
74+
ns.dotnet.⎕USING←NuGet.Using nuget_dir
75+
r←((~load)/r,'. '),'NuGet dependencies established in ',(⍕ns),'.dotnet'
76+
:EndIf
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
r←AddTatinDependencies(packageIDs targetFolder)
2+
⍝ Add one or more Tatin packages as dependencies
3+
r←⎕SE.Tatin.InstallPackages packageIDs targetFolder
4+
⍝Done

APLSource/Cider/History.apla

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
(
2-
'* 0.34.0 ⋄ 2023-09-12'
3-
' * `OpenProject` does not report anything but serious stuff and final success to `⎕SE`, but watch out'
4-
' for the global config parameter `verbose` and the user command flags `-verbose` and `-batch`'
5-
' * `OpenProject`s `quiet` flag was retired'
2+
'* 0.34.0 ⋄ 2023-09-14'
3+
' * `OpenProject` does not report anymore anything but serious stuff and final success to `⎕SE`, but watch '
4+
' out for the global config parameter `verbose` and the user command flags `-verbose` and `-batch`'
5+
' * `OpenProject`s `quiet` flag has been retired'
66
' * `OpenProject` has now a parameter `verbose` & `batch`; the latter is for tests & build procedures etc'
77
' * `]OpenProject` has now a -verbose flag and a `-batch` flag'
88
' * Cider honours a variable `verbose` in its global configuration file. By default no such file exists,'
99
' meaning that the default is 0. If it does exist it might or might nor carry `verbose`. '
1010
' * Cider deletes Link-specific vars in its config file that equal their defaults anyway'
1111
' * Under rare circumstances `]Cider.Help` produced an error ("File not found") rather than showing the help'
12-
' * `]Cider.Help` did not work on some OS/browser combinations'
1312
'* 0.33.0 ⋄ 2023-09-05'
1413
' * `Cider` is now an ordinary namespace rather than a class script.'
1514
' * `LoadTatinPackages` now reports the URL the packages were loaded from, but only if they were loaded'

APLSource/Cider/Init.aplf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Init
2-
G←APLGit2
3-
F←FilesAndDirs
4-
C←CommTools
5-
A←APLTreeUtils2
2+
:If 1 CommTools.YesOrNo'Would you like to create a variable DEVELOPMENT in ⎕SE.Cider?'
3+
⎕SE.Cider.DEVELOPMENT←1
4+
:EndIf
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
r←ListDependencies arg
2+
⍝ List dependencies
3+
⍝TODO⍝
4+
5+
6+
⍝ Call
7+
⍝ ListTatinPackages
8+
⍝ and/or
9+
⍝ ListNuGetPackages
10+
⍝ and returnd their (possibly combined) output
11+
12+
13+
r←ListTatinPackages arg
14+
⍝Done
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Pr←ListNuGetDependencies
2+
⍝ List dependencies
3+
⍝Morten
4+
∘∘∘
5+
load←9=⎕NC'ns' ⍝ Project Space provided
6+
none←'No nuget dependencies registered.'
7+
type←⎕C type
8+
:If (~list∨load)∧0∊≢¨type package
9+
'syntax is ]Cider.Dependency nuget|tatin package [folder] -list'⎕SIGNAL 11
10+
:EndIf
11+
12+
:If ~∧/m←(gotnuget gottatin)←9=⌊⎕SE.⎕NC'NuGet' 'Tatin'
13+
⎕←'Warning: ',(⍕(~m)/'⎕SE.NuGet' '⎕SE.Tatin'),' not found - unable to report on or manage those dependencies.'
14+
:EndIf
15+
16+
:If gotnuget
17+
NuGet←⎕SE.NuGet
18+
:EndIf
19+
20+
:If ~load
21+
ns←path{3::0 ⋄ ⊃⍵[⍵[;2]⍳⊂⍺;1]}ListOpenProjects 0
22+
:EndIf
23+
config←Get_JSON5 configfile←path,'/cider.config'
24+
:If load∧~hasdeps←0≠⎕NC'config.CIDER.dependencies.nuget'
25+
→0⊣r←'' ⍝ Asked to load, and there are no nuget dependencies
26+
:EndIf
27+
28+
:If ~list∨load∨hasdeps∨~gotnuget
29+
config.CIDER.dependencies.nuget←'nuget-packages'
30+
config Put_JSON5 configfile
31+
:EndIf
32+
33+
nuget_dir←path,'/',{0::⍵ ⋄ config.CIDER.dependencies.nuget}'nuget-packages'
34+
tatin_dir←path,'/',config.CIDER.dependencies.tatin
35+
gotnuget←gotnuget∧~list∧~⎕NEXISTS nuget_dir ⍝ Pretend we have no nuget if listing and no folder
36+
37+
:If gotnuget∧type≡'nuget'
38+
r←NuGet.Setup nuget_dir
39+
→(∨/'error:'⍷⎕C r)⍴0
40+
:EndIf
41+
42+
:If list
43+
r←0 2⍴⊂nuget←tatin←''
44+
:If gotnuget
45+
:AndIf ⎕NEXISTS nuget_dir
46+
nuget←{⍵,(0=≢⍵)/none}NuGet.Packages nuget_dir
47+
nuget←{1↓∊'/',¨⍵}¨nuget
48+
:EndIf
49+
:If gottatin
50+
:If {0::0 ⋄ ⎕NEXISTS ⍵}tatin_dir
51+
:Trap 11 ⍝ ListTatinPackages fails if there are none
52+
tatin←{2=⍴⍴⍵:(3↓⍵[;2])/3↓⍵[;1] ⋄ ⍬}ListTatinPackages path
53+
tatin←(' '=⊃¨tatin)↓¨tatin ⍝ leading space?
54+
:EndTrap
55+
:EndIf
56+
:EndIf
57+
r←(×≢¨nuget tatin)⌿2 2⍴'nuget: 'nuget'tatin:'tatin
58+
:If 0=≢r
59+
r←'No dependencies found'
60+
:EndIf
61+
→0
62+
:EndIf
63+
64+
:Select type
65+
:Case 'nuget'
66+
:If gotnuget∧(0≠≢package)∧type≡'nuget'
67+
r←NuGet.Add nuget_dir package
68+
→(∨/'error:'⍷⎕C r)⍴0
69+
:EndIf
70+
71+
:If ns≢0
72+
:If 2=⎕NC'ns'
73+
ns←⍎ns
74+
:EndIf
75+
'dotnet'ns.⎕NS''
76+
ns.dotnet.⎕USING←NuGet.Using nuget_dir
77+
r←((~load)/r,'. '),'NuGet dependencies established in ',(⍕ns),'.dotnet'
78+
:EndIf
79+
:Case 'tatin'
80+
r←⎕SE.Tatin.InstallPackages package tatin_dir
81+
:EndSelect
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Pr←ListNuGetPackages
2+
⍝Morten
3+
∘∘∘
4+
load←9=⎕NC'ns' ⍝ Project Space provided
5+
none←'No nuget dependencies registered.'
6+
type←⎕C type
7+
:If (~list∨load)∧0∊≢¨type package
8+
'syntax is ]Cider.Dependency nuget|tatin package [folder] -list'⎕SIGNAL 11
9+
:EndIf
10+
11+
:If ~∧/m←(gotnuget gottatin)←9=⌊⎕SE.⎕NC'NuGet' 'Tatin'
12+
⎕←'Warning: ',(⍕(~m)/'⎕SE.NuGet' '⎕SE.Tatin'),' not found - unable to report on or manage those dependencies.'
13+
:EndIf
14+
15+
:If gotnuget
16+
NuGet←⎕SE.NuGet
17+
:EndIf
18+
19+
:If ~load
20+
ns←path{3::0 ⋄ ⊃⍵[⍵[;2]⍳⊂⍺;1]}ListOpenProjects 0
21+
:EndIf
22+
config←Get_JSON5 configfile←path,'/cider.config'
23+
:If load∧~hasdeps←0≠⎕NC'config.CIDER.dependencies.nuget'
24+
→0⊣r←'' ⍝ Asked to load, and there are no nuget dependencies
25+
:EndIf
26+
27+
:If ~list∨load∨hasdeps∨~gotnuget
28+
config.CIDER.dependencies.nuget←'nuget-packages'
29+
config Put_JSON5 configfile
30+
:EndIf
31+
32+
nuget_dir←path,'/',{0::⍵ ⋄ config.CIDER.dependencies.nuget}'nuget-packages'
33+
tatin_dir←path,'/',config.CIDER.dependencies.tatin
34+
gotnuget←gotnuget∧~list∧~⎕NEXISTS nuget_dir ⍝ Pretend we have no nuget if listing and no folder
35+
36+
:If gotnuget∧type≡'nuget'
37+
r←NuGet.Setup nuget_dir
38+
→(∨/'error:'⍷⎕C r)⍴0
39+
:EndIf
40+
41+
:If list
42+
r←0 2⍴⊂nuget←tatin←''
43+
:If gotnuget
44+
:AndIf ⎕NEXISTS nuget_dir
45+
nuget←{⍵,(0=≢⍵)/none}NuGet.Packages nuget_dir
46+
nuget←{1↓∊'/',¨⍵}¨nuget
47+
:EndIf
48+
:If gottatin
49+
:If {0::0 ⋄ ⎕NEXISTS ⍵}tatin_dir
50+
:Trap 11 ⍝ ListTatinPackages fails if there are none
51+
tatin←{2=⍴⍴⍵:(3↓⍵[;2])/3↓⍵[;1] ⋄ ⍬}ListTatinPackages path
52+
tatin←(' '=⊃¨tatin)↓¨tatin ⍝ leading space?
53+
:EndTrap
54+
:EndIf
55+
:EndIf
56+
r←(×≢¨nuget tatin)⌿2 2⍴'nuget: 'nuget'tatin:'tatin
57+
:If 0=≢r
58+
r←'No dependencies found'
59+
:EndIf
60+
→0
61+
:EndIf
62+
63+
:Select type
64+
:Case 'nuget'
65+
:If gotnuget∧(0≠≢package)∧type≡'nuget'
66+
r←NuGet.Add nuget_dir package
67+
→(∨/'error:'⍷⎕C r)⍴0
68+
:EndIf
69+
70+
:If ns≢0
71+
:If 2=⎕NC'ns'
72+
ns←⍎ns
73+
:EndIf
74+
'dotnet'ns.⎕NS''
75+
ns.dotnet.⎕USING←NuGet.Using nuget_dir
76+
r←((~load)/r,'. '),'NuGet dependencies established in ',(⍕ns),'.dotnet'
77+
:EndIf
78+
:Case 'tatin'
79+
r←⎕SE.Tatin.InstallPackages package tatin_dir
80+
:EndSelect

APLSource/Cider/ListOpenProjects.aplf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
r←(0(2+2×verboseFlag))⍴''
44
res←⎕SE.Link.Status''
55
:If 'No active links'≢res
6-
:If 0<≢res←(∧/'Namespace' 'Directory' 'Files'∊res[1;])↓res ⍝ Will become superfluous with a proper Link API but don't do damage
6+
:If 0<≢res←(∧/'Namespace' 'Files'∊res[1;])↓res ⍝ Will become superfluous with a proper Link API but don't do damage
77
'Link demands a Resync!'Assert~∨/'Link.Resync required'⍷∊res
88
:AndIf 0<≢res←({⊃9=⍵.⎕NC'CiderConfig'}∘⍎¨res[;1])⌿res
9-
r←res[;,1],({6::'' ⋄ ⍎⍵,'.CiderConfig.HOME'}¨res[;1])
9+
r←res[;,1],({6::'' ⋄ (⍎⍵).CiderConfig.HOME}¨res[;1])
1010
:If verboseFlag
1111
r,←res[;3]
1212
:EndIf

0 commit comments

Comments
 (0)