Skip to content

Commit

Permalink
Added methods for compile and release
Browse files Browse the repository at this point in the history
  • Loading branch information
evshvarov committed Aug 3, 2017
1 parent b5248bd commit 6640598
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions sc.code.cls
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,40 @@ ClassMethod gln() [ CodeMode = expression, Private ]
"^"_$classname()
}



ClassMethod init()
{
#define confile "/cos.json"
set stream=##class(%Stream.FileCharacter).%New()
set sc=stream.LinkToFile(..workdir()_$$$confile)
s conf={}.%FromJSON(stream.Read($$$MaxCacheInt))
s gln=..gln()
s @gln@("compileList")=conf.compileList
s @gln@("projectName")=conf.projectName
w "compileList="_conf.compileList,!
w "projectName="_conf.projectName
}

/// export release file for list and project settings
ClassMethod release() {
s gln=..gln()
s list=$G(@gln@("compileList"))
if list="" w "Nothing to release. Run init method first" quit

s release=$G(@gln@("projectName"),"release")
s release=release_$p($zdt($h,8)," ")_$tr($p($p($zdt($h)," ",2),":",1,2),":")_".xml"
D $System.OBJ.Export(list,release)
w "All objects with mask "_list_" has been exported to "_release
}

ClassMethod compile() {
s gln=..gln()
s list=$G(@gln@("compileList"))
if list="" w "Nothing to compile. Run init method first" quit
d $System.OBJ.compile(list)
}

/// test.dfi -> /dfi/test.dfi
/// test.cls -> /cls/test.cls
/// testpkg.test.cls -> /cls/testpkg/test.cls
Expand Down Expand Up @@ -320,5 +354,6 @@ ClassMethod codets(codename, ext)
Q $p( ts, "." ) ;remove ms
}


}

0 comments on commit 6640598

Please sign in to comment.