@@ -597,6 +597,7 @@ private void doPublish(File fSource, File fOutput, JsonObject qa, String destina
597597 Date genDate , String username , String version , String gitSrcId , String tcName , String tcPath , PackageListEntry tcVer , String workingRoot , boolean jsonXmlClones , File igBuildZipDir , File previousPackageFile , String [] args , String replaces ) throws Exception {
598598 // ok. all our tests have passed.
599599 // 1. do the publication build(s)
600+ boolean dynamicPublishBox = pubSetup .getJsonObject ("website" ).asBoolean ("dynamic-publish-box" );
600601 List <String > existingFiles = new ArrayList <>();
601602 if (mode == PublicationProcessMode .CREATION ) {
602603 System .out .println ("All checks passed. Create an empty history at " +destination );
@@ -646,7 +647,7 @@ private void doPublish(File fSource, File fOutput, JsonObject qa, String destina
646647 System .out .println ("Update " +Utilities .path (destination , "package-list.json" ));
647648 PackageListEntry plVer = updatePackageList (pl , fSource .getAbsolutePath (), prSrc , pathVer , Utilities .path (destination , "package-list.json" ), mode , date ,
648649 npm .fhirVersion (), Utilities .pathURL (pubSetup .asString ("url" ), tcName ), subPackages , prSrc .asString ("previouslyPublishedAs" ));
649- updatePublishBox (pl , plVer , destVer , pathVer , destination , fRoot .getAbsolutePath (), false , ServerType .fromCode (pubSetup .getJsonObject ("website" ).asString ("server" )), sft , null , url , jsonXmlClones );
650+ updatePublishBox (pl , plVer , destVer , pathVer , destination , fRoot .getAbsolutePath (), false , ServerType .fromCode (pubSetup .getJsonObject ("website" ).asString ("server" )), sft , null , url , jsonXmlClones , dynamicPublishBox );
650651
651652 if (mode != PublicationProcessMode .WORKING || prSrc .has ("movedFrom" )) {
652653 String igSrc = tempM == null ? null : Utilities .path (tempM .getAbsolutePath (), "output" );
@@ -676,7 +677,7 @@ private void doPublish(File fSource, File fOutput, JsonObject qa, String destina
676677 String vCode = pv .substring (pv .lastIndexOf ("/" )+1 );
677678 String dv = Utilities .path (fRoot , relPath );
678679 System .out .println ("Update publish box for version " +v .version ()+" @ " +v .path ());
679- updatePublishBox (pl , v , dv , pv , destination , fRoot .getAbsolutePath (), false , null , null , null , url , jsonXmlClones );
680+ updatePublishBox (pl , v , dv , pv , destination , fRoot .getAbsolutePath (), false , null , null , null , url , jsonXmlClones , dynamicPublishBox );
680681 }
681682 }
682683 }
@@ -698,11 +699,11 @@ private void doPublish(File fSource, File fOutput, JsonObject qa, String destina
698699 }
699700 String vCode = tcPath .substring (tcPath .lastIndexOf ("/" )+1 );
700701 String dv = Utilities .path (destination , vCode );
701- updatePublishBox (pl , tcVer , dv , tcPath , destination , fRoot .getAbsolutePath (), false , null , null , null , url , jsonXmlClones );
702+ updatePublishBox (pl , tcVer , dv , tcPath , destination , fRoot .getAbsolutePath (), false , null , null , null , url , jsonXmlClones , dynamicPublishBox );
702703 }
703704 // we do this first in the output so we can get a proper diff
704705 if (igSrc != null ) {
705- updatePublishBox (pl , plVer , igSrc , pathVer , igSrc , fRoot .getAbsolutePath (), true , ServerType .fromCode (pubSetup .getJsonObject ("website" ).asString ("server" )), sft , null , url , jsonXmlClones );
706+ updatePublishBox (pl , plVer , igSrc , pathVer , igSrc , fRoot .getAbsolutePath (), true , ServerType .fromCode (pubSetup .getJsonObject ("website" ).asString ("server" )), sft , null , url , jsonXmlClones , dynamicPublishBox );
706707
707708 System .out .println ("Check for Files to delete" );
708709 List <String > newFiles = igSrc == null ? new ArrayList <>() : FileUtilities .listAllFiles (igSrc , null );
@@ -730,7 +731,7 @@ private void doPublish(File fSource, File fOutput, JsonObject qa, String destina
730731 ignoreList .add (Utilities .path (dpath , v .path ().substring (path .length ()+1 )));
731732 }
732733 }
733- updatePublishBox (pl , pl .current (), dpath , path , dpath , fRoot .getAbsolutePath (), true , null , null , ignoreList , url , jsonXmlClones );
734+ updatePublishBox (pl , pl .current (), dpath , path , dpath , fRoot .getAbsolutePath (), true , null , null , ignoreList , url , jsonXmlClones , dynamicPublishBox );
734735 }
735736 } else {
736737 src .cleanFolder (relDest );
@@ -1044,9 +1045,9 @@ public String presentDate(Date date) {
10441045 return sdf .format (date );
10451046 }
10461047
1047- private void updatePublishBox (PackageList pl , PackageListEntry plVer , String destVer , String pathVer , String destination , String rootFolder , boolean current , ServerType serverType , File sft , List <String > ignoreList , String url , boolean jsonXmlClones ) throws FileNotFoundException , IOException {
1048- IGReleaseVersionUpdater igvu = new IGReleaseVersionUpdater (destVer , url , rootFolder , ignoreList , null , plVer .json (), destination );
1049- String fragment = PublishBoxStatementGenerator .genFragment (pl , plVer , pl .current (), pl .canonical (), current , false );
1048+ private void updatePublishBox (PackageList pl , PackageListEntry plVer , String destVer , String pathVer , String destination , String rootFolder , boolean current , ServerType serverType , File sft , List <String > ignoreList , String url , boolean jsonXmlClones , boolean dynamicPublishBox ) throws FileNotFoundException , IOException {
1049+ IGReleaseVersionUpdater igvu = new IGReleaseVersionUpdater (destVer , url , rootFolder , ignoreList , null , plVer .json (), destination , dynamicPublishBox );
1050+ String fragment = PublishBoxStatementGenerator .genFragment (pl , plVer , pl .current (), pl .canonical (), current , false , dynamicPublishBox );
10501051 System .out .println ("Publish Box Statement: " +fragment );
10511052 igvu .updateStatement (fragment , current ? 0 : 1 , pl .milestones ());
10521053 System .out .println (" .. " +igvu .getCountTotal ()+" files checked, " +igvu .getCountUpdated ()+" updated" );
@@ -1343,7 +1344,7 @@ private List<ValidationMessage> processWithdrawal(String source, String web, Str
13431344 String vCode = pv .substring (pv .lastIndexOf ("/" )+1 );
13441345 String dv = Utilities .path (destination , vCode );
13451346 System .out .println ("Update publish box for version " +v .version ()+" @ " +v .path ());
1346- updatePublishBox (pl , v , dv , pv , destination , fRoot .getAbsolutePath (), false , null , null , null , url , false );
1347+ updatePublishBox (pl , v , dv , pv , destination , fRoot .getAbsolutePath (), false , null , null , null , url , false , pubSetup . getJsonObject ( "website" ). asBoolean ( "dynamic-publish-box" ) );
13471348 }
13481349 }
13491350
0 commit comments