Skip to content

Commit

Permalink
otw - Fixed up a few issues for BuildBot. Not quite done yet though...
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemquae committed Sep 6, 2013
1 parent ed55b9d commit f12b054
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// Example commandline usage:
/// "C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutomationManager.BuildAll
/// </summary>
public class AutomationManager
public class OCAutomatedPlayerBuilder
{
[MenuItem ("Build/BuildAll")]
static void BuildAll()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/OpenCog Assets/Config/Resources/embodiment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ GOLD_STANDARD_FILENAME = GoldStandards.txt
# This is the VisibilityMap tile side
# half of the LocalSpaceMap2D grid side (xDim | yDim) is a good value
VISIBILITY_MAP_TILES_PER_SIDE = 64

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace Automation
/// </summary>
#region Class Attributes

#endregion
public class AutomationManager //@TODO: coordinate with David and rename to OCAutomatedPlayerBuild
#endregion
public class OCAutomatedPlayerBuilder //@TODO: coordinate with David and rename to OCAutomatedPlayerBuild
{

/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -80,7 +80,7 @@ static void BuildAll()
[MenuItem ("Build/BuildStandaloneLinux64Player")]
static void BuildStandaloneLinux64Player()
{
string[] scenes = { "Assets/Scenes/Game/Game.unity", "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
string[] scenes = { "Assets/Scenes/Game/Game.unity"};//, "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneLinux64);
BuildPipeline.BuildPlayer(scenes
, "../Players/Unity3DGameWorldPlayer_Linux64"
Expand All @@ -102,7 +102,7 @@ static void BuildStandaloneLinux64TestPlayer()
[MenuItem ("Build/BuildStandaloneLinuxPlayer")]
static void BuildStandaloneLinuxPlayer()
{
string[] scenes = { "Assets/Scenes/Game/Game.unity", "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
string[] scenes = { "Assets/Scenes/Game/Game.unity"};//, "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneLinux);
BuildPipeline.BuildPlayer(scenes
, "../Players/Unity3DGameWorldPlayer_Linux"
Expand All @@ -112,7 +112,7 @@ static void BuildStandaloneLinuxPlayer()
[MenuItem ("Build/BuildStandaloneWindowsPlayer")]
static void BuildStandaloneWindowsPlayer()
{
string[] scenes = { "Assets/Scenes/Game/Game.unity", "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
string[] scenes = { "Assets/Scenes/Game/Game.unity"};//, "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);
BuildPipeline.BuildPlayer(scenes
, "../Players/Unity3DGameWorldPlayer_Windows.exe"
Expand All @@ -122,7 +122,7 @@ static void BuildStandaloneWindowsPlayer()
[MenuItem ("Build/BuildStandaloneWindows64Player")]
static void BuildStandaloneWindows64Player()
{
string[] scenes = { "Assets/Scenes/Game/Game.unity", "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
string[] scenes = { "Assets/Scenes/Game/Game.unity"};//, "Assets/Scenes/MainMenu/MainMenu.unity", "Assets/Scenes/BlockSetViewer/BlockSetViewer.unity" };
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows64);
BuildPipeline.BuildPlayer(scenes
, "../Players/Unity3DGameWorldPlayer_Windows64.exe"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,23 @@ void Awake() {
}
}

#if (TEST_AND_EXIT)
Console.WriteLine("Level Loaded...");
Application.Quit();
#endif
TextAsset configFile = (TextAsset)Resources.Load("embodiment");
if(configFile != null) OCConfig.Instance.LoadFromTextAsset(configFile);
OCConfig.Instance.LoadFromCommandLine();

string testValue = OCConfig.Instance.get("test");
string quitValue = OCConfig.Instance.get("quit");

if(testValue == "internal_XGA")
{
Screen.SetResolution(1024, 768, false);
Console.WriteLine("Level Loaded...");
}

if(quitValue == "true")
{
Application.Quit();
}
}

void Update() {
Expand Down
13 changes: 11 additions & 2 deletions Assets/OpenCog Assets/Scripts/OpenCog/Utility/OCConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ public void OnEnable()

// Testing and Buildbot Integration
//_settings["TEST_AND_EXIT"] = "false"; //Use #define TEST_AND_EXIT instead...
_settings["test"] = "";// will be "internal_XGA" in case of buildbot
_settings["quit"] = "false";// should be "true" in case of buildbot
}

/// <summary>
Expand Down Expand Up @@ -187,7 +189,7 @@ public void LoadFromFile(string fileName)
}
if (_settings.ContainsKey(tokens[0]))
{
//if (Debug.isDebugBuild) Debug.Log(tokens[0] + "=" + tokens[1]);
if (Debug.isDebugBuild) Debug.Log(tokens[0] + "=" + tokens[1]);
_settings[tokens[0]] = tokens[1];
}
else
Expand Down Expand Up @@ -243,7 +245,14 @@ public void LoadFromCommandLine()
string[] keyValuePair = arg.Split(':');
if(keyValuePair != null && _settings.ContainsKey(keyValuePair[0]))
{
_settings[keyValuePair[0]] = keyValuePair[1];
if(keyValuePair[0] != "quit")
{
//if (Debug.isDebugBuild) Debug.Log(tokens[0] + "=" + tokens[1]);
_settings[keyValuePair[0]] = keyValuePair[1];
}
else
_settings["quit"] = "true";

}
else
{
Expand Down
Binary file modified ProjectSettings/EditorBuildSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.

0 comments on commit f12b054

Please sign in to comment.