Ejemplo n.º 1
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * SLNNode::Load( IOStream & stream )
{
    NODE_LOAD( AStackString<>,  name );
    NODE_LOAD( AStackString<>,  buildProject );
    NODE_LOAD( AStackString<>,  visualStudioVersion );
    NODE_LOAD( AStackString<>,  minimumVisualStudioVersion );
    NODE_LOAD_DEPS( 1,          staticDeps );

    Array< VSProjectConfig > configs;
    VSProjectConfig::Load( stream, configs );

    Array< SLNSolutionFolder > folders;
    SLNSolutionFolder::Load( stream, folders );

    Array< VCXProjectNode * > projects( staticDeps.GetSize(), false );
    const Dependency * const end = staticDeps.End();
    for ( const Dependency * it = staticDeps.Begin() ; it != end ; ++it )
    {
        projects.Append( it->GetNode()->CastTo< VCXProjectNode >() );
    }

    NodeGraph & ng = FBuild::Get().GetDependencyGraph();
    SLNNode * n = ng.CreateSLNNode( name,
                                    buildProject,
                                    visualStudioVersion,
                                    minimumVisualStudioVersion,
                                    configs,
                                    projects,
                                    folders );
    return n;
}
Ejemplo n.º 2
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * CompilerNode::Load( IOStream & stream )
{
#ifdef USE_NODE_REFLECTION
	NODE_LOAD( AStackString<>, name );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	CompilerNode * cn = ng.CreateCompilerNode( name );

	if ( cn->Deserialize( stream ) == false )
	{
		return nullptr;
	}
	cn->m_Manifest.Deserialize( stream, false ); // false == not remote
	return cn;
#else
	NODE_LOAD( AStackString<>, exeName );
	NODE_LOAD_DEPS( 16,		   staticDeps );
	NODE_LOAD( bool,		   allowDistribution );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	CompilerNode * n = ng.CreateCompilerNode( exeName, staticDeps, allowDistribution );
	n->m_Manifest.Deserialize( stream, false ); // false == not remote
	return n;
#endif
}
Ejemplo n.º 3
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * ObjectListNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
    NODE_LOAD( AStackString<>,  name );
    NODE_LOAD_NODE( CompilerNode,   compilerNode );
    NODE_LOAD( AStackString<>,  compilerArgs );
    NODE_LOAD( AStackString<>,  compilerArgsDeoptimized );
    NODE_LOAD( AStackString<>,  compilerOutputPath );
    NODE_LOAD_DEPS( 16,         staticDeps );
    NODE_LOAD_NODE( Node,       precompiledHeader );
    NODE_LOAD( AStackString<>,  objExtensionOverride );
    NODE_LOAD( AStackString<>,  compilerOutputPrefix );
    NODE_LOAD_DEPS( 0,          compilerForceUsing );
    NODE_LOAD_DEPS( 0,          preBuildDependencies );
    NODE_LOAD( bool,            deoptimizeWritableFiles );
    NODE_LOAD( bool,            deoptimizeWritableFilesWithToken );
    NODE_LOAD( bool,            allowDistribution );
    NODE_LOAD( bool,            allowCaching );
    NODE_LOAD_NODE( CompilerNode, preprocessorNode );
    NODE_LOAD( AStackString<>,  preprocessorArgs );
    NODE_LOAD( AStackString<>,  baseDirectory );
    NODE_LOAD( AStackString<>,  extraPDBPath );
    NODE_LOAD( AStackString<>,  extraASMPath );

    ObjectListNode * n = nodeGraph.CreateObjectListNode( name,
                         staticDeps,
                         compilerNode,
                         compilerArgs,
                         compilerArgsDeoptimized,
                         compilerOutputPath,
                         precompiledHeader ? precompiledHeader->CastTo< ObjectNode >() : nullptr,
                         compilerForceUsing,
                         preBuildDependencies,
                         deoptimizeWritableFiles,
                         deoptimizeWritableFilesWithToken,
                         allowDistribution,
                         allowCaching,
                         preprocessorNode,
                         preprocessorArgs,
                         baseDirectory );
    n->m_ObjExtensionOverride = objExtensionOverride;
    n->m_CompilerOutputPrefix = compilerOutputPrefix;
    n->m_ExtraPDBPath = extraPDBPath;
    n->m_ExtraASMPath = extraASMPath;

    // TODO:B Need to save the dynamic deps, for better progress estimates
    // but we can't right now because we rely on the nodes we depend on
    // being saved before us which isn't the case for dynamic deps.
    //if ( Node::LoadDepArray( fileStream, n->m_DynamicDependencies ) == false )
    //{
    //  FDELETE n;
    //  return nullptr;
    //}
    return n;
}
Ejemplo n.º 4
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * CopyDirNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
    NODE_LOAD( AStackString<>,  name);
    NODE_LOAD_DEPS( 4,          staticDeps );
    NODE_LOAD( AStackString<>,  destPath );
    NODE_LOAD_DEPS( 0,          preBuildDeps );

    CopyDirNode * n = nodeGraph.CreateCopyDirNode( name, staticDeps, destPath, preBuildDeps );
    ASSERT( n );
    return n;
}
Ejemplo n.º 5
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * DirectoryListNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
	NODE_LOAD( AStackString<>,	name );
	NODE_LOAD( AStackString<>,	path );
	NODE_LOAD( Array< AString >,patterns );
	NODE_LOAD( Array< AString >,excludePaths );
	NODE_LOAD( bool,			recursive );
    NODE_LOAD( Array< AString >, filesToExclude );

	Node * n = nodeGraph.CreateDirectoryListNode( name, path, &patterns, recursive, excludePaths, filesToExclude );
	ASSERT( n );
	return n;
}
Ejemplo n.º 6
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * DirectoryListNode::Load( IOStream & stream )
{
	NODE_LOAD( AStackString<>,	name );
	NODE_LOAD( AStackString<>,	path );
	NODE_LOAD( Array< AString >,patterns );
	NODE_LOAD( Array< AString >,excludePaths );
	NODE_LOAD( bool,			recursive );
    NODE_LOAD( Array< AString >, filesToExclude );


	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	Node * n = ng.CreateDirectoryListNode( name, path, &patterns, recursive, excludePaths, filesToExclude );
	ASSERT( n );
	return n;
}
Ejemplo n.º 7
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * CSNode::Load( IOStream & stream )
{
	NODE_LOAD( AStackString<>,	name );
	NODE_LOAD_DEPS( 2,			staticDeps );
	NODE_LOAD( AStackString<>,	compilerPath );
	NODE_LOAD( AStackString<>,	compilerArgs );
	NODE_LOAD_DEPS( 0,			extraRefs );

	ASSERT( staticDeps.GetSize() >= 1 );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	Node * on = ng.CreateCSNode( name, staticDeps, compilerPath, compilerArgs, extraRefs );
	CSNode * csNode = on->CastTo< CSNode >();
	return csNode;
}
Ejemplo n.º 8
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * FileNode::Load( IOStream & stream )
{
	NODE_LOAD( AStackString<>,	fileName );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	Node * n = ng.CreateFileNode( fileName );
	ASSERT( n );
	return n;
}
Ejemplo n.º 9
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * XCodeProjectNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
	NODE_LOAD( AStackString<>, name );

	auto * n = nodeGraph.CreateXCodeProjectNode( name );

	if ( n->Deserialize( nodeGraph, stream ) == false )
	{
		return nullptr;
	}
	return n;
}
Ejemplo n.º 10
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * AliasNode::Load( IOStream & stream )
{
#ifdef USE_NODE_REFLECTION
	NODE_LOAD( AStackString<>, name );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	AliasNode * an = ng.CreateAliasNode( name );

	if ( an->Deserialize( stream ) == false )
    {
		return nullptr;
	}
	return an;
#else
	NODE_LOAD( AStackString<>, name );
	NODE_LOAD_DEPS( 0, targets );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	return ng.CreateAliasNode( name, targets );
#endif
}
Ejemplo n.º 11
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * ExecNode::Load( IOStream & stream )
{
    NODE_LOAD( AStackString<>,	fileName );
    NODE_LOAD( AStackString<>,	sourceFile );
    NODE_LOAD( AStackString<>,	executable );
    NODE_LOAD( AStackString<>,	arguments );
    NODE_LOAD( AStackString<>,	workingDir );
    NODE_LOAD( int32_t,			expectedReturnCode );
    NODE_LOAD_DEPS( 0,			preBuildDependencies );

    NodeGraph & ng = FBuild::Get().GetDependencyGraph();
    Node * srcNode = ng.FindNode( sourceFile );
    ASSERT( srcNode ); // load/save logic should ensure the src was saved first
    ASSERT( srcNode->IsAFile() );
    Node * execNode = ng.FindNode( executable );
    ASSERT( execNode ); // load/save logic should ensure the src was saved first
    ASSERT( execNode->IsAFile() );
    ExecNode * n = ng.CreateExecNode( fileName,
                                      (FileNode *)srcNode,
                                      (FileNode *)execNode,
                                      arguments,
                                      workingDir,
                                      expectedReturnCode,
                                      preBuildDependencies );
    ASSERT( n );

    return n;
}
Ejemplo n.º 12
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * TestNode::Load( IOStream & stream )
{
	NODE_LOAD( AStackString<>, name );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	TestNode * node = ng.CreateTestNode( name );

	if ( node->Deserialize( stream ) == false )
	{
		return nullptr;
	}
	return node;
}
Ejemplo n.º 13
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * RemoveDirNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
    NODE_LOAD( AStackString<>, name );

    RemoveDirNode * node = nodeGraph.CreateRemoveDirNode( name );

    if ( node->Deserialize( nodeGraph, stream ) == false )
    {
        return nullptr;
    }

    return node;
}
Ejemplo n.º 14
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * XCodeProjectNode::Load( IOStream & stream )
{
	NODE_LOAD( AStackString<>, name );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	auto * n = ng.CreateXCodeProjectNode( name );

	if ( n->Deserialize( stream ) == false )
	{
		return nullptr;
	}
	return n;
}
Ejemplo n.º 15
0
// Load
//------------------------------------------------------------------------------
/*static*/ Node * ExeNode::Load( NodeGraph & nodeGraph, IOStream & stream )
{
    // common Linker properties
    NODE_LOAD( AStackString<>,  name );
    NODE_LOAD( AStackString<>,  linkerType );
    NODE_LOAD( AStackString<>,  linker );
    NODE_LOAD( AStackString<>,  linkerArgs );
    NODE_LOAD_DEPS( 0,          inputLibs);
    NODE_LOAD( uint32_t,        flags );
    NODE_LOAD_DEPS( 0,          assemblyResources );
    NODE_LOAD_DEPS( 0,          otherLibs );
    NODE_LOAD( AStackString<>,  importLibName );
    NODE_LOAD_NODE( Node,       linkerStampExe );
    NODE_LOAD( AStackString<>,  linkerStampExeArgs );

    ExeNode * en = nodeGraph.CreateExeNode( name, inputLibs, otherLibs, linkerType, linker, linkerArgs, flags, assemblyResources, importLibName, linkerStampExe, linkerStampExeArgs );
    return en;
}