Skip to content

Commit

Permalink
Better debug output for windows as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchvova committed May 15, 2020
1 parent 727d59a commit 1409ff1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion platform/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ val windows = System.getProperty("os.name").toLowerCase().contains("windows")
val shortOsName = if (windows) "win" else "mac"
val nativeDir = if (windows) {
val resourceDir = coronaResourcesDir?.let { file("$it/../Native/").absolutePath }?.takeIf { file(it).exists() }
(resourceDir ?: System.getenv("CORONA_ROOT")).replace("\\", "/")
(resourceDir ?: "${System.getenv("CORONA_PATH")}/Native").replace("\\", "/")
} else {
val resourceDir = coronaResourcesDir?.let { file("$it/../../../Native/").absolutePath }?.takeIf { file(it).exists() }
resourceDir ?: "${System.getenv("HOME")}/Library/Application Support/Corona/Native/"
Expand Down
1 change: 0 additions & 1 deletion platform/resources/webPackageApp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ local function buildTemplate(templateFolder)
-- hack
if windows then
local path = os.getenv( "CORONA_ROOT" )
cmd = 'z:/corona/link_emscripten.bat'
else
cmd = '/Users/mymac/link_emscripten.sh'
Expand Down
17 changes: 17 additions & 0 deletions platform/windows/Corona.Simulator/Simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,23 @@ BOOL CSimulatorApp::InitInstance()
{
WinString stringTranscoder(Interop::Storage::RegistryStoredPreferences::kAnscaCoronaKeyName);
SetRegistryKey(stringTranscoder.GetTCHAR());

// Hacks to make life easier
CString ret = GetProfileString(L"Preferences", L"debugBuildProcess", L"");
if (ret.GetLength() && _wgetenv(L"DEBUG_BUILD_PROCESS") == NULL) {
_wputenv_s(L"DEBUG_BUILD_PROCESS", ret);
}
if (_wgetenv(L"CORONA_PATH") == NULL) {
TCHAR coronaDir[MAX_PATH];
GetModuleFileName(NULL, coronaDir, MAX_PATH);
TCHAR* end = StrRChr(coronaDir, NULL, '\\');
if (end)
{
end[1] = 0;
_wputenv_s(L"CORONA_PATH", coronaDir);
}

}
}
// Initialize WinGlobalProperties object which mirrors theApp properties
// Make sure this is done before accessing any Corona functions
Expand Down
8 changes: 2 additions & 6 deletions platform/windows/CoronaBuilder/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,15 @@ int main( int argc, const char *argv[] )
if (INVALID_FILE_ATTRIBUTES != GetFileAttributes(builderPath))
{
end[0] = 0;
TCHAR env[MAX_PATH];
wsprintf(env, _T("CORONA_PATH=%s"), builderPath);
_wputenv(env);
_wputenv_s(_T("CORONA_PATH"), builderPath);
}
else
{
StrCpy(end, _T("..\\..\\..\\..\\7za.exe"));
if (INVALID_FILE_ATTRIBUTES != GetFileAttributes(builderPath))
{
end[12] = 0;
TCHAR env[MAX_PATH];
wsprintf(env, _T("CORONA_PATH=%s"), builderPath);
_wputenv(env);
_wputenv_s(_T("CORONA_PATH"), builderPath);
}
else
{
Expand Down
6 changes: 6 additions & 0 deletions tools/CoronaBuilder/Rtt_CoronaBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,13 @@ CoronaBuilder::Main( int argc, const char *argv[] )
String debugBuildProcess;
fServices.GetPreference("debugBuildProcess", &debugBuildProcess);
if(!debugBuildProcess.IsEmpty()) {
#if defined(Rtt_WIN_ENV)
if (getenv("DEBUG_BUILD_PROCESS") == NULL) {
_putenv_s("DEBUG_BUILD_PROCESS", debugBuildProcess);
}
#else
setenv("DEBUG_BUILD_PROCESS", debugBuildProcess, 0);
#endif
}
int result = -1;
Rtt::String ticketData;
Expand Down

0 comments on commit 1409ff1

Please sign in to comment.