Skip to content

Commit b486e56

Browse files
committed
Several bug fixes
1 parent 92a13ce commit b486e56

File tree

84 files changed

+5677
-82
lines changed

Some content is hidden

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

84 files changed

+5677
-82
lines changed

APLSource/Cider/Cider.dyalog

Lines changed: 72 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99

1010
rVersion;fully
1111
:Access Public Shared
12-
r'0.31.1+410'
12+
r'0.32.0+410'
13+
* 0.32.0 ⋄ 2023-08-25
14+
* `APLGit2` is now part of `Cider` and therefore always available
15+
* Bug fixes
16+
* The function `GetCiderGlobalConfigHomeFolder` crashed when Cider was not properly installed
17+
* Loading Tatin packages did not act appropriately when there were packages installed but they
18+
did not fit to the dependency list and/or the build list
19+
* Inconsistencies between the build list and the dependency file were not discovered. Now Cider
20+
does a re-install if the user permits that.
21+
* It was possible to load a package and then open it as a project; this is now prevented
1322
* 0.31.1 ⋄ 2023-08-05
14-
* The function `GetCiderGlobalConfigHomeFolder` crashed when Cider was not properly installed
15-
* The absence of APLGit2 is now reported by OpenProject in case the project is managed by Git
1623
* Version 0.30.0 wrongly pretended to be a beta release when it wasn't
1724
* 0.31.0 ⋄ 2023-08-04
1825
* Step added to `OpenProject`: checks for a non-empty variable `ToDo` in the root of the project now
@@ -175,7 +182,9 @@
175182
:EndTrap
176183
:EndIf
177184
:Trap 0
178-
{}LoadTatinPackages config parms.folder(projectSpace_)
185+
:If 0=parms.quietFlag LoadTatinPackages config parms.folder(projectSpace_)
186+
1 pFrame'Package folder ',parms.folder,' needs attention!'
187+
:EndIf
179188
:Else
180189
qdmx⎕DMX
181190
buff''
@@ -233,7 +242,7 @@
233242
This function looks for "tatinFolder", and if it is found suggests an automated conversion.
234243
It expects to find either a single comma or no comma at all in "tatinFolder", otherwise it throws an error.
235244
II.
236-
The property `githubUsername` is deleted from the config file because is not used anymore
245+
The property `githubUsername` is deleted from the config file because it is not used anymore
237246
III.
238247
With version 0.26.0 the property `distributionFolder` was introduced.
239248
If not found it is injected as an empty character vector.
@@ -547,42 +556,35 @@
547556
p' All fine'
548557
549558

550-
{r}CheckForGit(path config);status;dmx;success
559+
{r}CheckForGit(path config);status;dmx
551560
Checks whether the project is managed by Git, and if so offers some help
552561
r
553-
success0
554562
:If ##.FilesAndDirs.Exists(AddSlash path),'.git'
555-
:If 9=⎕SE.⎕NC'APLGit2'
556-
:Trap 0
557-
status⎕SE.APLGit2.Status path
558-
success1
559-
:Else
560-
dmx⎕DMX
561-
:If 127=dmx.EN
562-
p'The project appears to be managed by Git but Git is not installed?!'
563-
:ElseIf 128=dmx.EN
564-
p'The project appears to be managed by Git but user.email and/or user.name are not defined'
565-
:ElseIf 0<dmx.Message
566-
'The Git status of the project could not be determined due to an error:'
567-
dmx.Message,'; rc=',dmx.EN
568-
:Else
569-
'The Git status of the project could not be determined due to an error'
570-
:EndIf
571-
:EndTrap
572-
:If success
573-
:If //¨'nothing to commit' 'working tree clean'¨status
574-
:AndIf ~//¨'on branch main' 'on branch master'¨⎕Cstatus
575-
'Git: ',(1status),', ',{,', ',}/1status
576-
:Else
577-
status((,[0.5]'Git status report')'='),status
578-
{{}(#.⎕NS'').(⎕ED('ReadOnly' 1)&{'GIT_Status_Report'}GIT_Status_Report)}status
579-
:EndIf
563+
:Trap 0
564+
status##.APLGit2.Status path
565+
:Else
566+
dmx⎕DMX
567+
:If 127=dmx.EN
568+
p'The project appears to be managed by Git but Git is not installed?!'
569+
:Return
570+
:ElseIf 128=dmx.EN
571+
p'The project appears to be managed by Git but user.email and/or user.name are not defined'
572+
:Return
573+
:ElseIf 0<dmx.Message
574+
'The Git status of the project could not be determined due to an error:'
575+
dmx.Message,'; rc=',dmx.EN
576+
:Return
580577
:Else
581-
p'The project appears to be managed by Git but the user command ]APLGit2 and'
582-
p'it''s API are missing, therefore no information can be provided regarding Git'
578+
'The Git status of the project could not be determined due to an error'
579+
:Return
583580
:EndIf
581+
:EndTrap
582+
:If //¨'nothing to commit' 'working tree clean'¨status
583+
:AndIf ~//¨'on branch main' 'on branch master'¨⎕Cstatus
584+
'Git: ',(1status),', ',{,', ',}/1status
584585
:Else
585-
p'The project appears to be managed by Git, but the package "APLGit2" is not installed...'
586+
status((,[0.5]'Git status report')'='),status
587+
{{}(#.⎕NS'').(⎕ED('ReadOnly' 1)&{'GIT_Status_Report'}GIT_Status_Report)}status
586588
:EndIf
587589
:EndIf
588590
@@ -704,13 +706,14 @@
704706
:EndFor
705707
706708

707-
{r}LoadTatinPackages(config folder projectSpace);pkgFolders;pkgFolder;folder2;target;pkgFolder_;noOf;p
709+
{r}quiet LoadTatinPackages(config folder projectSpace);pkgFolders;pkgFolder;folder2;target;pkgFolder_;noOf;qdmx;q;parms;p
708710
Load all installed packages (if any) into their designated host namespaces.
709-
rFAILURE
710-
p{~parms.quietFlag PrintToSession }
711+
rSUCCESS
711712
pkgFoldersGetTatinDepedencyFolders config
713+
pquiet{ PrintToSession }
712714
:If 0<pkgFolders
713715
:For pkgFolder :In pkgFolders
716+
∆Retry:
714717
:If '='pkgFolder
715718
(pkgFolder_ target)SplitTatinFolders pkgFolder
716719
'Target namespace for Tatin packages is addressed with absolute path (invalid)'Assert~(target)'#⎕'
@@ -724,15 +727,42 @@
724727
:If ##.FilesAndDirs.Exists folder2
725728
:If 0<0<0 ⎕NINFO('Wildcard' 1)folder2,'/*'
726729
p ReportPackageOrigins folder2
727-
noOf⎕SE.Tatin.LoadDependencies folder2 target
728-
p(noOf),' Tatin package',((1<noOf)/'s'),' loaded'
730+
:Trap 0
731+
noOf⎕SE.Tatin.LoadDependencies folder2 target
732+
p(noOf),' Tatin package',((1<noOf)/'s'),' loaded'
733+
:Else
734+
qdmx⎕DMX
735+
:If 998=qdmx.EN
736+
:If //¨'The build list in ' ' that are not installed:'¨qdmx.EM
737+
q'ReinstallBecauseOfInconsistency@The installed packages don''t fit the dependency/build list file(s); re-install?'
738+
:If YesOrNo q
739+
parms⎕SE.Tatin.CreateReInstallParms
740+
{}parms ⎕SE.Tatin.ReInstallDependencies folder2
741+
∆Retry
742+
:Else
743+
p'*** Packages in ',folder2,' need attention!'
744+
:EndIf
745+
:ElseIf /'Invalid entry:'qdmx.EM
746+
q'ReinstallBecauseOfInvalidPkg@There are invalid entries in the dependency list; re-install?'
747+
:If YesOrNo q
748+
⎕SE.Tatin.ReInstallDependencies folder2
749+
∆Retry
750+
:Else
751+
p'*** Packages in ',folder2,' need attention!'
752+
rFAILURE
753+
:EndIf
754+
:Else
755+
p'*** ',qdmx.EM
756+
rFAILURE
757+
:EndIf
758+
:EndIf
759+
:EndTrap
729760
:Else
730761
p'Tatin installation folder "',folder2,'" is empty, therefore no packages loaded'
731762
:EndIf
732763
:Else
733764
p'Tatin installation folder "',folder2,'" does not exists, therefore no packages loaded'
734765
:EndIf
735-
rSUCCESS
736766
:EndFor
737767
:EndIf
738768
@@ -1403,6 +1433,7 @@
14031433
be empty, otherwise an error is thrown.
14041434
:If (⎕NCref)9.1 9.4 9.5
14051435
nsIsEmpty0=' '~¨ref.⎕NL16
1436+
'Cannot open, is already loaded as a package'Assert'_tatin'{¯1+'.'}{'.'}ref
14061437
:If 0=##.FilesAndDirs.Exists parms.folder,'/',source
14071438
folderIsEmpty1
14081439
:Else

APLSource/TestCases/Initial.aplf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
∆LINK_NOTIFY_WAS←⎕SE.Link.NOTIFY
33
⎕SE.Link.NOTIFY←0
44
'Cider''s version number in # and ⎕SE diverge'Assert ⎕SE.Cider.Version≡##.Cider.Cider.Version
5+
⍝ T.exec_before_each_test←T.exec_after_each_test←'#.WS_Check'
56
⍝Done

APLSource/TestCases/Test_Misc_010.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:EndIf
88
r←T._Failed
99

10-
0 0⍴⍞,0/⎕←'This test needs you! Simply close the editor window after pressing <enter>. Press <enter> to continue.'
10+
CommTools.Pause'This test needs you! Simply close the editor window after pressing <enter>. Press <enter> to continue.'
1111

1212
filename←##.CiderConfig.HOME,'/cider.config'
1313
buff←⊃⎕NGET filename
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
R←Test_Open_082(stopFlag batchFlag);⎕TRAP;parms;r;rc;tempDir
2+
⍝ Tries to open a project that has packages but the installed packages and the build list don't fit
3+
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
4+
R←T._Failed
5+
6+
tempDir←FilesAndDirs.GetTempSubDir⊃⎕SI
7+
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS''
8+
tempDir ⎕NCOPY⍠('Wildcard' 1)⊣##.CiderConfig.HOME,'/TestData/PksDontFitBuildList/*'
9+
10+
parms←##.Cider.Cider.CreateOpenParms ⍬
11+
parms.folder←tempDir
12+
parms.parent←'#.TEMP'
13+
parms.watch←'ns'
14+
parms.quietFlag←1
15+
parms.ignoreUserExec←1
16+
17+
##.Cider.CommTools.YesOrNo_Answers←1 2⍴'ReinstallBecauseOfInvalidPkg@' 'y'
18+
{}##.Cider.Cider.OpenProject parms
19+
→T.GoToTidyUp'#._tatin.aplteam_Tester2_3_5_0.Tester2'≢⍕#.TEMP.fooproj.Tester2 ⍝ VALUE ERROR? Try again, but execute stuff after ∆TidyUp
20+
→T.GoToTidyUp'#._tatin.aplteam_CodeCoverage_0_7_3.CodeCoverage'≢⍕#.TEMP.fooproj.CodeCoverage
21+
22+
R←T._OK
23+
24+
∆TidyUp:
25+
##.Cider.CommTools.Cleanup
26+
{}##.Cider.Cider.CloseProject'#.TEMP.fooproj'
27+
{}FilesAndDirs.RmDirByForce tempDir
28+
⍝Done
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
R←Test_Open_083(stopFlag batchFlag);⎕TRAP;parms;r;rc;qdmx
2+
⍝ Loads a package and then tries to open the corresponding project; must be prevented
3+
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
4+
R←T._Failed
5+
6+
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS''
7+
{}⎕SE.Tatin.LoadPackages(##.CiderConfig.HOME,'\TestData\APLTreeUtils2\aplteam-APLTreeUtils2-1.2.0.zip')'#.TEMP'
8+
9+
parms←##.Cider.Cider.CreateOpenParms ⍬
10+
parms.folder←##.CiderConfig.HOME,'\TestData\APLTreeUtils2\APLTreeUtils2'
11+
parms.parent←'#.TEMP'
12+
parms.watch←'ns'
13+
parms.quietFlag←1
14+
parms.ignoreUserExec←1
15+
16+
:Trap 11
17+
{}##.Cider.Cider.OpenProject parms
18+
→T.PassesIf 0
19+
:Else
20+
qdmx←⎕DMX
21+
→T.PassesIf'Cannot open, is already loaded as a package'≡qdmx.EM
22+
:EndTrap
23+
24+
R←T._OK
25+
⍝Done

APLSource/TestCases/Test_Tatin_001.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
44
R←T._Failed
55

6-
'TEMP'#.⎕NS''
6+
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS''
77
folder←∆GetTestPath⊃⎕SI
88

99
parms←⎕NS''

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Cider offers some User commands that are useful to manage projects. In addition is also offers an API.
77

8-
It cooperates with [Tatin](https://github.com/aplteam.Cider "Link to Cider on GitHub") and [APLGit2](https://github.com/aplteam.APLGit2 "Link to APLGit2 on GitHub") if available.
8+
It cooperates with [Tatin](https://github.com/aplteam.Cider "Link to Cider on GitHub") if available.
99

1010

1111
## Requirements
@@ -68,7 +68,7 @@ If that is not good enough for you, this article explains how to load user comma
6868
## Methods
6969

7070

71-
### OpenProject
71+
### `OpenProject`
7272

7373

7474
#### Parameters
@@ -103,7 +103,8 @@ Once a folder is established that holds a Cider config file, the user command pe
103103
* adds a variable `HOME` that remembers the path the project was loaded from
104104
1. Injects a namespace `TatinVars` in case the project would end up as a package
105105
1. Checks whether the project's config file does carry a non-empty value for `init`. If that's the case it must be a function that is then called by Cider, typically for initializing the project
106-
1. If the project is managed by Git and the user command `]APLGit` is around and the git bash is installed then Cider executes the `git status` command on the project folder and puts the result on view
106+
1. If there is a variable `ToDo` in the root of the project, and the variable is not empty, then this variable is printed to the session
107+
1. If the project is managed by Git then Cider executes the `git status` command on the project folder and puts the result on view
107108

108109
Notes:
109110

@@ -131,7 +132,7 @@ Notes:
131132

132133
* All principal packages found in `packages_dev/` within the project folder are loaded into the project's sub namespace `TestCases` within the project space because the default _was_ overwritten
133134

134-
### CloseProject
135+
### `CloseProject`
135136

136137
Takes one or more folders or a aliases and breaks the Link between the namespace and its folder for all of them.
137138

@@ -140,45 +141,46 @@ Separate projects with space or commas.
140141
You may specify the `-all` flag to close all projects in `#` (*not* `⎕SE`!), but check the user command's detailed help (`-??`) for details.
141142

142143

143-
### CreateProject
144+
### `CreateProject`
144145

145146
Requires one mandatory parameter: a folder that is going to be a project.
146147

147148
Creates a file `cider.config` in that folder.
148149

149150

150-
### Help
151+
### `Help`
151152

152153
Offers the user to view selected or all HTML documents with her standard browser.
153154

154-
### ListOpenProjects
155+
### `ListOpenProjects`
155156

156157
Lists the project spaces of all currently linked projects together with the fully qualified paths of all projects currently open.
157158

158159

159-
### ListAliases
160+
### `ListAliases`
160161

161162
Lists all Cider aliases together with their folders.
162163

163164

164-
### Make
165+
### `Make`
165166

166167
Prints an APL statement to the session which, when executed, will build a new version of the project.
167168

168169

169-
### RunTests
170+
### `RunTests`
170171

171172
Prints an APL statement to the session which, when executed, runs the project's test suite.
172173

173174

174-
### Version
175+
### `Version`
175176

176177
Returns a three-item-vector with "Name", "Version number" and "Version date".
177178

178179

179-
### ViewConfig
180+
### `ViewConfig`
180181

181182
Puts the config file of a project on display.
182183

183184
By specifying the `-edit` flag the user might edit the file rather than just viewing it.
184185

186+

0 commit comments

Comments
 (0)