Skip to content

Commit

Permalink
Merge pull request doublefint#17 from evshvarov/master
Browse files Browse the repository at this point in the history
added cubes export
  • Loading branch information
evshvarov authored Jul 12, 2021
2 parents 91775e9 + e572da7 commit 9ba7573
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ ARG IMAGE=store/intersystems/irishealth:2019.3.0.308.0-community
ARG IMAGE=store/intersystems/iris-community:2019.3.0.309.0
ARG IMAGE=store/intersystems/iris-community:2019.4.0.379.0
ARG IMAGE=store/intersystems/iris-community:2020.1.0.199.0
# ARG IMAGE=intersystemsdc/iris-community:2019.4.0.383.0-zpm
ARG IMAGE=intersystemsdc/iris-community:2020.4.0.524.0-zpm
ARG IMAGE=intersystemsdc/iris-community
FROM $IMAGE

USER root
Expand Down
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Document name="isc-dev.ZPM">
<Module>
<Name>isc-dev</Name>
<Version>1.4.1</Version>
<Version>1.4.2</Version>
<Description>Export/Import InterSystems Data Platform development artefacts</Description>
<SourcesRoot>src</SourcesRoot>
<Packaging>module</Packaging>
Expand Down
File renamed without changes.
46 changes: 41 additions & 5 deletions src/cls/dev/code.cls → src/dev/code.cls
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/// Export different types of modules in different subfolders in UDL (plain) format
/// test.dfi -> /dfi/test.dfi
/// testpkg.test.cls -> /cls/testpkg/test.cls
/// testpkg.test.cls -> /testpkg/test.cls
Class dev.code [ Abstract ]
{

Parameter version = "1.2.0";
Parameter version = "1.4.0";

/// export all available code
ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0, dfi = 0)
Expand Down Expand Up @@ -98,12 +98,49 @@ ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0
set rs=""

#;DeepSee artefacts
do ..exportCubes()
do ..exportDeepSeeArtefacts()
write !,!, "#; Exported to ", ..workdir()

return $$$OK
}

/// Export Cube Classes
ClassMethod exportCubes() As %Status
{
#define export(%code, %file) set sc = $system.OBJ.ExportUDL(%code, %file,"/diffexport") ##continue
write:sc "Ok" do:'sc $system.OBJ.DisplayError(sc)
#define isMapped(%code) ##class(%RoutineMgr).IsMapped( %code )
#define isPercented(%code) ("%" = $e(%code))
#define isCube(%code) $classmethod(%code,"%Extends","%DeepSee.CubeDefinition")

#define log write !, code, " -> ", $piece(filename,..workdir(),2), " "

Set sc = $$$OK
#; classes
set rs = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")
if rs.Execute()
{
while rs.%Next()
{
set code = rs.Name _ ".cls", isSystem = rs.System
if isSystem continue
if $$$isPercented( code ) continue
if $$$isMapped( code ) continue

if '($classmethod(rs.Name,"%Extends","%DeepSee.CubeDefinition")) continue
set filename = ..filename( code )
do ..mkdir( filename )
$$$log
$$$export( code, filename )
}
set rs=""
}


Return sc
}

/// import all from workdir
ClassMethod import(filemask = "*.xml;*.cls;*.mac;*.int;*.inc;*.dfi", qspec = "cku-d", ByRef err = "", recurse = 1, ByRef loaded = "", verbose = 1) As %Status
{
Expand Down Expand Up @@ -382,8 +419,8 @@ ClassMethod filename(code)

set ext = $p( code, ".", * ), ext = $zcvt( ext, "l" )
#; for each type - different directory

set:ext'="" wd = ##class(%File).NormalizeDirectory( ext, wd )
#; except cls,int,inc,mac
if ext'="cls",ext'="mac",ext'="int",ext'="inc",ext'="" set wd = ##class(%File).NormalizeDirectory( ext, wd )

#; directory must exist before any call (%File).NormalizeFilename( , wd)
if '##class(%File).DirectoryExists( wd )
Expand Down Expand Up @@ -560,4 +597,3 @@ ClassMethod checkMasks(name As %String, masks As %String) As %Boolean
}

}

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9ba7573

Please sign in to comment.