Skip to content

Commit

Permalink
Default for checkPackageVersions chamnged to 0 in API
Browse files Browse the repository at this point in the history
  • Loading branch information
aplteam committed Sep 22, 2023
1 parent 8f47c77 commit 7fce99f
Show file tree
Hide file tree
Showing 728 changed files with 4,239 additions and 3,300 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ aplcore
CONTINUE.dws
conga.crash
/packages/*
/TestResults/
!/packages/apl-dependencies.txt
!/packages/apl-buildlist.json
/packages_dev/*
Expand Down
1 change: 1 addition & 0 deletions APLSource/Cider/API/AddNuGetDependencies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AddNuGetDependencies{##.AddNuGetDependencies }
3 changes: 1 addition & 2 deletions APLSource/Cider/API/GetAliasFileContent.aplf
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rGetAliasFileContent
r##.GetAliasFileContent
GetAliasFileContent{ ##.GetAliasFileContent }
1 change: 0 additions & 1 deletion APLSource/Cider/API/GetDependencies.aplf

This file was deleted.

1 change: 1 addition & 0 deletions APLSource/Cider/API/GetNuGetDependencies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GetNuGetDependencies{ ##.GetNuGetDependencies }
1 change: 1 addition & 0 deletions APLSource/Cider/API/GetTatinDependencies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GetTatinDependencies{ ##.GetTatinDependencies }
1 change: 1 addition & 0 deletions APLSource/Cider/API/ListNuGetDependencies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ListNuGetDependencies{##.ListNuGetDependencies }
1 change: 1 addition & 0 deletions APLSource/Cider/API/ListTatinDependencies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ListTatinDependencies{##.ListTatinDependencies }
2 changes: 1 addition & 1 deletion APLSource/Cider/API/ProjectConfig.aplf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ProjectConfig{ 1:shy ##.ProjectConfig }
ProjectConfig{1:shy##.ProjectConfig }
2 changes: 1 addition & 1 deletion APLSource/Cider/API/WriteProjectConfigFile.aplf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
WriteProjectConfigFile{ ##.WriteProjectConfigFile }
WriteProjectConfigFile{ 1:shy ##.WriteProjectConfigFile }
61 changes: 32 additions & 29 deletions APLSource/Cider/AddNuGetDependencies.aplf
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
rAddNuGetDependencies (packages path);NuGet;ns;config;nuget_dir;configfile
Either add one or more NuGet packages

listAddNuGetDependencies(packages projectFolder);NuGet;msg;cfg;nuGetFolder;package;buff;targetNamespace
Add one or more NuGet packages to the NuGet-folder define in the config file of `projectFolder`.
* `packages` must be either a nested vector with package names or a comma-separated list of package names
* `projectFolder` must carry a Cider config files used to establish the NuGet folder.\\
Returns a list with the names that got installed or at least updated.
:If 1=packages
packages{1¨(',;')}';',packages
packages','()packages
:EndIf
pathFilesAndDirs.EnforceSlash path

'Unable to locate NuGet API' ⎕SIGNAL (0NuGetFindNuGetAPI )/11
nspath{3::0 [[;2];1]}ListOpenProjects 0 namespace project loaded into
configGet_JSON5 configfilepath,'/cider.config'

:If 0=⎕NC 'config.CIDER.dependencies.nuget'
config.CIDER.dependencies.nuget'nuget-packages'
config Put_JSON5 configfile
:If IsAlias projectFolder
projectFolderGetFolderFromAlias2 projectFolder
:EndIf

nuget_dirpath,'/',{0:: config.CIDER.dependencies.nuget}'nuget-packages'

rNuGet.Setup nuget_dir
(/'error:'⎕C r)0

rNuGet.Add (nuget_dir),packages
(/'error:'⎕C r)0

:If ns0 We have a project namespace
:If 2=⎕NC 'ns'
nsns
:EndIf
'dotnet'ns.⎕NS''
ns.dotnet.⎕USINGNuGet.Using nuget_dir
r'NuGet dependencies established in ',(ns),'.dotnet'
'No Cider config file found'Assert F.Exists projectFolder,'/cider.config'
cfgReadProjectConfigFile projectFolder
nuGetFolderprojectFolder,'/',GetNuGetDependencyFolders cfg
targetNamespace''
:If '='buff2⎕NPARTS nuGetFolder
targetNamespace{'='}buff
nuGetFolder(-1+targetNamespace)nuGetFolder
:EndIf
:If 0<nuGetFolder
nuGetFolderFilesAndDirs.EnforceSlash nuGetFolder .NET requirement
{}⎕MKDIR(~⎕NEXISTS nuGetFolder)nuGetFolder
'Unable to locate NuGet API'Assert 0NuGetFindNuGetAPI
msgNuGet.Setup nuGetFolder
msg Assert~/'error:'⎕C msg
list''
:For package :In packages
:Trap 99
msgNuGet.Add(nuGetFolder),package
:If ~/'error:'⎕C msg
list,package
:EndIf
:EndTrap
:EndFor
:EndIf
Done
15 changes: 13 additions & 2 deletions APLSource/Cider/AddTatinDependencies.aplf
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
rAddTatinDependencies(packageIDs targetFolder)
Add one or more Tatin packages as dependencies
rAddTatinDependencies(packageIDs projectFolder dev);targetFolder;cfg;ref
Add one or more Tatin packages as dependencies.
`dev` is a flag that decides whether `dependencies` or `dependencies_dev` is the target.
:If 1<packageIDs
packageIDs1,/',',¨packageIDs
:EndIf
cfgReadProjectConfigFile projectFolder
:If dev
refcfg.CIDER.dependencies_dev
:Else
refcfg.CIDER.dependencies
:EndIf
targetFolderprojectFolder,'/',{¯1+'='}ref.tatin
r⎕SE.Tatin.InstallPackages packageIDs targetFolder
Done
2 changes: 1 addition & 1 deletion APLSource/Cider/CheckForTatinPackages.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* when the user goes for re-installing the packages, a 2 is returned
* when she does not a 3 is returned
status0
foldersGetTatinDepedencyFolders config
foldersGetTatinDependencyFolders config
:If 0<folders
folders{'=':¯1+'=' }¨folders
:AndIf 0<folders(0<¨folders)/folders
Expand Down
2 changes: 1 addition & 1 deletion APLSource/Cider/CheckPackagesStatus.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
1 means yes, check, but ask before updating
2 means update without further ado
r
foldersGetTatinDepedencyFolders config
foldersGetTatinDependencyFolders config
:If 0<folders
:If 0parms.checkPackageVersions
:AndIf 2>pkgStatus
Expand Down
2 changes: 1 addition & 1 deletion APLSource/Cider/CheckTargetNamespaceAndLinkFolder.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
:EndIf
:If parms.batch
With `batch` being true there is nothing we can do but throw an error
'Both the target and the source folder are not empty'Assert 0
('Both the target (',(ref),') and the source folder are not empty')Assert 0
:Else
:If C.YesOrNo'Target "',(ref),'" is not empty - recreate?'
⎕EXref It might be a class, so we first delete it...
Expand Down
2 changes: 1 addition & 1 deletion APLSource/Cider/CreateOpenParms.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
parms.verboseGetGlobalVerboseDefault
parms.batch0
parms.watch(1+HasDotNet)'ns' 'both'
parms.checkPackageVersions ⍬ means the user will be asked; 0 means don't. 1 means yes, check, but ask before updating, 2 means update
parms.checkPackageVersions0 ⍬ means the user will be asked; 0 means don't. 1 means yes, check, but ask before updating, 2 means update
:If ~(y)''
:AndIf 9=⎕NC'y'
:If 9=y.⎕NC'projectSpace'
Expand Down
2 changes: 1 addition & 1 deletion APLSource/Cider/CreateRefs.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
AAPLTreeUtils2
FFilesAndDirs
CCommTools
GAPLTreeUtils2
GAPLGit2
4 changes: 2 additions & 2 deletions APLSource/Cider/GetAliasFileContent.aplf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rGetAliasFileContent;filename;buff
r{filename}GetAliasFileContent dummy;filename;buff
r0 2''
filenameGetCiderAliasFilename
filename{0<⎕NC : GetCiderAliasFilename}'filename'
:If F.Exists filename
:AndIf 0<buffF.NGET filename 1
:AndIf 0<buff(0<¨buff)/buff
Expand Down
2 changes: 1 addition & 1 deletion APLSource/Cider/GetCiderGlobalConfigHomeFolder.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
and if so copies the content over.
This is a temporary measure since the parent for the .cider folder was changed on
Windows from APPDATA\ to the user's home directory.
Nothing changed on other platform
Nothing did change on other platforms.
:If 'Win'3A.GetOperatingSystem
:AndIf ~⎕NEXISTS folder,'config.json'
oldFolder(2 ⎕NQ #'GetEnvironment' 'APPDATA'),'/.cider/'
Expand Down
20 changes: 9 additions & 11 deletions APLSource/Cider/GetFolderFromAlias.aplo
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
parms(fns GetFolderFromAlias)parms;data;alias;msg;alias_;folder
Translates the alias in "folder" (if any) into a path from a parameter namespace.\\
If an alias is defined it is saved, possibly by overwriting the old one.
:If '[]'parms.folder[1,parms.folder]
aliasparms.folder~'[]'
Translates the alias in "folder" (if any) into a path from a parameter namespace and save
the folder in parms under the name "folder".\\
If the alias is unknown an error is thrown.\\
:If IsAlias parms.folder
alias1¯1parms.folder
folderGetFolderFromAlias2 alias
:If 0<folder
parms.folderfolder
:If 0=parms.alias
parms.aliasalias
:EndIf
:Else
(alias,'" is not a valid alias')⎕SIGNAL 11
('"',alias,'" is not a valid alias')Assert 0<folder
parms.folderfolder
:If 0=parms.alias
parms.aliasalias
:EndIf
:EndIf
15 changes: 8 additions & 7 deletions APLSource/Cider/GetFolderFromAlias2.aplf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
folderGetFolderFromAlias2 alias;filename;data
Translates the alias in "folder" (if any) into a path.\\
In case the alias does not exist an empty vector is returned.\\
If an alias is defined it is saved, possibly by overwriting the old one.
folder{globalAliasFilename}GetFolderFromAlias2 alias;data
Translates an alias (if any) into a folder.\\
In case no global alias file can be found an empty vector is returned.\\
If the alias cannot be found an error is thrown.\\
`globalAliasFilename` should only be specified by test cases
folder''
filenameGetCiderAliasFilename
:If F.Exists filename
:If 0<dataF.NGET filename 1
globalAliasFilename{0<⎕NC : GetCiderAliasFilename}'globalAliasFilename'
:If F.Exists globalAliasFilename
:If 0<dataF.NGET globalAliasFilename 1
data{'='()}¨data
alias⎕C alias~'[]'
:If (alias)data[;1]
Expand Down
9 changes: 9 additions & 0 deletions APLSource/Cider/GetNuGetDependencies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rname GetNuGetDependencies config;ref
Use this to return the content of "nuget" in either "dependencies" or "dependencies_dev" (defined by "name")
but an empty vector in case the "nuget" sub-key does not exist
r''
:If 0<config.CIDER.⎕NC name
refconfig.CIDER.name
:AndIf 0<ref.⎕NC'nuget'
r,ref'nuget'
:EndIf
8 changes: 8 additions & 0 deletions APLSource/Cider/GetNuGetDependencyFolders.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rGetNuGetDependencyFolders config
Returns a vector of two-item vectors with (path namespaceName) from the project `config` namespace.
`r` might be empty in case there are no Tatin dependencies, otherwise it is a vector character vectors
with relative path and optionally the name of a target namespace (separated by "=").
Returns a nested vector in case we extend it for development one day.
r''
r,'dependencies'GetNuGetDependencies config
r~''
2 changes: 1 addition & 1 deletion APLSource/Cider/GetProjectPath.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
path2list[index;]
:EndSelect
:Else
aliasDefsP.GetAliasFileContent
aliasDefsP.GetAliasFileContent
pathArgs._1
:If path'[?]'
:If 0=pathSelectFromAliases aliasDefs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
rname GetDependencies config;ref
rname GetTatinDependencies config;ref
Use this to return the content of "tatin" in either "dependencies" or "dependencies_dev" (defined by "name")
but an empty vector in case the "tatin" sub-key does not exist
r''
:If 0<config.CIDER.⎕NC name
refconfig.CIDER.name
:AndIf 0<ref.⎕NC'tatin'
r,ref'tatin'
:EndIf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
rGetTatinDepedencyFolders config
rGetTatinDependencyFolders config
Returns a vector of two-item vectors with (path namespaceName) from the project `config` namespace.
`r` might be empty in case there are no Tatin dependencies, otherwise it is a vector character vectors
with relative path and optionally the name of a target namespace (separated by "=").
r''
r,'dependencies'GetDependencies config
r,'dependencies_dev'GetDependencies config
r,'dependencies'GetTatinDependencies config
r,'dependencies_dev'GetTatinDependencies config
r~''
13 changes: 12 additions & 1 deletion APLSource/Cider/History.apla
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
(
'* 0.34.1 ⋄ 2023-09-15'
'* 0.35.0 ⋄ 2023-09-22'
' * User commands implemented:'
' * `]Cider.AddTatinDependencies`'
' * `]Cider.AddNuGetDependencies`'
' * `]Cider.ListTatinDependencies`'
' * `]Cider.ListNuGetDependencies`'
' * API equivalents for the newly introduced user commands implemented: `AddTatinDependencies`, '
' `AddNuGetDependencies`, `ListTatinDependencies`, `ListNuGetDependencies`'
' * `OpenProject` now loads NuGet dependencies, if any'
' * The default of `checkPackageVersions` in `CreateOpenParms` is now 0, preventing the API function from'
' asking the user. (The user command `OpenProject` will asign `⍬` however)'
' * `]Cider.UpdateCider` added as a user command, though the corresponding API function is still missing'
' * Bug fixes:'
' * There were refs missing in the user command script in case of DEVELOPMENT←1'
'* 0.34.0 ⋄ 2023-09-14'
Expand Down
8 changes: 8 additions & 0 deletions APLSource/Cider/InitPackage.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
InitPackage;⎕TRAP
Executed by Tatin when the Cider package is loaded
CreateRefs
:If 0
⎕TRAP0 'S'
∘∘∘ TODO⍝
:EndIf
Done
2 changes: 2 additions & 0 deletions APLSource/Cider/IsAlias.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rIsAlias path
r']['2¯1path
18 changes: 0 additions & 18 deletions APLSource/Cider/ListDependencies.aplf

This file was deleted.

22 changes: 13 additions & 9 deletions APLSource/Cider/ListNuGetDependencies.aplf
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
rListNuGetDependencies path;NuGet;nuget_dir
List NuGet Dependencies (what a useful comment!)

NuGetFindNuGetAPI ''
nuget_dirpath,'/',{0:: config.CIDER.dependencies.nuget}'nuget-packages'
:If ⎕NEXISTS nuget_dir
rNuGet.Packages nuget_dir
:Else
r'No dependencies found'
rListNuGetDependencies projectFolder;NuGet;cfg;nuGetFolder
r0 2''
NuGetFindNuGetAPI''
:If IsAlias projectFolder
projectFolderGetFolderFromAlias2 projectFolder
:EndIf
'No Cider config file found'Assert F.Exists projectFolder,'/cider.config'
cfgReadProjectConfigFile projectFolder
:If 0<nuGetFolderGetNuGetDependencyFolders cfg
nuGetFolder{~'='2⎕NPARTS : {,{¯1+'='}}/⎕NPARTS }nuGetFolder
:AndIf ⎕NEXISTS projectFolder,'/',nuGetFolder
:AndIf 0<F.ListFiles projectFolder,'/',nuGetFolder,'/*.csproj'
rNuGet.Packages projectFolder,'/',nuGetFolder
:EndIf
10 changes: 0 additions & 10 deletions APLSource/Cider/ListNuGetPackages.aplf

This file was deleted.

2 changes: 1 addition & 1 deletion APLSource/Cider/ListOpenProjects.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
r[;2]DropTrailingSlash¨r[;2]
r[;2]F.EnforceSlash¨r[;2]
:If verboseFlag
:If 0<aliasesGetAliasFileContent
:If 0<aliasesGetAliasFileContent
aliases[;2]DropTrailingSlash¨aliases[;2]
:AndIf 0<aliases(aliases[;2]r[;2])aliases
r,''
Expand Down
24 changes: 24 additions & 0 deletions APLSource/Cider/ListTatinDependencies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
rListTatinDependencies projectFolder;cfgFilename;cfg;buildFilenames;buildLists;b;tatinFolders;buildFolders
`y` must point to a project, either as alias ([]) or as a projectFolder.
The actualt Tatin dependency folders are established from the project config file.
r0 5''
:If IsAlias projectFolder
projectFolderGetFolderFromAlias2 projectFolder
:EndIf
cfgFilenameprojectFolder,'/cider.config'
'No Cider config file found'Assert F.Exists cfgFilename
cfgReadProjectConfigFile cfgFilename
tatinFoldersGetTatinDependencyFolders cfg
:If 0<tatinFolders
tatinFolders{¯1+'='}¨tatinFolders
buildFolders(projectFolder,'/'),¨tatinFolders
buildFilenamesbuildFolders,¨'/apl-buildlist.json'
bF.Exists¨buildFilenames
:AndIf 0<buildFilenamesb/buildFilenames
'"dependencies" and "dependencies_dev" do not point to existing folders'Assert/b
buildLists{⎕JSON('Dialect' 'JSON5')F.NGET }¨buildFilenames
r¨(¨' ',¨¨buildLists.packageID),¨buildLists.(principal url)
r(¨b/tatinFolders,¨'/'),¨r
r{,'? '[1+'https://tatin.dev/'¨[;4]]}¨r
r/r
:EndIf
Loading

0 comments on commit 7fce99f

Please sign in to comment.