Skip to content

Commit

Permalink
Merge branch 'develop' into FixLCC_Escalataion_6144
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGlazer committed Aug 21, 2019
2 parents 73bad95 + 9da7214 commit e6f4881
Show file tree
Hide file tree
Showing 225 changed files with 115,230 additions and 119,807 deletions.
32 changes: 11 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ include(cmake/CompilerFlags.cmake)

INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/btwxt/src )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/re2 )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/doj )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/nlohmann )
Expand Down Expand Up @@ -161,14 +162,16 @@ set(RE2_BUILD_TESTING OFF CACHE BOOL "" FORCE)
if( BUILD_TESTING )
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(BUILD_GTEST ON CACHE BOOL "" FORCE)
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
option( TEST_ANNUAL_SIMULATION "Use annual simulations for tests instead of only design days" OFF )
enable_testing()
include(CTest)
ADD_SUBDIRECTORY(third_party/gtest)
endif()

# E+ required libraries
ADD_SUBDIRECTORY(idd)

ADD_SUBDIRECTORY(third_party/SQLite)
ADD_SUBDIRECTORY(third_party/ObjexxFCL)
ADD_SUBDIRECTORY(third_party/BCVTB)
Expand All @@ -177,14 +180,17 @@ ADD_SUBDIRECTORY(third_party/FMI)
ADD_SUBDIRECTORY(third_party/zlib)
ADD_SUBDIRECTORY(third_party/DElight)
ADD_SUBDIRECTORY(third_party/re2)

ADD_SUBDIRECTORY(scripts/dev/generate_embeddable_epJSON_schema)
IF( NOT APPLE )
ADD_SUBDIRECTORY(third_party/FMUParser)
ENDIF()
ADD_SUBDIRECTORY(third_party/Windows-CalcEngine)
if( BUILD_TESTING )
ADD_SUBDIRECTORY(third_party/gtest)
endif()

# Btwxt
INCLUDE_DIRECTORIES( ${gtest_SOURCE_DIR}/include/ SYSTEM )
set(BUILD_BTWXT_TESTING ${BUILD_TESTING} CACHE BOOL "" FORCE)
ADD_SUBDIRECTORY(third_party/btwxt)

# Kiva
INCLUDE(third_party/cmake/kiva.cmake)
Expand Down Expand Up @@ -243,23 +249,7 @@ if( BUILD_FORTRAN )
endif()

if( BUILD_PACKAGE )
set(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR};EnergyPlus;ALL;/"
)

if( BUILD_FORTRAN )
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/ExpandObjects/;ExpandObjects;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/ReadVars/;ReadVars;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/Transition/;Transition;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/Basement/;Basement;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/HVAC-Diagram/;HVAC-Diagram;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/ParametricPreprocessor/;ParametricPreprocessor;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/Slab/;Slab;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/ConvertESOMTR/;ConvertESOMTR;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/CalcSoilSurfTemp/;CalcSoilSurfTemp;ALL;/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}/src/AppGPostProcess/;AppGPostProcess;ALL;/")
endif()

# We handle everything in a dedicated cmake file
include(cmake/Install.cmake)
endif()

Expand Down
262 changes: 243 additions & 19 deletions cmake/Install.cmake

Large diffs are not rendered by default.

35 changes: 0 additions & 35 deletions cmake/install_operations.qs

This file was deleted.

File renamed without changes.
88 changes: 88 additions & 0 deletions cmake/qtifw/install_operations.qs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Regular install commands to be performed
function Component()
{
Component.prototype.createOperations = function()
{
// call default implementation
component.createOperations();

// ... add custom operations

var kernel = systemInfo.kernelType;
if( kernel == "darwin" ) {

// Chmod +x for apps
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.app/Contents/MacOS/IDFVersionUpdater");
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PreProcess/EP-Launch-Lite.app/Contents/MacOS/EP-Launch-Lite");
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PreProcess/EP-Launch-Lite.app/Contents/MacOS/python");
component.addOperation("Execute", "chmod", "+x", "@TargetDir@/PostProcess/EP-Compare/EP-Compare.app/Contents/MacOS/EP-Compare");

// Not sure necessary so not doing it yet
// component.addOperation("Execute", "chmod", "-R", "a+w", "@TargetDir@");
// component.addOperation("Execute", "chmod", "-R", "a+w", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.app/Contents/MacOS/");
// component.addOperation("Execute", "chmod", "-R", "a+w", "@TargetDir@/PreProcess/IDFVersionUpdater/");

}

// On Windows
if( kernel == "winnt" ) {

// Create Shortcuts in the Windows Start Menu
component.addOperation("CreateShortcut", "@TargetDir@/Documentation/index.html", "@StartMenuDir@/EnergyPlus Documentation.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PostProcess/EP-Compare/EP-Compare.exe", "@StartMenuDir@/EP-Compare.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/EPDraw/EPDrawGUI.exe", "@StartMenuDir@/EPDrawGUI.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/EP-Launch.exe", "@StartMenuDir@/EP-Launch.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles.html", "@StartMenuDir@/Example Files Summary.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles-ObjectsLink.html", "@StartMenuDir@/ExampleFiles Link to Objects.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFEditor/IDFEditor.exe", "@StartMenuDir@/IDFEditor.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.exe", "@StartMenuDir@/IDFVersionUpdater.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/readme.html", "@StartMenuDir@/Readme Notes.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/WeatherConverter/Weather.exe", "@StartMenuDir@/Weather Statistics and Conversions.lnk");


// Note: Associate file types: done separately (optional)

// Here's what stuff gets weird. We need to write stuff to the registry apparently for EP-Launch
// In the registry under KEY_CURRENT_USER\Software\VB and VBA Program Settings\EP-Launch\UpdateCheck:
// Name, Type, Data
// AutoCheck, REG_SZ, True
// CheckURL, REG_SZ, http://nrel.github.io/EnergyPlus/epupdate.htm
// LastAnchor, REG_SZ, #9.1.0-mqjdfsiojf

// REG ADD KeyName /v ValueName, /d Data, /f = force overwrite
var reg = installer.environmentVariable("SystemRoot") + "\\System32\\reg.exe";

var keyName = "HKEY_CURRENT_USER\\Software\\VB and VBA Program Settings\\EP-Launch\\UpdateCheck";

// Note by passing arguments separately to the (reg) command in addElevatedOperation (supports up to 10 args),
// Qt will escape each argument, so do not include double quote (eg: "\"AutoCheck\"") or they'll be interpreted literally
// Mind the "/f" flag which avoids displaying a [Yes/No] prompt that you
// can't answer and making the installer freeze
var valueName = "AutoCheck";
var data = "True";
component.addOperation("Execute", reg, "ADD", keyName, "/v", valueName, "/d", data, "/f");

var valueName = "CheckURL";
var data = "http://nrel.github.io/EnergyPlus/epupdate.htm";
component.addOperation("Execute", reg, "ADD", keyName, "/v", valueName, "/d", data, "/f");

var valueName = "LastAnchor";
var data = "#@Version@";
component.addOperation("Execute", reg, "ADD", keyName, "/v", valueName, "/d", data, "/f");

// Delete the entire keyName upon uninstallation
var keyName = "HKEY_CURRENT_USER\\Software\\VB and VBA Program Settings\\EP-Launch";
component.addOperation("Execute", "cmd", "/C", "echo Set up uninstall operation to delete EP-Launch registry keys", "UNDOEXECUTE", reg, "DELETE", keyName, "/f");

// And weirder still, to copy and register DLLs: done separately
}
}
}








58 changes: 58 additions & 0 deletions cmake/qtifw/install_registerfiletype.qs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Associate file types

function Component()
{
Component.prototype.createOperations = function()
{
// call default implementation
component.createOperations();

// ... add custom operations

var kernel = systemInfo.kernelType;

// On Windows
if( kernel == "winnt" ) {

// We also need to remove the registry entries that the previous
// installers based on NSIS were doing, since there was no clean up back
// then and they are getting in the way of our new RegisterFileType
// (icons not showing on IDF, IMF etc)

// Note: The old stuff also installed things in "HKCR\.idf" etc, but I'm wary
// of touching these since they might have been set to something else
// manually like a text editor for eg
var reg = installer.environmentVariable("SystemRoot") + "\\System32\\reg.exe";

var keyNamesToDelete = [
"EP-Launch.epg", "EP-Launch.idf", "EP-Launch.imf",
"IDFEditor.ddy", "IDFEditor.expidf"
];

for (i = 0; i < keyNamesToDelete.length; i++) {
var keyName = "HKEY_CLASSES_ROOT\\" + keyNamesToDelete[i];
// Delete the entry, silently (/f).
// We specify the return codes to ignore the error when the key didn't exist to begin with (which returns 1)
component.addOperation("Execute", "{0,1}", reg, "DELETE", keyName, "/f");
}

// Note JM: you normally have to quote the %1 which represents the file path, otherwise any space in the path will think there are multiple args
// That is "@TargetDir@/EP-Launch.exe \"%1\""
// Except that EP-Launch.exe doesn't behave like most programs.
// It does its internal escaping/considers whatever is passed as a single argument.
// eg: `C:\EnergyPlusV9-2-0\EP-Launch.exe 5ZoneFPIU - Copy.idf`
// successfully loads a file named `5ZoneFPIU - Copy.idf``
// RegisterFileType: [extension, command, description of filetype, contentType, icon]
// Note: Here you do **not** need to specify the specific iconID, since the EP-launch icon id is actually zero, which is default
// eg: var iconId = 0; icon = "@TargetDir@\\EP-Launch.exe," + iconId
// EP-Launch.exe
component.addElevatedOperation("RegisterFileType", "idf", "@TargetDir@\\EP-Launch.exe %1", "EnergyPlus Input Data File", "text/plain");
component.addElevatedOperation("RegisterFileType", "imf", "@TargetDir@\\EP-Launch.exe %1", "EnergyPlus Input Macro File", "text/plain");
component.addElevatedOperation("RegisterFileType", "epg", "@TargetDir@\\EP-Launch.exe %1", "EnergyPlus Group File", "text/plain");
// IDFEditor.exe
component.addElevatedOperation("RegisterFileType", "ddy", "@TargetDir@\\PreProcess\\IDFEditor\\IDFEditor.exe %1", "EnergyPlus Location and Design Day Data", "text/plain");
component.addElevatedOperation("RegisterFileType", "expidf", "@TargetDir@\\PreProcess\\IDFEditor\\IDFEditor.exe %1", "EnergyPlus Expand Objects Input Data File", "text/plain");

} // End of if winnt
}
}
81 changes: 81 additions & 0 deletions cmake/qtifw/install_win_copydll.qs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Windows commands to be performed elevated: copy and register DLLs

function Component()
{
Component.prototype.createOperations = function()
{
// call default implementation
component.createOperations();

// ... add custom operations

var kernel = systemInfo.kernelType;
// On Windows
if( kernel == "winnt" ) {

// OCX: needs copy AND registration
// DLL and exe: just copy
// Note: the order of ocx/dll in the array matters for registering the ocx!
// To be safe and not depend on order, let's be smarter: we copy
// everything in one pass, then we register the ones that need to be in a
// second pass
var systemArray = [
"MSCOMCTL.OCX", "ComDlg32.OCX", "Msvcrtd.dll", "Dforrt.dll",
"Gswdll32.dll", "Gsw32.exe", "Graph32.ocx",
"MSINET.OCX", "Vsflex7L.ocx", "Msflxgrd.ocx"
];

var systemTargetDir = installer.environmentVariable("SystemRoot");
// Note: all dlls in ./bin/System are 32-bits
if( systemInfo.currentCpuArchitecture == "x86_64") {
// This is where the 32-bit stuff is stored on 64-bit systems
// (despite the name...)
systemTargetDir += "\\SysWOW64\\";
} else {
// This is 32-bit on a 32-bit system
systemTargetDir += "\\System32\\";
}

var regdll = systemTargetDir + "regsvr32.exe";

// Store ocx to be registered
var dllsToReg = [];
for (i = 0; i < systemArray.length; i++) {
var sourceFile = "@TargetDir@\\temp\\" + systemArray[i];
var targetFile = systemTargetDir + systemArray[i];
if (!installer.fileExists(targetFile)) {
console.log("Copying DLL: " + targetFile);
// Copy the DLL (includes reverting on uninstall)
// component.addElevatedOperation("Copy", sourceFile, targetFile);

// Copy without deleting on uninstall (technically the "/Y"
// (=overwrite with no prompt) isn't needed since we tested target
// didn't exist already
component.addElevatedOperation("Execute", "cmd", "/C", "copy", sourceFile, targetFile, "/Y");
// Register it: Only for "OCX"
// If it's a .ocx (case insensitive), we save it to be registered
if (systemArray[i].toLowerCase().indexOf(".ocx") !== -1) {
dllsToReg.push(targetFile);
}
}
}

for (i = 0; i < dllsToReg.length; i++) {
targetFile = dllsToReg[i];
// Mind the "/s" flag which avoids displaying a [Yes/No] prompt
// that you can't answer and making the installer freeze
console.log("Registering DLL: " + [regdll, "/s", targetFile].join(" "));
component.addElevatedOperation("Execute", regdll, "/s", targetFile);
// We do not undo
// "UNDOEXECUTE", regdll, "/u", "/s", targetFile);

}
// Delete this temp directory: use execute to avoid uninstall create
// the opposite (= Mkdir), plus it doesn't delete an empty directory anyways and we use copy (not move) above...
// component.addElevatedOperation("Rmdir", "@TargetDir@/temp");
// /S = recursive, /Q = quiet
component.addElevatedOperation("Execute", "cmd" , "/C", "rmdir", "/S", "/Q", "@TargetDir@\\temp");

}
}
}

7 comments on commit e6f4881

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2553 of 2553 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (9 of 9 tests passed, 0 test warnings)

Build Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-MacOS-10.13-clang: OK (2512 of 2513 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 778
  • Failed: 1

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1179 of 1179 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (671 of 671 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - Win64-Windows-10-VisualStudio-16: OK (2513 of 2513 tests passed, 20 test warnings)

Messages:\n

  • 20 tests had: WRL diffs.

Build Badge Test Badge

Please sign in to comment.