@@ -1729,16 +1729,17 @@ ClassMethod BuildCEInstallationPackage(ByRef destination As %String) As %Status
1729
1729
{
1730
1730
#define sourcedir $System .Util .InstallDirectory ()_" devuser/studio/templates/gitsourcecontrol/"
1731
1731
#define sourcedirstr ##Quote ($$$sourcedir )
1732
- #define exportGBLString " GitSourceControlProjectExport"
1732
+ #define exportGBLString " || GitSourceControlProjectExport"
1733
1733
#define exportGBLDoc $$$exportGBLString _" .GBL"
1734
- #define exportGBL ##Expression (" ^|| " _$$$exportGBLString )
1734
+ #define exportGBL ##Expression (" ^" _$$$exportGBLString )
1735
1735
#define exportGBLName $Name ($$$exportGBL )
1736
- #define exportGBLNameQ ##Quote (" ^|| " _$$$exportGBLString )
1736
+ #define exportGBLNameQ ##Quote (" ^" _$$$exportGBLString )
1737
1737
1738
1738
new %sourcedirstr
1739
1739
set sc = $$$OK
1740
1740
try {
1741
1741
set projectName = " GitSourceControl_CE"
1742
+ set exportSpec = " /keepsource/exportversion=2016.2/diffexport"
1742
1743
1743
1744
// Main project
1744
1745
set destination = $Get (destination ,##class (%Library.File ).NormalizeFilename (projectName _" .xml" ))
@@ -1763,50 +1764,42 @@ ClassMethod BuildCEInstallationPackage(ByRef destination As %String) As %Status
1763
1764
do archive .AddToProject (project )
1764
1765
1765
1766
kill $$$exportGBL
1766
- $$$ThrowOnError(project .ExportToStream (" /exportversion=2016.2/diffexport" ,0 ))
1767
- Set gblStream = ##class (%Stream.GlobalCharacter ).%New ($$$exportGBLName)
1768
- $$$ThrowOnError(gblStream .CopyFromAndSave (project .Stream ))
1767
+ $$$ThrowOnError(project .ExportToStream (exportSpec ,0 ))
1769
1768
1770
1769
// Installer automation
1771
- set code ($i (code )) = " #include %occInclude "
1772
- set code ($i (code )) = " Set stream = ##class(%Stream.GlobalCharacter).%Open($ListBuild(1, " " " " ," _$$$exportGBLNameQ_ " ) ,,.sc)"
1770
+ set code ($i (code )) = " New %ISCName set %ISCName = " " GitSourceControlInstaller " " "
1771
+ set code ($i (code )) = " Set xdata = ##class(%Dictionary.XDataDefinition).IDKEYOpen( " " SourceControl.Git.Installer " " ," " Payload " " ,,.sc)"
1773
1772
set code ($i (code )) = " $$$ThrowOnError(sc)"
1774
- set code ($i (code )) = " $$$ThrowOnError($System.OBJ.LoadStream(stream ," " ck" " ))"
1773
+ set code ($i (code )) = " $$$ThrowOnError($System.OBJ.LoadStream(xdata.Data ," " ck/nomulticompile " " ))"
1775
1774
do archive .GenerateInstallerCode ($$$sourcedirstr,.code )
1776
1775
set code ($i (code )) = " Do ##class(SourceControl.Git.Utils).Localize()"
1777
1776
set code ($i (code )) = " Write !!"
1778
1777
set code ($i (code )) = " Do ##class(SourceControl.Git.Utils).OutputConfigureMessage()"
1779
-
1780
- // Wrapper project
1781
- if ##class (%Studio.Project ).%ExistsId (projectName _" Wrapper" ) {
1782
- $$$ThrowOnError(##class (%Studio.Project ).%DeleteId (projectName _" Wrapper" ))
1778
+
1779
+ // Put installer automation in class
1780
+ do $System .OBJ .Delete (" SourceControl.Git.Installer.CLS" ," -d" )
1781
+ set class = ##class (%Dictionary.ClassDefinition ).%New ()
1782
+ set class .Name = " SourceControl.Git.Installer"
1783
+ set class .IncludeGenerator = " %occInclude"
1784
+ set method = ##class (%Dictionary.MethodDefinition ).%New ()
1785
+ set method .Name = " Run"
1786
+ set method .CodeMode = " objectgenerator"
1787
+ for i =1 :1 :code {
1788
+ do method .Implementation .WriteLine (code (i ))
1783
1789
}
1784
- set wrapper = ##class (%Studio.Project ). %New ( )
1785
- set wrapper . Name = projectName _ " Wrapper "
1790
+ do method . Implementation . WriteLine ( " job ##class(%SYSTEM.OBJ).Delete( " " SourceControl.Git.Installer.CLS " " ) " )
1791
+ do class . Methods . Insert ( method )
1786
1792
1787
- // Export of main project
1788
- do wrapper .AddItem ($$$exportGBLDoc)
1793
+ // Put payload in XData block
1794
+ set xdata = ##class (%Dictionary.XDataDefinition ).%New ()
1795
+ set xdata .Name = " Payload"
1796
+ do xdata .Data .CopyFrom (project .Stream )
1797
+ do class .XDatas .Insert (xdata )
1789
1798
1790
- // Installer routine
1791
- if ##class (%Library.Routine ).Exists (" INSTALL.MAC" ) {
1792
- $$$ThrowOnError(##class (%Library.Routine ).Delete (" INSTALL.MAC" ))
1793
- }
1794
- set routine = ##class (%Routine ).%New (" INSTALL.MAC" )
1795
- for i =1 :1 :code {
1796
- do routine .WriteLine (" " _code (i ))
1797
- }
1798
- $$$ThrowOnError(routine .Save ())
1799
- $$$ThrowOnError(routine .Compile (" -d" ))
1800
- do wrapper .AddItem (" INSTALL.MAC" )
1801
-
1802
- // Deploy to a file
1803
- $$$ThrowOnError(wrapper .%Save ())
1804
- kill ^||%pkg
1805
- set minVersion = " 2016.2"
1806
- set spec = " /keepsource/exportversion=" _minVersion _" /diffexport"
1807
- $$$ThrowOnError(wrapper .Deploy (" " ,spec ,,," ^||%pkg" ,0 ))
1808
- set ^||%pkg (" VERSION" ) = minVersion
1809
- $$$ThrowOnError($$ExportXMLList ^%apiOBJ (" ^||%pkg.gbl" ,destination ,spec ))
1799
+ $$$ThrowOnError(class .%Save ())
1800
+
1801
+ $$$ThrowOnError($System .OBJ .Export (class .Name _" .CLS," _$$$exportGBLDoc,destination ,exportSpec ))
1802
+ $$$ThrowOnError($System .OBJ .Delete (" SourceControl.Git.Installer.CLS" ))
1810
1803
} catch e {
1811
1804
set sc = e .AsStatus ()
1812
1805
}
0 commit comments