platform-builder

Batch file to build Platform Builder subproject


Here is an example of building the OS with a batch file. Here is another.

I don't want to build the whole kernel, just a subproject contained in the OS project. Basically the same thing as what "Build all subprojects" does. (And not make a run-time image after the build.)

What is the command line equivalent of "Build all subprojects"?


Solution

  • Here's an example I've used with VS2008 / Platform Builder 7.

    It looks for subprojects in the specified OSDesign. Any projects found are built with build -c.

    May need a bit of adjustment depending on the Platform Builder version and what you are looking to achieve, but this is the general idea.

    The script leaves behind a setenv.bat file. This may be useful for diagnosing build errors, or can simply be deleted.

    @echo off
    
    set OSDESIGN_NAME=<YourOSDesign>
    set BUILD_CONFIG=<Solution Configuration from VS2008, e.g. YourPlatform Release>
    
    set OSDESIGN_DIR=C:\WINCE700\OSDesigns\%OSDESIGN_NAME%\%OSDESIGN_NAME%
    
    rem Set up build environment (equivalent to clicking Build -> "Open Release Directory in Build Window" in VS2008)
    "C:\Program Files (x86)\Microsoft Platform Builder\7.00\cepb\IdeVS\pbxmlutils" /getbuildenv /workspace "%OSDESIGN_DIR%\%OSDESIGN_NAME%.pbxml" /config "%BUILD_CONFIG%" > setenv.bat && call setenv.bat
    
    @echo off
    
    rem Ensure any build output is copied to the release directory
    set WINCEREL=1
    
    rem Look for subprojects in the OSDesign folder
    for /d %%d in (%OSDESIGN_DIR%\*.*) do if exist "%%d\sources" (
        cd %%d
        build -c
    )
    
    pause