Author: dreimer Date: Fri May 2 08:45:09 2008 New Revision: 33236
URL: http://svn.reactos.org/svn/reactos?rev=33236&view=rev Log: Improve code style. Still tbd. Remove some of the external tools, like buildtime, checknewer etc Fix the last bug which causes the args not to be parsed to make.
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] Fri May 2 08:45:09 2008 @@ -49,8 +49,8 @@ }
# -# Check if the user has chosen to use a different object or output path -# and set it accordingly. +# Check if the user has chosen to use a different object or output path and set +# it accordingly. # if ($_ROSBE_OBJPATH -ne $null) { if ( Test-Path "$_ROSBE_OBJPATH.") { @@ -77,10 +77,9 @@ $DATENAME = get-date -f dyMMyyyy $TIMENAME = get-date -f HHmm
- # -# Check if writing logs is enabled, if so check if our log directory -# exists, if it doesn't, create it. +# Check if writing logs is enabled, if so check if our log directory exists, if +# it doesn't, create it. # if ($_ROSBE_WRITELOG -eq 1) { if (!(Test-Path "$_ROSBE_LOGDIR")) { @@ -92,7 +91,7 @@ if ($_ROSBE_SHOWTIME -eq 1) { if ($_ROSBE_WRITELOG -eq 1) { if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) + $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) } & "$_ROSBE_BASEDIR\Tools\buildtime.exe" "$_ROSBE_MINGWMAKE" $($args) 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" } else { @@ -101,7 +100,7 @@ } else { if ($_ROSBE_WRITELOG -eq 1) { if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) + $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) } & "$_ROSBE_MINGWMAKE" $($args) 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" } else { @@ -119,12 +118,12 @@ # -x2 - Number of CPUs, doubled. # -a - Determine the cpu count based on the inherited process affinity mask. # -$CPUCOUNT= &"$_ROSBE_BASEDIR\Tools\cpucount.exe" -x1 + $CPUCOUNT= &"$_ROSBE_BASEDIR\Tools\cpucount.exe" -x1
if ($_ROSBE_SHOWTIME -eq 1) { if ($_ROSBE_WRITELOG -eq 1) { if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) + $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) } & "$_ROSBE_BASEDIR\Tools\buildtime.exe" "$_ROSBE_MINGWMAKE" -j $CPUCOUNT $($args) 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" } else { @@ -133,7 +132,7 @@ } else { if ($_ROSBE_WRITELOG -eq 1) { if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) + $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) } & "$_ROSBE_MINGWMAKE" -j $CPUCOUNT $($args) 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" } else { @@ -146,15 +145,15 @@ # Check if we are using -j or not. # if ($args.count -gt 1) { -if ($args[0] -eq "multi") { + if ($args[0] -eq "multi") { $host.ui.RawUI.WindowTitle = "makex $($args) parallel build started: $TIMERAW" -} -BUILDMULTI + } + BUILDMULTI } else { -if ($args.count -gt 0) { + if ($args.count -gt 0) { $host.ui.RawUI.WindowTitle = "make $($args) build started: $TIMERAW" -} -BUILD + } + BUILD }
# @@ -163,19 +162,19 @@ "$_ROSBE_BASEDIR\Tools\flash.exe"
if ($_ROSBE_VERSION -ne $null) { -$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" + $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" }
# # Unload all used Vars. # -$ENV:ROS_LEAN_AND_MEAN = "" -$ENV:HOST_CC = "" -$ENV:HOST_CPP = "" -$ENV:TARGET_CC = "" -$ENV:TARGET_CPP = "" -$ENV:ROS_INTERMEDIATE = "" -$ENV:ROS_OUTPUT = "" -$ENV:ROS_TEMPORARY = "" -$ENV:CPUCOUNT = "" -$ENV:CCACHE_DIR = "" +$ENV:ROS_LEAN_AND_MEAN = $null +$ENV:HOST_CC = $null +$ENV:HOST_CPP = $null +$ENV:TARGET_CC = $null +$ENV:TARGET_CPP = $null +$ENV:ROS_INTERMEDIATE = $null +$ENV:ROS_OUTPUT = $null +$ENV:ROS_TEMPORARY = $null +$ENV:CPUCOUNT = $null +$ENV:CCACHE_DIR = $null
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] Fri May 2 08:45:09 2008 @@ -9,20 +9,22 @@ #
# -# Set defaults to work with and override them if edited by -# the options utility. +# Set defaults to work with and override them if edited by the options utility. # (Get-Host).UI.RawUI.ForegroundColor = "Green" (Get-Host).UI.RawUI.BackgroundColor = "Black" cls -if ($APPDATA.Length -lt 1) {$APPDATA = $ENV:USERPROFILE} -$global:PATH = "$ENV:SystemRoot\system32;$ENV:SystemRoot" + +if ($APPDATA.Length -lt 1) { + $APPDATA = $ENV:USERPROFILE +} +$ENV:PATH = "$ENV:SystemRoot\system32;$ENV:SystemRoot" $global:_ROSBE_VERSION = 1.2 $global:0 = $myInvocation.MyCommand.Definition $global:_ROSBE_BASEDIR = [System.IO.Path]::GetDirectoryName($0) $global:_ROSBE_MODE = "RosBE" $global:_ROSBE_ROSSOURCEDIR = "$pwd" -$global:_ROSBE_ORIGINALPATH = "$PATH" +$global:_ROSBE_ORIGINALPATH = "$ENV:PATH" $global:_ROSBE_SHOWTIME = 1 $global:_ROSBE_WRITELOG = 1 $global:_ROSBE_USECCACHE = 0 @@ -36,20 +38,19 @@ # Display the banner and set up the environment for the GCC 4.x.x build # environment. # -function RosBE4 -{ -"*******************************************************************************" -"* *" -"* ReactOS Build Environment $_ROSBE_VERSION *" -"* *" -"*******************************************************************************" -"" -"" -(get-WmiObject Win32_OperatingSystem).caption -# -# Set the correct path for the build tools and set the MinGW make. -# -& "$_ROSBE_BASEDIR\rosbe-gcc-env.ps1" +function RosBE4 { + "*******************************************************************************" + "* *" + "* ReactOS Build Environment $_ROSBE_VERSION *" + "* *" + "*******************************************************************************" + "" + "" + (get-WmiObject Win32_OperatingSystem).caption + # + # Set the correct path for the build tools and set the MinGW make. + # + & "$_ROSBE_BASEDIR\rosbe-gcc-env.ps1" }
# @@ -57,86 +58,85 @@ # that are not actually present. #
-function LOADDOSKEYMACROS -{ -if (Test-Path "$_ROSBE_BASEDIR\chdefdir.ps1") { -set-alias CHDEFDIR "$_ROSBE_BASEDIR\chdefdir.ps1" -scope Global -} +function LOADDOSKEYMACROS { + if (Test-Path "$_ROSBE_BASEDIR\chdefdir.ps1") { + set-alias CHDEFDIR "$_ROSBE_BASEDIR\chdefdir.ps1" -scope Global + }
-if (Test-Path "$_ROSBE_BASEDIR\chdefgcc.ps1") { -set-alias CHDEFGCC "$_ROSBE_BASEDIR\chdefgcc.ps1" -scope Global -} + if (Test-Path "$_ROSBE_BASEDIR\chdefgcc.ps1") { + set-alias CHDEFGCC "$_ROSBE_BASEDIR\chdefgcc.ps1" -scope Global + }
-if (Test-Path "$_ROSBE_BASEDIR\charch.ps1") { -set-alias CHARCH "$_ROSBE_BASEDIR\charch.ps1" -scope Global -} + if (Test-Path "$_ROSBE_BASEDIR\charch.ps1") { + set-alias CHARCH "$_ROSBE_BASEDIR\charch.ps1" -scope Global + }
-set-alias CLEAN "$_ROSBE_BASEDIR\Clean.ps1" -scope Global + set-alias CLEAN "$_ROSBE_BASEDIR\Clean.ps1" -scope Global
-if (Test-Path "$_ROSBE_BASEDIR\Config.ps1") { -set-alias CONFIG "$_ROSBE_BASEDIR\Config.ps1" -scope Global -} + if (Test-Path "$_ROSBE_BASEDIR\Config.ps1") { + set-alias CONFIG "$_ROSBE_BASEDIR\Config.ps1" -scope Global + }
-set-alias HELP "$_ROSBE_BASEDIR\Help.ps1" -scope Global -set-alias MAKE "$_ROSBE_BASEDIR\Build.ps1" -scope Global -set-alias MAKEX "$_ROSBE_BASEDIR\Build.ps1 multi" -scope Global + set-alias HELP "$_ROSBE_BASEDIR\Help.ps1" -scope Global + set-alias MAKE "$_ROSBE_BASEDIR\Build.ps1" -scope Global + set-alias MAKEX "$_ROSBE_BASEDIR\Build.ps1 multi" -scope Global
-if (Test-Path "$_ROSBE_BASEDIR\reladdr2line.ps1") { -set-alias RADDR2LINE "$_ROSBE_BASEDIR\reladdr2line.ps1" -scope Global -} + if (Test-Path "$_ROSBE_BASEDIR\reladdr2line.ps1") { + set-alias RADDR2LINE "$_ROSBE_BASEDIR\reladdr2line.ps1" -scope Global + }
-if (Test-Path "$_ROSBE_BASEDIR\scut.ps1") { -set-alias SCUT "$_ROSBE_BASEDIR\scut.ps1" -scope Global -} + if (Test-Path "$_ROSBE_BASEDIR\scut.ps1") { + set-alias SCUT "$_ROSBE_BASEDIR\scut.ps1" -scope Global + }
-if (Test-Path "$_ROSBE_BASEDIR\sSVN.ps1") { -set-alias SSVN "$_ROSBE_BASEDIR\sSVN.ps1" -scope Global -set-alias SVN "$_ROSBE_BASEDIR\Tools\svn.exe" -scope Global -} + if (Test-Path "$_ROSBE_BASEDIR\sSVN.ps1") { + set-alias SSVN "$_ROSBE_BASEDIR\sSVN.ps1" -scope Global + set-alias SVN "$_ROSBE_BASEDIR\Tools\svn.exe" -scope Global + }
-if (Test-Path "$_ROSBE_BASEDIR\options.ps1") { -set-alias OPTIONS "$_ROSBE_BASEDIR\options.ps1" -scope Global -} + if (Test-Path "$_ROSBE_BASEDIR\options.ps1") { + set-alias OPTIONS "$_ROSBE_BASEDIR\options.ps1" -scope Global + } }
# # Check if RosBE data directory exists, if not, create it. # -if (!(Test-Path "$APPDATA\RosBE")) {New-Item -path "$APPDATA" -name "RosBE" -type directory} +if (!(Test-Path "$APPDATA\RosBE")) { + New-Item -path "$APPDATA" -name "RosBE" -type directory +}
# -# Check if the user has used the options utility and -# if so, load their options. +# Check if the user has used the options utility and if so, load their options. # if (Test-Path "$APPDATA\RosBE\rosbe-options.ps1") { -& "$APPDATA\RosBE\rosbe-options.ps1" + & "$APPDATA\RosBE\rosbe-options.ps1" }
$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# -# Check if we are using oldmode or if any unknown parameters -# were specified. +# Check if we are using oldmode or if any unknown parameters were specified. # if ($args.count -gt 0) { -if ($args[0] = "oldmode") { - cls - $_ROSBE_MODE = "MinGW" + if ($args[0] = "oldmode") { + cls + $_ROSBE_MODE = "MinGW"
-} else { - cls - "Unknown parameter specified. Exiting." -exit -} + } else { + cls + "Unknown parameter specified. Exiting." + exit + } } RosBE4
# -# Load the base directory from srclist.txt and set it as the -# new source directory. +# Load the base directory from srclist.txt and set it as the new source +# directory. # if (Test-Path "$_ROSBE_BASEDIR\scut.ps1") { -& "$_ROSBE_BASEDIR\scut.ps1" + & "$_ROSBE_BASEDIR\scut.ps1" }
# @@ -153,8 +153,8 @@ LOADDOSKEYMACROS
# -# Look if the ReactOS source directory is empty. If so, -# inform the user and mention 'ssvn create' (only if ssvn is installed). +# Look if the ReactOS source directory is empty. If so, inform the user and +# mention 'ssvn create' (only if ssvn is installed). # if (!(Test-Path "$_ROSBE_BASEDIR\sSVN.ps1")) { if ((get-childitem $_ROSBE_ROSSOURCEDIR).Count -le 0) {
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 [iso-8859-1] Fri May 2 08:45:09 2008 @@ -8,8 +8,8 @@ #
# -# Check if we are running within the RosBE, and if not -# initialize GCC for the current directory. +# Check if we are running within the RosBE, and if not initialize GCC for the +# current directory. # if ($ENV:_ROSBE_MINGWPATH -eq $null) { $ENV:_ROSBE_MODE = "MinGW" @@ -57,7 +57,7 @@ } } if (Test-Path "$_ROSBE_MINGWPATH\bin\flex.exe") { -$fver = (& flex --version) -replace ".*version ((\d|.)+).*",'$1' + $fver = (& flex --version) -replace ".*version ((\d|.)+).*",'$1' "flex $fver" } else { if ($_ROSBE_MODE -eq "RosBE") {