[One (M8) Android Development] exSD:
Script to SVN update, Export, build custom and zip IC ROM

Pre-req:

1. Install WinRAR (it should be installed to C:\Program Files\WinRAR\ so you have WinRAR.exe in that folder).

2. Install TortoiseSVN (it should be installed to "C:\Program Files\TortoiseSVN\).

Step 1. Create your working IC Folder. I have mine on my desktop. I call it IC_S7.

Step 2. Create 3 subfolders under IC_S7: custombuild, package, svn. SVN will be your SVN folder. If you already have a SVN folder setup you can use that one - just create the subfolders in the same folder or learn to modify the script to point to the proper folders.

Your folder structure should look like this:

IC_S7\custombuild

IC_S7\package

IC_S7\svn

Step 3. Download package.zip and extract the 3 files in it to IC_S7\package

Step 4. Copy the code here and save it as build_all.bat in the IC7 folder.

@echo off
Title Build_All_IC

set ICFolder=C:\yourPath\IC_S7
set ICFolderSVN=C:\yourPath\IC_S7\svn
set ICFolderCustomBuild=C:\yourPath\IC_S7\custombuild
set ICFolderZip=C:\yourPath\IC_S7\custombuild\*

IF EXIST %ICFolder%\package\revision.txt del %ICFolder%\package\revision.txt
"C:\Program Files\TortoiseSVN\bin\svn.exe" info https://insertcoin-m8.googlecode.com/svn/trunk/ | %ICFolder%\package\grep.exe -i revision | %ICFolder%\package\sed.exe "s/[^0-9]//g" >> %ICFolder%\package\revision.txt
set /p revision=<%ICFolder%\package\revision.txt
IF EXIST %ICFolder%\r%revision%.zip echo ______r%revision%.zip is latest revision. Exiting in 3 seconds.______ & ping -n 4 127.0.0.1 > nul & exit

echo.
echo.
echo ______Updating SVN______

"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:"%ICFolderSVN%" /closeonend:1

echo.
echo.
echo ______Exporting SVN______

IF EXIST %ICFolderCustomBuild% rd /s /q %ICFolderCustomBuild% & ping -n 1 127.0.0.1 > nul
md %ICFolderCustomBuild%

xcopy %ICFolderSVN% %ICFolderCustomBuild% /EXCLUDE:%ICFolder%\misc\no_svn.txt /E /C /I /F /R /Y /Q

echo.
echo.
echo ______Removing Apps Copying Files______

del %ICFolderCustomBuild%\apps\com.android.chrome-1.apk
del %ICFolderCustomBuild%\apps\com.facebook.katana-1.apk
del %ICFolderCustomBuild%\apps\com.google.android.apps.cloudprint-1.apk
del %ICFolderCustomBuild%\apps\com.google.android.apps.plus-1.apk
del %ICFolderCustomBuild%\apps\com.google.android.googlequicksearchbox-1.apk
del %ICFolderCustomBuild%\apps\com.google.android.talk-1.apk
del %ICFolderCustomBuild%\apps\com.twitter.android-1.apk
del %ICFolderCustomBuild%\system\etc\init.d\40s2s

echo.

rd /s /q %ICFolderCustomBuild%\system\app\Cloudex
rd /s /q %ICFolderCustomBuild%\system\app\CalculatorWidget
rd /s /q %ICFolderCustomBuild%\system\app\Font_Yuen
rd /s /q %ICFolderCustomBuild%\system\app\HoloSpiralWallpaper
rd /s /q %ICFolderCustomBuild%\system\app\HTCZero
rd /s /q %ICFolderCustomBuild%\system\app\IMEMurasuIndic
rd /s /q %ICFolderCustomBuild%\system\app\IMEMurasuViet
rd /s /q %ICFolderCustomBuild%\system\app\InsertCoinMarket
rd /s /q %ICFolderCustomBuild%\system\app\InsertCoinThemes
rd /s /q %ICFolderCustomBuild%\system\app\InsertCoinZIPFlasher
rd /s /q %ICFolderCustomBuild%\system\app\LiveWallpapers
rd /s /q %ICFolderCustomBuild%\system\app\VisualizationWallpapers

echo.

rd /s /q %ICFolderCustomBuild%\system\priv-app\DrawingBoard
rd /s /q %ICFolderCustomBuild%\system\priv-app\Facebook
rd /s /q %ICFolderCustomBuild%\system\priv-app\FM_Radio
rd /s /q %ICFolderCustomBuild%\system\priv-app\Frisbee
rd /s /q %ICFolderCustomBuild%\system\priv-app\GooglePlusPlugin
rd /s /q %ICFolderCustomBuild%\system\priv-app\HtcDotMatrix
rd /s /q %ICFolderCustomBuild%\system\priv-app\iCloudTransfer
rd /s /q %ICFolderCustomBuild%\system\priv-app\LinkedIn_Fsplugin
rd /s /q %ICFolderCustomBuild%\system\priv-app\Lucy
rd /s /q %ICFolderCustomBuild%\system\priv-app\MyTask
rd /s /q %ICFolderCustomBuild%\system\priv-app\Twitter
rd /s /q %ICFolderCustomBuild%\tools\carriers\sprint\system\priv-app\SprintInstaller

echo.
echo ______Build Zip______

"C:\Program Files\WinRAR\WinRAR.exe" a -ep1 -r -afzip %ICFolder%\r%revision%.zip %ICFolderZip%

echo.
echo.
echo ______Finished. Exiting in 5 seconds.______ & ping -n 6 127.0.0.1 > nul

Step 5. In the build_all.bat - modify the lines at the top to point to your folder paths (make sure to keep the \* at the end of ICFolderzip).

set ICFolder=C:\yourPath\IC_S7

set ICFolderSVN=C:\yourPath\IC_S7\svn

set ICFolderCustomBuild=C:\yourPath\IC_S7\custombuild

set ICFolderZip=C:\yourPath\IC_S7\custombuild\*

Step 6. Under the ______Removing Apps Copying Files______ section remove any apps you want to keep. I remove apps I don't want. If you have any apps you don't want to build into your .zip you should add the appropriate line of code there.

Step 7. Double click build_all.bat and watch it build. The script first checks if you have a ZIP of the latest revision and exits if you do. If you don't - it will update the SVN, export the SVN, run your app removals and zip it to the name of that revision.

That's all there is to it. If you want to you can copy the SVN Update portion into it's own .bat file so you can run just an update check/download.