예제 #1
0
void BuildAndroid::HandleADBListDevicesComplete(StringHash eventType, VariantMap& eventData)
{
    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();

    int code = eventData[SubprocessComplete::P_RETCODE].GetInt();

    if (!code)
    {
        // check if we have any devices attached, otherwise adb install
        // will hang looking for devices
        bool noDevices = true;
        if (deviceListText_.Length())
        {
            MemoryBuffer reader(deviceListText_.CString(), deviceListText_.Length() + 1);
            while (!reader.IsEof())
            {
                String line = reader.ReadLine();
                if (line.Length() && line[0] >= '0' && line[0] <= '9')
                {
                    noDevices = false;
                    break;
                }
            }
        }

        if (!noDevices)
            RunADBInstall();
        else
        {
            // can't proceed, though success
            buildSystem->BuildComplete(PLATFORMID_ANDROID, buildPath_);
        }

    }
    else
    {
        buildSystem->BuildComplete(PLATFORMID_ANDROID, buildPath_, false);
    }

}
void BuildIOS::HandleEvent(StringHash eventType, VariantMap& eventData)
{

    if (eventType == E_SUBPROCESSOUTPUT)
    {

    }

    if (eventType == E_SUBPROCESSCOMPLETE)
    {
        BuildSystem* buildSystem = GetSubsystem<BuildSystem>();

        int code = eventData[SubprocessComplete::P_RETCODE].GetInt();

        if (!code)
        {
            // success
            if (currentBuildPhase_ == ConvertPList)
            {
                RunCodeSign();
            }
            else if (currentBuildPhase_ == CodeSign)
            {
                RunDeploy();
            }
            else if (currentBuildPhase_ == Deploy)
            {
                buildSystem->BuildComplete(AE_PLATFORM_IOS, buildPath_);
            }

        }
        else
        {
            buildSystem->BuildComplete(AE_PLATFORM_IOS, buildPath_, false);

        }
    }
}
예제 #3
0
void BuildAndroid::HandleAntDebugComplete(StringHash eventType, VariantMap& eventData)
{
    int code = eventData[SubprocessComplete::P_RETCODE].GetInt();

    if (!code)
    {
        RunADBListDevices();
    }
    else
    {
        BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
        buildSystem->BuildComplete(PLATFORMID_ANDROID, buildPath_, false);
    }
}
예제 #4
0
void BuildBase::FailBuild(const String& message)
{
    if (buildFailed_)
    {
        LOGERRORF("BuildBase::FailBuild - Attempt to fail already failed build: %s", message.CString());
        return;
    }

    buildFailed_ = true;

    BuildError(message);

    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
    buildSystem->BuildComplete(platformID_, buildPath_, false, message);

}
예제 #5
0
void BuildMac::Build(const String& buildPath)
{
    ToolSystem* tsystem = GetSubsystem<ToolSystem>();

    buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();

    Initialize();

    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();

    FileSystem* fileSystem = GetSubsystem<FileSystem>();
    if (fileSystem->DirExists(buildPath_))
        fileSystem->RemoveDir(buildPath_, true);

    String dataPath = tsystem->GetDataPath();

    String appSrcPath = dataPath + "Deployment/MacOS/AtomicPlayer.app";

    fileSystem->CreateDir(buildPath_);

    buildPath_ += "/AtomicPlayer.app";

    fileSystem->CreateDir(buildPath_);

    fileSystem->CreateDir(buildPath_ + "/Contents");
    fileSystem->CreateDir(buildPath_ + "/Contents/MacOS");
    fileSystem->CreateDir(buildPath_ + "/Contents/Resources");

    String resourcePackagePath = buildPath_ + "/Contents/Resources/AtomicResources.pak";
    GenerateResourcePackage(resourcePackagePath);

    fileSystem->Copy(appSrcPath + "/Contents/Resources/Atomic.icns", buildPath_ + "/Contents/Resources/Atomic.icns");

    fileSystem->Copy(appSrcPath + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist");
    fileSystem->Copy(appSrcPath + "/Contents/MacOS/AtomicPlayer", buildPath_ + "/Contents/MacOS/AtomicPlayer");

#ifdef ATOMIC_PLATFORM_OSX
    Vector<String> args;
    args.Push("+x");
    args.Push(buildPath_ + "/Contents/MacOS/AtomicPlayer");
    fileSystem->SystemRun("chmod", args);
#endif

    buildPath_ = buildPath + "/Mac-Build";    
    buildSystem->BuildComplete(PLATFORMID_MAC, buildPath_);

}
예제 #6
0
void BuildWindows::Build(const String& buildPath)
{
    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();

    buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();

    BuildLog("Starting Windows Deployment");

    Initialize();

    if (!BuildClean(buildPath_))
        return;

    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();

    FileSystem* fileSystem = GetSubsystem<FileSystem>();

    String rootSourceDir = tenv->GetRootSourceDir();
    String playerBinary = tenv->GetPlayerBinary();
    String d3d9dll = GetPath(playerBinary) + "/D3DCompiler_47.dll";

    if (!BuildCreateDirectory(buildPath_))
        return;

    if (!BuildCreateDirectory(buildPath_ + "/AtomicPlayer_Resources"))
        return;

    String resourcePackagePath = buildPath_ + "/AtomicPlayer_Resources/AtomicResources" + PAK_EXTENSION;
    GenerateResourcePackage(resourcePackagePath);
    if (buildFailed_)
        return;
   
    if (!BuildCopyFile(playerBinary, buildPath_ + "/AtomicPlayer.exe"))
        return;

    if (!BuildCopyFile(d3d9dll, buildPath_ + "/D3DCompiler_47.dll"))
        return;

    BuildAtomicNET();

    BuildLog("Windows Deployment Complete");

    buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_);

}
예제 #7
0
void BuildMac::Build(const String& buildPath)
{
    buildPath_ = buildPath + "/Mac-Build";

    Initialize();

    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();

// BEGIN LICENSE MANAGEMENT
    LicenseSystem *licenseSystem = GetSubsystem<LicenseSystem>();
    if (licenseSystem->IsStandardLicense())
    {
        if (containsMDL_)
        {
            buildSystem->BuildComplete(CE_PLATFORM_MAC, buildPath_, false, true);
            return;
        }
    }
// END LICENSE MANAGEMENT

    FileSystem* fileSystem = GetSubsystem<FileSystem>();
    if (fileSystem->DirExists(buildPath_))
        fileSystem->RemoveDir(buildPath_, true);

 #ifdef CLOCKWORK_PLATFORM_WINDOWS
    String buildSourceDir = fileSystem->GetProgramDir();
 #else
    String buildSourceDir = fileSystem->GetAppBundleResourceFolder();
 #endif

    buildSourceDir += "Deployment/MacOS/ClockworkPlayer.app";

    fileSystem->CreateDir(buildPath_);

    buildPath_ += "/ClockworkPlayer.app";

    fileSystem->CreateDir(buildPath_);

    fileSystem->CreateDir(buildPath_ + "/Contents");
    fileSystem->CreateDir(buildPath_ + "/Contents/MacOS");
    fileSystem->CreateDir(buildPath_ + "/Contents/Resources");

    String resourcePackagePath = buildPath_ + "/Contents/Resources/ClockworkResources.pak";
    GenerateResourcePackage(resourcePackagePath);

    fileSystem->Copy(buildSourceDir + "/Contents/Resources/Clockwork.icns", buildPath_ + "/Contents/Resources/Clockwork.icns");

    fileSystem->Copy(buildSourceDir + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist");
    fileSystem->Copy(buildSourceDir + "/Contents/MacOS/ClockworkPlayer", buildPath_ + "/Contents/MacOS/ClockworkPlayer");

#ifdef CLOCKWORK_PLATFORM_OSX
    Vector<String> args;
    args.Push("+x");
    args.Push(buildPath_ + "/Contents/MacOS/ClockworkPlayer");
    fileSystem->SystemRun("chmod", args);
#endif

    buildPath_ = buildPath + "/Mac-Build";    
    buildSystem->BuildComplete(CE_PLATFORM_MAC, buildPath_);

}
예제 #8
0
void BuildWindows::Build(const String& buildPath)
{
    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
    FileSystem* fileSystem = GetSubsystem<FileSystem>();
    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
    Project* project = tsystem->GetProject();

    buildPath_ = AddTrailingSlash(buildPath);

    if (!resourcesOnly_)
        buildPath_ += GetBuildSubfolder();

    BuildLog("Starting Windows Deployment");

    Initialize();

    if (!resourcesOnly_ && !BuildClean(buildPath_))
        return;

    String rootSourceDir = tenv->GetRootSourceDir();

    if (!BuildCreateDirectory(buildPath_))
        return;

    if (!resourcesOnly_ && !BuildCreateDirectory(buildPath_ + "/AtomicPlayer_Resources"))
        return;

    String resourcePackagePath = buildPath_ + "/AtomicPlayer_Resources/AtomicResources" + PAK_EXTENSION;

    if (resourcesOnly_)
    {
        resourcePackagePath = buildPath_ + "/AtomicResources" + PAK_EXTENSION;
    }

    GenerateResourcePackage(resourcePackagePath);

    if (buildFailed_)
        return;

    if (resourcesOnly_)
        return;

    if (!BuildCreateDirectory(buildPath_ + "/Settings"))
        return;

    String engineJSON(GetSettingsDirectory() + "/Engine.json");

    if (fileSystem->FileExists(engineJSON))
    {
        if (!BuildCopyFile(engineJSON, buildPath_ + "/Settings/Engine.json"))
            return;
    }

    // TODO: Set project as managed and don't key off project assembly

    if (fileSystem->FileExists(project->GetResourcePath() + project->GetProjectSettings()->GetName() + ".dll"))
    {
        if (!BuildManaged(buildPath))
            return;
    }
    else
    {
        BuildNative(buildPath);
    }

    BuildLog("Windows Deployment Complete");

    buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_);

}